0001 function cdef = editMiller(cdef, P)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 clc
0023 sel = 1;
0024
0025 while sel ~= 0
0026
0027 list = {'Add Face'};
0028 if isfield(cdef, 'millerDefined') && ~isempty(cdef.millerDefined)
0029 list{end+1} = 'Delete Face';
0030 list{end+1} = 'Summary';
0031 end
0032 disp('/---------------------------------->');
0033 disp('| Subsection: Edit Miller Indices');
0034 sel = selectFromList(list, 'Back');
0035 if sel == 0
0036 continue;
0037 end
0038
0039
0040 switch list{sel}
0041
0042 case 'Add Face'
0043
0044 if ~isfield(cdef, 'millerDefined')
0045 cdef.millerDefined = [];
0046 end
0047
0048 cdef.millerDefined(end+1,:) = selectMillerVector;
0049 disp(' ');
0050 completeMillerMatrixFromForm = ...
0051 executeExternBorchertFunction('form2face', ...
0052 cdef.millerDefined(end,:), P(2, cdef.sym.defined));
0053 strings = convertMillerToString(...
0054 completeMillerMatrixFromForm);
0055
0056 if ~iscell(strings)
0057 disp(' No additional facets are created due to symmetry.');
0058 else
0059 disp(' This gives the following set of faces: ');
0060 str = '';
0061 for i = 1:length(strings)
0062 str = [str ', ' strings{i}];
0063 end
0064 str(1:2) = ' ';
0065 disp(str);
0066 end
0067 pause
0068 clc
0069
0070 case 'Delete Face'
0071
0072 disp(' ');
0073 disp('Please select the Miller indices to delete');
0074 list = {};
0075 for i = 1:size(cdef.millerDefined, 1)
0076 list{i} = convertMillerToString(...
0077 cdef.millerDefined(i, :));
0078 end
0079 delindex = selectFromList(list, 'none');
0080 if delindex ~=0
0081 cdef.millerDefined(delindex, :) = [];
0082 disp('..face deleted');
0083 end
0084 clc
0085
0086 case 'Summary'
0087
0088 printMillerSummary(cdef, P)
0089 pause
0090 clc
0091 end
0092 end