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_orientablecurve import GM_OrientableCurve |
---|
22 | from ascore.utils import has_value, collectionProofHash |
---|
23 | |
---|
24 | ''' |
---|
25 | Created on 10-Jul-2012 14:15:03 |
---|
26 | |
---|
27 | @author: mnagni |
---|
28 | ''' |
---|
29 | |
---|
30 | class GM_Curve(GM_OrientableCurve): |
---|
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_orientablecurve = GM_OrientableCurve() |
---|
43 | |
---|
44 | self._segment_gm_offsetcurve = [] |
---|
45 | self._segment_gm_arcstringbybulge = [] |
---|
46 | self._segment_gm_geodesicstring = [] |
---|
47 | self._segment_nl_curvesegment = [] |
---|
48 | self._segment_gm_clothoid = [] |
---|
49 | self._segment_gm_conic = [] |
---|
50 | self._segment_gm_linestring = [] |
---|
51 | self._segment_gm_splinecurve = [] |
---|
52 | self._segment_arcbycenterpoint = [] |
---|
53 | self._segment_gm_arcstring = [] |
---|
54 | self._segment = [] |
---|
55 | self.CRS = None |
---|
56 | self.orientation = None |
---|
57 | self.proxy = None |
---|
58 | self.primitive = None |
---|
59 | super(GM_Curve, self).__init__() |
---|
60 | @property |
---|
61 | def topology(self): |
---|
62 | return self._gm_orientablecurve.topology |
---|
63 | |
---|
64 | @topology.setter |
---|
65 | def topology(self, value): |
---|
66 | self._gm_orientablecurve.topology = value |
---|
67 | @property |
---|
68 | def segment(self): |
---|
69 | try: |
---|
70 | ret = [] |
---|
71 | ret.extend(self._segment_gm_offsetcurve) |
---|
72 | ret.extend(self._segment_gm_arcstringbybulge) |
---|
73 | ret.extend(self._segment_gm_geodesicstring) |
---|
74 | ret.extend(self._segment_nl_curvesegment) |
---|
75 | ret.extend(self._segment_gm_clothoid) |
---|
76 | ret.extend(self._segment_gm_conic) |
---|
77 | ret.extend(self._segment_gm_linestring) |
---|
78 | ret.extend(self._segment_gm_splinecurve) |
---|
79 | ret.extend(self._segment_arcbycenterpoint) |
---|
80 | ret.extend(self._segment_gm_arcstring) |
---|
81 | if not hasattr(self, '_segment'): |
---|
82 | self._segment = [] |
---|
83 | if self._segment is not None: |
---|
84 | ret.extend(self._segment) |
---|
85 | del self._segment[:] |
---|
86 | self._segment.extend(set(ret)) |
---|
87 | except Exception as e: |
---|
88 | pass |
---|
89 | return self._segment |
---|
90 | |
---|
91 | @property |
---|
92 | def containedPrimitive(self): |
---|
93 | return self._gm_orientablecurve.containedPrimitive |
---|
94 | |
---|
95 | @containedPrimitive.setter |
---|
96 | def containedPrimitive(self, value): |
---|
97 | self._gm_orientablecurve.containedPrimitive = value |
---|
98 | @property |
---|
99 | def composite(self): |
---|
100 | return self._gm_orientablecurve.composite |
---|
101 | |
---|
102 | @composite.setter |
---|
103 | def composite(self, value): |
---|
104 | self._gm_orientablecurve.composite = value |
---|
105 | @property |
---|
106 | def composite(self): |
---|
107 | return self._gm_orientablecurve.composite |
---|
108 | |
---|
109 | @composite.setter |
---|
110 | def composite(self, value): |
---|
111 | self._gm_orientablecurve.composite = value |
---|
112 | @property |
---|
113 | def CRS(self): |
---|
114 | return self._gm_orientablecurve.CRS |
---|
115 | |
---|
116 | @CRS.setter |
---|
117 | def CRS(self, value): |
---|
118 | self._gm_orientablecurve.CRS = value |
---|
119 | @property |
---|
120 | def orientation(self): |
---|
121 | return self._gm_orientablecurve.orientation |
---|
122 | |
---|
123 | @orientation.setter |
---|
124 | def orientation(self, value): |
---|
125 | self._gm_orientablecurve.orientation = value |
---|
126 | @property |
---|
127 | def proxy(self): |
---|
128 | return self._gm_orientablecurve.proxy |
---|
129 | |
---|
130 | @proxy.setter |
---|
131 | def proxy(self, value): |
---|
132 | self._gm_orientablecurve.proxy = value |
---|
133 | @property |
---|
134 | def containingPrimitive(self): |
---|
135 | return self._gm_orientablecurve.containingPrimitive |
---|
136 | |
---|
137 | @containingPrimitive.setter |
---|
138 | def containingPrimitive(self, value): |
---|
139 | self._gm_orientablecurve.containingPrimitive = value |
---|
140 | @property |
---|
141 | def complex(self): |
---|
142 | return self._gm_orientablecurve.complex |
---|
143 | |
---|
144 | @complex.setter |
---|
145 | def complex(self, value): |
---|
146 | self._gm_orientablecurve.complex = 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 | |
---|
155 | def synchronize(self): |
---|
156 | int_segment = self.segment |
---|
157 | del self._segment_gm_offsetcurve[:] |
---|
158 | del self._segment_gm_arcstringbybulge[:] |
---|
159 | del self._segment_gm_geodesicstring[:] |
---|
160 | del self._segment_nl_curvesegment[:] |
---|
161 | del self._segment_gm_clothoid[:] |
---|
162 | del self._segment_gm_conic[:] |
---|
163 | del self._segment_gm_linestring[:] |
---|
164 | del self._segment_gm_splinecurve[:] |
---|
165 | del self._segment_arcbycenterpoint[:] |
---|
166 | del self._segment_gm_arcstring[:] |
---|
167 | for item in int_segment: |
---|
168 | valueClass = "%s.%s" % (type(item).__module__,type(item).__name__) |
---|
169 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_offsetcurve.GM_OffsetCurve": |
---|
170 | self._segment_gm_offsetcurve.append(item) |
---|
171 | continue |
---|
172 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstringbybulge.GM_ArcStringByBulge": |
---|
173 | self._segment_gm_arcstringbybulge.append(item) |
---|
174 | continue |
---|
175 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_geodesicstring.GM_GeodesicString": |
---|
176 | self._segment_gm_geodesicstring.append(item) |
---|
177 | continue |
---|
178 | if valueClass == "ea_model.informative.xamples.norwegian_land_information_spatial_schema.nl_curvesegment.NL_CurveSegment": |
---|
179 | self._segment_nl_curvesegment.append(item) |
---|
180 | continue |
---|
181 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_clothoid.GM_Clothoid": |
---|
182 | self._segment_gm_clothoid.append(item) |
---|
183 | continue |
---|
184 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_conic.GM_Conic": |
---|
185 | self._segment_gm_conic.append(item) |
---|
186 | continue |
---|
187 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_linestring.GM_LineString": |
---|
188 | self._segment_gm_linestring.append(item) |
---|
189 | continue |
---|
190 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_splinecurve.GM_SplineCurve": |
---|
191 | self._segment_gm_splinecurve.append(item) |
---|
192 | continue |
---|
193 | if valueClass == "ea_model.iso_19136_gml.geometryprimitives.arcbycenterpoint.ArcByCenterPoint": |
---|
194 | self._segment_arcbycenterpoint.append(item) |
---|
195 | continue |
---|
196 | if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstring.GM_ArcString": |
---|
197 | self._segment_gm_arcstring.append(item) |
---|
198 | continue |
---|
199 | pass |
---|
200 | |
---|
201 | def __key(self): |
---|
202 | return (self.topology, self.segment, self.containedPrimitive, self.composite, self.composite, self.CRS, self.orientation, self.proxy, self.containingPrimitive, self.complex, self.primitive) |
---|
203 | |
---|
204 | def __eq__(self, y): |
---|
205 | if type(self) != type(y): |
---|
206 | return False |
---|
207 | ''' |
---|
208 | Cannot compare classes which do not define a "__key" attribute |
---|
209 | ''' |
---|
210 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
211 | return self.__key() == y.__key() |
---|
212 | return id(self) == id(y) |
---|
213 | |
---|
214 | def __hash__(self): |
---|
215 | return collectionProofHash(self.__key()) |
---|