editMiller

PURPOSE ^

submenu for editing the Miller indices

SYNOPSIS ^

function cdef = editMiller(cdef, P)

DESCRIPTION ^

 submenu for editing the Miller indices

 THIS IS NO USER FUNCTION

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cdef = editMiller(cdef, P)
0002 % submenu for editing the Miller indices
0003 %
0004 % THIS IS NO USER FUNCTION
0005 
0006 % The elk-library: convex geometry applied to crystallization modeling.
0007 %   Copyright (C) 2013 Alexander Reinhold
0008 %
0009 % This program is free software: you can redistribute it and/or modify it
0010 %   under the terms of the GNU General Public License as published by the
0011 %   Free Software Foundation, either version 3 of the License, or (at your
0012 %   option) any later version.
0013 %
0014 % This program is distributed in the hope that it will be useful, but
0015 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0016 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017 %   General Public License for more details.
0018 %
0019 % You should have received a copy of the GNU General Public License along
0020 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 clc
0023 sel = 1;
0024 
0025 while sel ~= 0
0026     %% main menu
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             %% add face
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             %% delete face
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             %% print summary
0088             printMillerSummary(cdef, P)
0089             pause
0090             clc
0091     end
0092 end

Generated on Sat 18-Jul-2015 16:45:31 by m2html © 2005