-
Notifications
You must be signed in to change notification settings - Fork 0
/
Point.m
47 lines (44 loc) · 1.34 KB
/
Point.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
45
46
47
classdef Point < handle
properties
xyz
pointName
planeName
numObs
imgNames
stdFN
stdFixed
end
methods
function obj = Point(varargin)
if length(varargin) == 2
obj.xyz = varargin{1};
obj.pointName = obj.GenerateRandomPointName(10);
obj.planeName = varargin{2}.name;
obj.numObs = 0;
obj.imgNames = [];
obj.stdFN = 0;
obj.stdFixed = 0;
elseif length(varargin) == 1
obj.xyz = varargin{1};
obj.pointName = obj.GenerateRandomPointName(10);
obj.planeName = '';
obj.numObs = 0;
obj.imgNames = [];
obj.stdFN = 0;
obj.stdFixed = 0;
end
end
end
methods (Static)
function name = GenerateRandomPointName(lengthOfName)
setOfValidChars = char(['a':'z','0':'9']);
num = length(setOfValidChars );
randIndexs = ceil( num*rand(1,lengthOfName) );
name = char(zeros(size(1,lengthOfName)));
for i = 1:lengthOfName
name(i) = setOfValidChars(randIndexs(i));
end
name = ['P',name];
end
end
end