-
Notifications
You must be signed in to change notification settings - Fork 2
/
CssDirections.m
45 lines (42 loc) · 1.09 KB
/
CssDirections.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
classdef CssDirections < int32
%CSSDIRECTIONS
% class with the line directions definition
enumeration
forward (0)
reverse (1)
end
methods
function out = str(self)
out = {};
for i = 1:length(self)
if self(i) == 0
out = [out; {'Forward'}];
else
out = [out; {'Reverse'}];
end
end
end
function out = Flip(self)
out = [];
for i = 1:length(self)
if self(i) == 0
out = [out; CssDirections.reverse];
else
out = [out; CssDirections.forward];
end
end
if ~isempty(out)
out = reshape(out(:), size(self));
end
end
end
methods(Static)
function out = ToDirection(value)
if value == 0
out = CssDirections.forward;
else
out = CssDirections.reverse;
end
end
end
end