Skip to content

Commit ceaf790

Browse files
committed
working around #606
no Miller.dispStyle can be either character or enumeration enforcing variable type is only supported starting with Matlab 2019b so MTEX should not depend on it however in the case of MillerConvention it makes the code much easier hence we should take back this commit one we can assume everybody has at least Matlab 2019b
1 parent 22832e1 commit ceaf790

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

geometry/@Miller/cat.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
error('I can not store Miller indices with respect to different crystal symmetries within one list');
1818
end
1919

20-
if ms.dispStyle ~= m.dispStyle
20+
if MillerConvention(ms.dispStyle) ~= MillerConvention(m.dispStyle)
2121
warning(['Miller indices are converted to ' char(m.dispStyle)]);
2222
end
2323
end

geometry/@Miller/char.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
format = get_flag(varargin,{'hkl','hkil','uvw','UVTW'});
1313
if ~isempty(format), m.dispStyle = format; end
1414

15-
[leftBracket, rightBracket] = m.dispStyle.brackets;
15+
16+
[leftBracket, rightBracket] = brackets(MillerConvention(m.dispStyle));
1617

1718
abc = m.coordinates;
1819

geometry/@Miller/cross.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
m = cross@vector3d(m1,m2);
1414

1515
% switch from recirprocal to direct and vice verca
16-
m.dispStyle = -m.dispStyle;
16+
m.dispStyle = MillerConvention(-MillerConvention(m.dispStyle));

geometry/@Miller/perp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
% Output
1111
% n - @Miller
1212

13-
m = Miller(perp@vector3d(m),m.CS,-m.dispStyle);
13+
m = Miller(perp@vector3d(m),m.CS,MillerConvention(-MillerConvention(m.dispStyle)));
1414

1515
end

geometry/@orientation/round2Miller.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
hkl = round(hkl,varargin{:});
4646

4747
uvw = mori \ vector3d.X;
48-
uvw.dispStyle = -uvw.dispStyle; % direct lattice
48+
uvw.dispStyle = MillerConvention(-MillerConvention(uvw.dispStyle)); % direct lattice
4949
uvw = round(uvw);
5050

5151
if nargout == 0

plotting/sphericalPlot.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ function plotLabels(sP,CS,varargin)
315315
h = Miller(unique(h),CS);
316316

317317
% try direct coordinates
318-
h.dispStyle = abs(h.dispStyle);
318+
h.dispStyle = abs(MillerConvention(h.dispStyle));
319319

320320
% if this gives no integer values - go to reciprocal coordinates
321-
if any(angle(round(h),h)>1e-5), h.dispStyle = -h.dispStyle; end
321+
if any(angle(round(h),h)>1e-5), h.dispStyle = -MillerConvention(h.dispStyle); end
322322
h = round(h);
323323
end
324324

0 commit comments

Comments
 (0)