-
Notifications
You must be signed in to change notification settings - Fork 0
/
Face.m
74 lines (64 loc) · 2.38 KB
/
Face.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
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
classdef Face < handle
% Properties
properties(GetAccess = 'private', SetAccess = 'private')
ID=0; % Face identifier (1-6)
position=[]; % Position of the face
dimensions=[]; % Dimensions of the face
face_transitions=[]; % Specifies face transitions
side_transitions=[]; % Specifies side transitions
MTs={}; % Stores the MTs currently in this face
end
methods
% Constructor
function this=Face(new_ID,new_position,new_dimensions,new_face_transitions,new_side_transitions)
this.ID=new_ID; % Sets ID
this.position=new_position.*1e-6; % Sets position
this.dimensions=new_dimensions.*1e-6; % Sets dimensions
this.face_transitions=new_face_transitions; % Sets face transitions
this.side_transitions=new_side_transitions; % Sets side transitions
end
% This function returns the Face ID
function res=get_ID(this)
res=this.ID;
end
% This function returns the Face position
function res=get_position(this)
res=this.position;
end
% This function returns Face dimensions
function res=get_dimensions(this)
res=this.dimensions;
end
% This function returns Face transitions
function res=get_face_transitions(this)
res=this.face_transitions;
end
% This function returns Side transitions
function res=get_side_transitions(this)
res=this.side_transitions;
end
% This function returns the Microtubules
function res=get_MTs(this)
res=this.MTs;
end
% This function sets the Microtubules
function set_MTs(this,new_MTs)
this.MTs=new_MTs;
end
% This function adds a new MT to the Face
function add_MT(this,new_MT)
this.MTs{end+1}=new_MT;
end
% This function removes MTs from the face
function remove_MTs(this,positions)
this.MTs(positions)=[];
end
% This function returns the 4 distinct points of a cube face
function [a b c d]=get_rect_points(this)
a=this.position;
c=a+this.dimensions;
b=[a(1) c(2)];
d=[c(1) a(2)];
end
end
end