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_complex.gm_composite import GM_Composite |
---|
22 | from ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_orientablecurve import GM_OrientableCurve |
---|
23 | from ascore.utils import has_value, collectionProofHash |
---|
24 | |
---|
25 | ''' |
---|
26 | Created on 10-Jul-2012 14:15:09 |
---|
27 | |
---|
28 | @author: mnagni |
---|
29 | ''' |
---|
30 | |
---|
31 | class GM_CompositeCurve(GM_Composite,GM_OrientableCurve): |
---|
32 | ''' |
---|
33 | Represents a data entity defined in a UML diagram and supposed to |
---|
34 | be persisted in a relational database. |
---|
35 | |
---|
36 | This class has been genererated automatically using the Apache Velocity project. |
---|
37 | ''' |
---|
38 | ''' |
---|
39 | Please note that any access to the inner attributes should be done using |
---|
40 | the given get/set methods and NOT accessing them directly. |
---|
41 | ''' |
---|
42 | def __init__(self): |
---|
43 | self._gm_orientablecurve = GM_OrientableCurve() |
---|
44 | self._gm_composite = GM_Composite() |
---|
45 | |
---|
46 | self.orientation = None |
---|
47 | self._generator_gm_compositecurve = [] |
---|
48 | self._generator_gm_curve = [] |
---|
49 | self._generator = [] |
---|
50 | self.CRS = None |
---|
51 | self.proxy = None |
---|
52 | self.primitive = None |
---|
53 | super(GM_CompositeCurve, self).__init__() |
---|
54 | @property |
---|
55 | def containedPrimitive(self): |
---|
56 | return self._gm_orientablecurve.containedPrimitive |
---|
57 | |
---|
58 | @containedPrimitive.setter |
---|
59 | def containedPrimitive(self, value): |
---|
60 | self._gm_orientablecurve.containedPrimitive = value |
---|
61 | @property |
---|
62 | def composite(self): |
---|
63 | return self._gm_orientablecurve.composite |
---|
64 | |
---|
65 | @composite.setter |
---|
66 | def composite(self, value): |
---|
67 | self._gm_orientablecurve.composite = value |
---|
68 | @property |
---|
69 | def composite(self): |
---|
70 | return self._gm_orientablecurve.composite |
---|
71 | |
---|
72 | @composite.setter |
---|
73 | def composite(self, value): |
---|
74 | self._gm_orientablecurve.composite = value |
---|
75 | @property |
---|
76 | def orientation(self): |
---|
77 | return self._gm_orientablecurve.orientation |
---|
78 | |
---|
79 | @orientation.setter |
---|
80 | def orientation(self, value): |
---|
81 | self._gm_orientablecurve.orientation = value |
---|
82 | @property |
---|
83 | def containingPrimitive(self): |
---|
84 | return self._gm_orientablecurve.containingPrimitive |
---|
85 | |
---|
86 | @containingPrimitive.setter |
---|
87 | def containingPrimitive(self, value): |
---|
88 | self._gm_orientablecurve.containingPrimitive = value |
---|
89 | @property |
---|
90 | def element(self): |
---|
91 | return self._gm_composite.element |
---|
92 | |
---|
93 | @element.setter |
---|
94 | def element(self, value): |
---|
95 | self._gm_composite.element = value |
---|
96 | @property |
---|
97 | def generator(self): |
---|
98 | try: |
---|
99 | ret = [] |
---|
100 | ret.extend(self._generator_gm_compositecurve) |
---|
101 | ret.extend(self._generator_gm_curve) |
---|
102 | if not hasattr(self, '_generator'): |
---|
103 | self._generator = [] |
---|
104 | if self._generator is not None: |
---|
105 | ret.extend(self._generator) |
---|
106 | del self._generator[:] |
---|
107 | self._generator.extend(set(ret)) |
---|
108 | except Exception as e: |
---|
109 | pass |
---|
110 | return self._generator |
---|
111 | |
---|
112 | @property |
---|
113 | def topology(self): |
---|
114 | return self._gm_orientablecurve.topology |
---|
115 | |
---|
116 | @topology.setter |
---|
117 | def topology(self, value): |
---|
118 | self._gm_orientablecurve.topology = value |
---|
119 | @property |
---|
120 | def CRS(self): |
---|
121 | return self._gm_orientablecurve.CRS |
---|
122 | |
---|
123 | @CRS.setter |
---|
124 | def CRS(self, value): |
---|
125 | self._gm_orientablecurve.CRS = value |
---|
126 | @property |
---|
127 | def superComplex(self): |
---|
128 | return self._gm_composite.superComplex |
---|
129 | |
---|
130 | @superComplex.setter |
---|
131 | def superComplex(self, value): |
---|
132 | self._gm_composite.superComplex = value |
---|
133 | @property |
---|
134 | def proxy(self): |
---|
135 | return self._gm_orientablecurve.proxy |
---|
136 | |
---|
137 | @proxy.setter |
---|
138 | def proxy(self, value): |
---|
139 | self._gm_orientablecurve.proxy = value |
---|
140 | @property |
---|
141 | def subComplex(self): |
---|
142 | return self._gm_composite.subComplex |
---|
143 | |
---|
144 | @subComplex.setter |
---|
145 | def subComplex(self, value): |
---|
146 | self._gm_composite.subComplex = value |
---|
147 | @property |
---|
148 | def primitive(self): |
---|
149 | return self._gm_orientablecurve.primitive |
---|
150 | |
---|
151 | @primitive.setter |
---|
152 | def primitive(self, value): |
---|
153 | self._gm_orientablecurve.primitive = value |
---|
154 | @property |
---|
155 | def complex(self): |
---|
156 | return self._gm_orientablecurve.complex |
---|
157 | |
---|
158 | @complex.setter |
---|
159 | def complex(self, value): |
---|
160 | self._gm_orientablecurve.complex = value |
---|
161 | |
---|
162 | def synchronize(self): |
---|
163 | int_generator = self.generator |
---|
164 | del self._generator_gm_compositecurve[:] |
---|
165 | del self._generator_gm_curve[:] |
---|
166 | for item in int_generator: |
---|
167 | valueClass = "%s.%s" % (type(item).__module__,type(item).__name__) |
---|
168 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_compositecurve.GM_CompositeCurve": |
---|
169 | self._generator_gm_compositecurve.append(item) |
---|
170 | continue |
---|
171 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_curve.GM_Curve": |
---|
172 | self._generator_gm_curve.append(item) |
---|
173 | continue |
---|
174 | pass |
---|
175 | |
---|
176 | def __key(self): |
---|
177 | return (self.containedPrimitive, self.composite, self.composite, self.orientation, self.containingPrimitive, self.element, self.generator, self.topology, self.CRS, self.superComplex, self.proxy, self.subComplex, self.primitive, self.complex) |
---|
178 | |
---|
179 | def __eq__(self, y): |
---|
180 | if type(self) != type(y): |
---|
181 | return False |
---|
182 | ''' |
---|
183 | Cannot compare classes which do not define a "__key" attribute |
---|
184 | ''' |
---|
185 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
186 | return self.__key() == y.__key() |
---|
187 | return id(self) == id(y) |
---|
188 | |
---|
189 | def __hash__(self): |
---|
190 | return collectionProofHash(self.__key()) |
---|