-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullFigureData3D.m
More file actions
141 lines (133 loc) · 5.86 KB
/
FullFigureData3D.m
File metadata and controls
141 lines (133 loc) · 5.86 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
classdef FullFigureData3D
properties
AxesList; % All the axes
ClusterXList; % All the Cluster x data, across axes, in the same
% order as the axes are listed
ClusterYList;
ClusterZList;
ClusterColorList;
ClusterAlphaList;
SilhouetteFaceList;
SilhouetteVertexList;
SilhouetteColorList;
SilhouetteAlphaList;
PerceptualTrajectoryXList;
PerceptualTrajectoryYList;
PerceptualTrajectoryZList;
PerceptualTrajectoryColorList;
ResultXList;
ResultYList;
ResultZList;
ResultColorList;
JunctureSizes;
ResultPointSizes;
end
methods
function obj = FullFigureData3D(axesList, clusterXList, ...
clusterYList, clusterZList, clusterColorList, clusterAlphaList, ...
silhouetteFaceList, silhouetteVertexList, ...
silhouetteColorList, silhouetteAlphaList, ...
trajectoryXList, trajectoryYList, trajectoryZList, trajectoryColorList, ...
resultXList, resultYList, resultZList, resultColorList, ...
junctureSizes, resultPointSizes)
obj.AxesList = axesList;
obj.ClusterXList = clusterXList;
obj.ClusterYList = clusterYList;
obj.ClusterZList = clusterZList;
obj.ClusterColorList = clusterColorList;
obj.ClusterAlphaList = clusterAlphaList;
obj.SilhouetteFaceList = silhouetteFaceList;
obj.SilhouetteVertexList = silhouetteVertexList;
obj.SilhouetteColorList = silhouetteColorList;
obj.SilhouetteAlphaList = silhouetteAlphaList;
obj.PerceptualTrajectoryXList = trajectoryXList;
obj.PerceptualTrajectoryYList = trajectoryYList;
obj.PerceptualTrajectoryZList = trajectoryZList;
obj.PerceptualTrajectoryColorList = trajectoryColorList;
obj.ResultXList = resultXList;
obj.ResultYList = resultYList;
obj.ResultZList = resultZList;
obj.ResultColorList = resultColorList;
obj.JunctureSizes = junctureSizes;
obj.ResultPointSizes = resultPointSizes;
end
function PlotFigures(obj)
% For each axes, plot the appropriate things -- clusters first,
% then silhouette, then perceptual trajectory, then result
for ax = 1:length(obj.AxesList)
CurrentAxes = obj.AxesList{ax,1};
hold(CurrentAxes, "on");
end
for n = 1:length(obj.AxesList)
% Clusters
if ~isempty(obj.ClusterXList{n,1})
scatter3(obj.AxesList{n,1}, obj.ClusterXList{n,1}, ...
obj.ClusterYList{n,1}, obj.ClusterZList{n,1}, ...
obj.JunctureSizes, ...
obj.ClusterColorList{n,1}, "filled", ...
"MarkerFaceAlpha", "flat", ...
"MarkerEdgeAlpha", "flat", ...
"AlphaDataMapping", "none", ...
"AlphaData", obj.ClusterAlphaList{n,1});
end
% Silhouette
if ~isempty(obj.SilhouetteFaceList{n,1})
patch(obj.AxesList{n,1}, "Faces", ...
obj.SilhouetteFaceList{n,1}, "Vertices", ...
obj.SilhouetteVertexList{n,1}, "FaceVertexCData", ...
obj.SilhouetteColorList{n,1}, ...
"FaceColor", "flat", "EdgeColor", [1 1 1], ...
"FaceVertexAlphaData", obj.SilhouetteAlphaList{n,1}, ...
"FaceAlpha", "flat", "AlphaDataMapping", "none");
end
% PerceptualTrajectory
if ~isempty(obj.PerceptualTrajectoryXList{n,1})
scatter3(obj.AxesList{n,1}, obj.PerceptualTrajectoryXList{n,1}, ...
obj.PerceptualTrajectoryYList{n,1}, obj.PerceptualTrajectoryZList{n,1}, ...
obj.ResultPointSizes, ...
obj.PerceptualTrajectoryColorList{n,1}, "filled");
end
% Results
if ~isempty(obj.ResultXList{n,1})
scatter3(obj.AxesList{n,1}, obj.ResultXList{n,1}, ...
obj.ResultYList{n,1}, obj.ResultZList{n,1}, obj.ResultPointSizes, ...
obj.ResultColorList{n,1}, "filled");
end
end
end
function EnterInteractionMode(obj)
fprintf("Type a, enter to rotate left\n d, enter to rotate right \n exit, enter to exit this mode\n");
rotation = input("< a | d > : ", "s");
while (rotation ~= "exit")
if rotation == "a"
obj.RotateLeft();
elseif rotation == "d"
obj.RotateRight();
else
fprintf("%s is not an allowed input", rotation);
end
rotation = input("< a | d > : ", "s");
end
end
function RotateLeft(obj)
for axesIndex = 1:length(obj.AxesList)
obj.AxesList{axesIndex}.View = obj.AxesList{axesIndex}.View + [-15 0];
end
end
function RotateRight(obj)
for axesIndex = 1:length(obj.AxesList)
obj.AxesList{axesIndex}.View = obj.AxesList{axesIndex}.View + [15 0];
end
end
function RotateUp(obj)
for axesIndex = 1:length(obj.AxesList)
obj.AxesList{axesIndex}.View = obj.AxesList{axesIndex}.View + [0 15];
end
end
function RotateDown(obj)
for axesIndex = 1:length(obj.AxesList)
obj.AxesList{axesIndex}.View = obj.AxesList{axesIndex}.View + [0 -15];
end
end
end
end