1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | from ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_primitive import GM_Primitive |
---|
22 | from ascore.utils import has_value, collectionProofHash |
---|
23 | |
---|
24 | ''' |
---|
25 | Created on 10-Jul-2012 14:15:04 |
---|
26 | |
---|
27 | @author: mnagni |
---|
28 | ''' |
---|
29 | |
---|
30 | class GM_OrientablePrimitive(GM_Primitive): |
---|
31 | ''' |
---|
32 | Represents a data entity defined in a UML diagram and supposed to |
---|
33 | be persisted in a relational database. |
---|
34 | |
---|
35 | This class has been genererated automatically using the Apache Velocity project. |
---|
36 | ''' |
---|
37 | ''' |
---|
38 | Please note that any access to the inner attributes should be done using |
---|
39 | the given get/set methods and NOT accessing them directly. |
---|
40 | ''' |
---|
41 | def __init__(self): |
---|
42 | self._gm_primitive = GM_Primitive() |
---|
43 | |
---|
44 | self.CRS = None |
---|
45 | self.orientation = None |
---|
46 | self.proxy = None |
---|
47 | self._primitive_simplex = None |
---|
48 | self._primitive_gm_solid = None |
---|
49 | self._primitive_cell = None |
---|
50 | self._primitive_gm_orientableprimitive = None |
---|
51 | self._primitive_gm_point = None |
---|
52 | self._primitive = None |
---|
53 | super(GM_OrientablePrimitive, self).__init__() |
---|
54 | @property |
---|
55 | def topology(self): |
---|
56 | return self._gm_primitive.topology |
---|
57 | |
---|
58 | @topology.setter |
---|
59 | def topology(self, value): |
---|
60 | self._gm_primitive.topology = value |
---|
61 | @property |
---|
62 | def containedPrimitive(self): |
---|
63 | return self._gm_primitive.containedPrimitive |
---|
64 | |
---|
65 | @containedPrimitive.setter |
---|
66 | def containedPrimitive(self, value): |
---|
67 | self._gm_primitive.containedPrimitive = value |
---|
68 | @property |
---|
69 | def composite(self): |
---|
70 | return self._gm_primitive.composite |
---|
71 | |
---|
72 | @composite.setter |
---|
73 | def composite(self, value): |
---|
74 | self._gm_primitive.composite = value |
---|
75 | @property |
---|
76 | def CRS(self): |
---|
77 | return self._gm_primitive.CRS |
---|
78 | |
---|
79 | @CRS.setter |
---|
80 | def CRS(self, value): |
---|
81 | self._gm_primitive.CRS = value |
---|
82 | @property |
---|
83 | def proxy(self): |
---|
84 | return self._gm_primitive.proxy |
---|
85 | |
---|
86 | @proxy.setter |
---|
87 | def proxy(self, value): |
---|
88 | self._gm_primitive.proxy = value |
---|
89 | @property |
---|
90 | def containingPrimitive(self): |
---|
91 | return self._gm_primitive.containingPrimitive |
---|
92 | |
---|
93 | @containingPrimitive.setter |
---|
94 | def containingPrimitive(self, value): |
---|
95 | self._gm_primitive.containingPrimitive = value |
---|
96 | @property |
---|
97 | def complex(self): |
---|
98 | return self._gm_primitive.complex |
---|
99 | |
---|
100 | @complex.setter |
---|
101 | def complex(self, value): |
---|
102 | self._gm_primitive.complex = value |
---|
103 | @property |
---|
104 | def primitive(self): |
---|
105 | if(has_value(self._primitive_simplex)): |
---|
106 | return self._primitive_simplex |
---|
107 | if(has_value(self._primitive_gm_solid)): |
---|
108 | return self._primitive_gm_solid |
---|
109 | if(has_value(self._primitive_cell)): |
---|
110 | return self._primitive_cell |
---|
111 | if(has_value(self._primitive_gm_orientableprimitive)): |
---|
112 | return self._primitive_gm_orientableprimitive |
---|
113 | if(has_value(self._primitive_gm_point)): |
---|
114 | return self._primitive_gm_point |
---|
115 | return None |
---|
116 | |
---|
117 | @primitive.setter |
---|
118 | def primitive(self, value): |
---|
119 | valueClass = "%s.%s" % (type(value).__module__,type(value).__name__) |
---|
120 | if valueClass == "ea_model.informative.spatial_examples_from_iso_19107.application_schema.simplicial_topology.simplex.Simplex": |
---|
121 | self._primitive_simplex = value |
---|
122 | self._primitive_gm_solid = None |
---|
123 | self._primitive_cell = None |
---|
124 | self._primitive_gm_orientableprimitive = None |
---|
125 | self._primitive_gm_point = None |
---|
126 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_solid.GM_Solid": |
---|
127 | self._primitive_gm_solid = value |
---|
128 | self._primitive_simplex = None |
---|
129 | self._primitive_cell = None |
---|
130 | self._primitive_gm_orientableprimitive = None |
---|
131 | self._primitive_gm_point = None |
---|
132 | if valueClass == "ea_model.informative.spatial_examples_from_iso_19107.application_schema.topology_simple.cellular_topology.cell.Cell": |
---|
133 | self._primitive_cell = value |
---|
134 | self._primitive_simplex = None |
---|
135 | self._primitive_gm_solid = None |
---|
136 | self._primitive_gm_orientableprimitive = None |
---|
137 | self._primitive_gm_point = None |
---|
138 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_orientableprimitive.GM_OrientablePrimitive": |
---|
139 | self._primitive_gm_orientableprimitive = value |
---|
140 | self._primitive_simplex = None |
---|
141 | self._primitive_gm_solid = None |
---|
142 | self._primitive_cell = None |
---|
143 | self._primitive_gm_point = None |
---|
144 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_point.GM_Point": |
---|
145 | self._primitive_gm_point = value |
---|
146 | self._primitive_simplex = None |
---|
147 | self._primitive_gm_solid = None |
---|
148 | self._primitive_cell = None |
---|
149 | self._primitive_gm_orientableprimitive = None |
---|
150 | |
---|
151 | def synchronize(self): |
---|
152 | pass |
---|
153 | |
---|
154 | def __key(self): |
---|
155 | return (self.topology, self.containedPrimitive, self.composite, self.CRS, self.orientation, self.proxy, self.containingPrimitive, self.complex, self.primitive) |
---|
156 | |
---|
157 | def __eq__(self, y): |
---|
158 | if type(self) != type(y): |
---|
159 | return False |
---|
160 | ''' |
---|
161 | Cannot compare classes which do not define a "__key" attribute |
---|
162 | ''' |
---|
163 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
164 | return self.__key() == y.__key() |
---|
165 | return id(self) == id(y) |
---|
166 | |
---|
167 | def __hash__(self): |
---|
168 | return collectionProofHash(self.__key()) |
---|