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_orientablesurface import GM_OrientableSurface |
---|
22 | from ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_composite import GM_Composite |
---|
23 | from ascore.utils import has_value, collectionProofHash |
---|
24 | |
---|
25 | ''' |
---|
26 | Created on 10-Jul-2012 14:15:08 |
---|
27 | |
---|
28 | @author: mnagni |
---|
29 | ''' |
---|
30 | |
---|
31 | class GM_CompositeSurface(GM_OrientableSurface,GM_Composite): |
---|
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_composite = GM_Composite() |
---|
44 | self._gm_orientablesurface = GM_OrientableSurface() |
---|
45 | |
---|
46 | self.orientation = None |
---|
47 | self._generator_gm_compositesurface = [] |
---|
48 | self._generator_gm_surface = [] |
---|
49 | self._generator = [] |
---|
50 | self.topology = None |
---|
51 | self.CRS = None |
---|
52 | self.proxy = None |
---|
53 | self.primitive = None |
---|
54 | super(GM_CompositeSurface, self).__init__() |
---|
55 | @property |
---|
56 | def containedPrimitive(self): |
---|
57 | return self._gm_orientablesurface.containedPrimitive |
---|
58 | |
---|
59 | @containedPrimitive.setter |
---|
60 | def containedPrimitive(self, value): |
---|
61 | self._gm_orientablesurface.containedPrimitive = value |
---|
62 | @property |
---|
63 | def composite(self): |
---|
64 | return self._gm_orientablesurface.composite |
---|
65 | |
---|
66 | @composite.setter |
---|
67 | def composite(self, value): |
---|
68 | self._gm_orientablesurface.composite = value |
---|
69 | @property |
---|
70 | def composite(self): |
---|
71 | return self._gm_orientablesurface.composite |
---|
72 | |
---|
73 | @composite.setter |
---|
74 | def composite(self, value): |
---|
75 | self._gm_orientablesurface.composite = value |
---|
76 | @property |
---|
77 | def orientation(self): |
---|
78 | return self._gm_orientablesurface.orientation |
---|
79 | |
---|
80 | @orientation.setter |
---|
81 | def orientation(self, value): |
---|
82 | self._gm_orientablesurface.orientation = value |
---|
83 | @property |
---|
84 | def containingPrimitive(self): |
---|
85 | return self._gm_orientablesurface.containingPrimitive |
---|
86 | |
---|
87 | @containingPrimitive.setter |
---|
88 | def containingPrimitive(self, value): |
---|
89 | self._gm_orientablesurface.containingPrimitive = value |
---|
90 | @property |
---|
91 | def element(self): |
---|
92 | return self._gm_composite.element |
---|
93 | |
---|
94 | @element.setter |
---|
95 | def element(self, value): |
---|
96 | self._gm_composite.element = value |
---|
97 | @property |
---|
98 | def generator(self): |
---|
99 | try: |
---|
100 | ret = [] |
---|
101 | ret.extend(self._generator_gm_compositesurface) |
---|
102 | ret.extend(self._generator_gm_surface) |
---|
103 | if not hasattr(self, '_generator'): |
---|
104 | self._generator = [] |
---|
105 | if self._generator is not None: |
---|
106 | ret.extend(self._generator) |
---|
107 | del self._generator[:] |
---|
108 | self._generator.extend(set(ret)) |
---|
109 | except Exception as e: |
---|
110 | pass |
---|
111 | return self._generator |
---|
112 | |
---|
113 | @property |
---|
114 | def topology(self): |
---|
115 | return self._gm_composite.topology |
---|
116 | |
---|
117 | @topology.setter |
---|
118 | def topology(self, value): |
---|
119 | self._gm_composite.topology = value |
---|
120 | @property |
---|
121 | def CRS(self): |
---|
122 | return self._gm_composite.CRS |
---|
123 | |
---|
124 | @CRS.setter |
---|
125 | def CRS(self, value): |
---|
126 | self._gm_composite.CRS = value |
---|
127 | @property |
---|
128 | def proxy(self): |
---|
129 | return self._gm_orientablesurface.proxy |
---|
130 | |
---|
131 | @proxy.setter |
---|
132 | def proxy(self, value): |
---|
133 | self._gm_orientablesurface.proxy = value |
---|
134 | @property |
---|
135 | def subComplex(self): |
---|
136 | return self._gm_composite.subComplex |
---|
137 | |
---|
138 | @subComplex.setter |
---|
139 | def subComplex(self, value): |
---|
140 | self._gm_composite.subComplex = value |
---|
141 | @property |
---|
142 | def superComplex(self): |
---|
143 | return self._gm_composite.superComplex |
---|
144 | |
---|
145 | @superComplex.setter |
---|
146 | def superComplex(self, value): |
---|
147 | self._gm_composite.superComplex = value |
---|
148 | @property |
---|
149 | def primitive(self): |
---|
150 | return self._gm_orientablesurface.primitive |
---|
151 | |
---|
152 | @primitive.setter |
---|
153 | def primitive(self, value): |
---|
154 | self._gm_orientablesurface.primitive = value |
---|
155 | @property |
---|
156 | def complex(self): |
---|
157 | return self._gm_orientablesurface.complex |
---|
158 | |
---|
159 | @complex.setter |
---|
160 | def complex(self, value): |
---|
161 | self._gm_orientablesurface.complex = value |
---|
162 | |
---|
163 | def synchronize(self): |
---|
164 | int_generator = self.generator |
---|
165 | del self._generator_gm_compositesurface[:] |
---|
166 | del self._generator_gm_surface[:] |
---|
167 | for item in int_generator: |
---|
168 | valueClass = "%s.%s" % (type(item).__module__,type(item).__name__) |
---|
169 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_compositesurface.GM_CompositeSurface": |
---|
170 | self._generator_gm_compositesurface.append(item) |
---|
171 | continue |
---|
172 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_surface.GM_Surface": |
---|
173 | self._generator_gm_surface.append(item) |
---|
174 | continue |
---|
175 | pass |
---|
176 | |
---|
177 | def __key(self): |
---|
178 | return (self.containedPrimitive, self.composite, self.composite, self.orientation, self.containingPrimitive, self.element, self.generator, self.topology, self.CRS, self.proxy, self.subComplex, self.superComplex, self.primitive, self.complex) |
---|
179 | |
---|
180 | def __eq__(self, y): |
---|
181 | if type(self) != type(y): |
---|
182 | return False |
---|
183 | ''' |
---|
184 | Cannot compare classes which do not define a "__key" attribute |
---|
185 | ''' |
---|
186 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
187 | return self.__key() == y.__key() |
---|
188 | return id(self) == id(y) |
---|
189 | |
---|
190 | def __hash__(self): |
---|
191 | return collectionProofHash(self.__key()) |
---|