source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/geometry/geometric_primitive/gm_curve.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/geometry/geometric_primitive/gm_curve.py@8091
Revision 8091, 7.7 KB checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_orientablecurve import  GM_OrientableCurve
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:07
26
27@author: mnagni
28'''
29
30class 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._topology_tp_directedtopo = []
45        self._topology_tp_edge = []
46        self._topology_tp_node = []
47        self._topology_tp_solid = []
48        self._topology_tp_face = []
49        self._segment_gm_splinecurve = []
50        self._segment_gm_offsetcurve = []
51        self._segment_gm_arcstring = []
52        self._segment_gm_conic = []
53        self._segment_gm_geodesicstring = []
54        self._segment_gm_linestring = []
55        self._segment_gm_arcstringbybulge = []
56        self._segment_gm_clothoid = []
57        self._containedPrimitive_gm_orientableprimitive = []
58        self._containedPrimitive_gm_point = []
59        self._containedPrimitive_gm_solid = []
60        self._composite_gm_compositecurve = []
61        self._composite_gm_compositesolid = []
62        self._composite_gm_compositesurface = []
63        self._composite_gm_compositepoint = []
64        self.composite = []
65        self._CRS_sc_singlecrs = None
66        self._CRS_sc_compoundcrs = None
67        self.orientation = None
68        self._proxy_gm_orientablesurface = None
69        self._proxy_gm_orientablecurve = None
70        self._containingPrimitive_gm_orientableprimitive = []
71        self._containingPrimitive_gm_point = []
72        self._containingPrimitive_gm_solid = []
73        self.complex = []
74        self._primitive_gm_orientableprimitive = None
75        self._primitive_gm_point = None
76        self._primitive_gm_solid = None
77        super(GM_Curve, self).__init__()
78
79    @property
80    def topology(self): 
81        return self._gm_orientablecurve.topology
82
83    @topology.setter
84    def topology(self, value): 
85            self._gm_orientablecurve.topology = value
86
87    @property
88    def segment(self): 
89        ret = []
90        for item in self._segment_gm_splinecurve:
91            ret.append(item)
92        for item in self._segment_gm_offsetcurve:
93            ret.append(item)
94        for item in self._segment_gm_arcstring:
95            ret.append(item)
96        for item in self._segment_gm_conic:
97            ret.append(item)
98        for item in self._segment_gm_geodesicstring:
99            ret.append(item)
100        for item in self._segment_gm_linestring:
101            ret.append(item)
102        for item in self._segment_gm_arcstringbybulge:
103            ret.append(item)
104        for item in self._segment_gm_clothoid:
105            ret.append(item)
106        return ret
107
108    @segment.setter
109    def segment(self, value):   
110        if isinstance(value, list):
111            self._segment_gm_splinecurve[:]
112            self._segment_gm_offsetcurve[:]
113            self._segment_gm_arcstring[:]
114            self._segment_gm_conic[:]
115            self._segment_gm_geodesicstring[:]
116            self._segment_gm_linestring[:]
117            self._segment_gm_arcstringbybulge[:]
118            self._segment_gm_clothoid[:]
119            for item in value:
120                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
121                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_splinecurve.GM_SplineCurve":
122                    self._segment_gm_splinecurve.append(item)
123                    continue
124                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_offsetcurve.GM_OffsetCurve":
125                    self._segment_gm_offsetcurve.append(item)
126                    continue
127                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstring.GM_ArcString":
128                    self._segment_gm_arcstring.append(item)
129                    continue
130                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_conic.GM_Conic":
131                    self._segment_gm_conic.append(item)
132                    continue
133                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_geodesicstring.GM_GeodesicString":
134                    self._segment_gm_geodesicstring.append(item)
135                    continue
136                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_linestring.GM_LineString":
137                    self._segment_gm_linestring.append(item)
138                    continue
139                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstringbybulge.GM_ArcStringByBulge":
140                    self._segment_gm_arcstringbybulge.append(item)
141                    continue
142                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_clothoid.GM_Clothoid":
143                    self._segment_gm_clothoid.append(item)
144                    continue
145
146    @property
147    def containedPrimitive(self):       
148        return self._gm_orientablecurve.containedPrimitive
149
150    @containedPrimitive.setter
151    def containedPrimitive(self, value):       
152            self._gm_orientablecurve.containedPrimitive = value
153
154    @property
155    def composite(self):       
156        return self._gm_orientablecurve.composite
157
158    @composite.setter
159    def composite(self, value): 
160            self._gm_orientablecurve.composite = value
161
162    @property
163    def composite(self):       
164        return self._gm_orientablecurve.composite
165
166    @composite.setter
167    def composite(self, value): 
168            self._gm_orientablecurve.composite = value
169
170    @property
171    def CRS(self):     
172        return self._gm_orientablecurve.CRS
173
174    @CRS.setter
175    def CRS(self, value):       
176            self._gm_orientablecurve.CRS = value
177
178    @property
179    def orientation(self):     
180        return self._gm_orientablecurve.orientation
181
182    @orientation.setter
183    def orientation(self, value):       
184            self._gm_orientablecurve.orientation = value
185
186    @property
187    def proxy(self):   
188        return self._gm_orientablecurve.proxy
189
190    @proxy.setter
191    def proxy(self, value):     
192            self._gm_orientablecurve.proxy = value
193
194    @property
195    def containingPrimitive(self):     
196        return self._gm_orientablecurve.containingPrimitive
197
198    @containingPrimitive.setter
199    def containingPrimitive(self, value):       
200            self._gm_orientablecurve.containingPrimitive = value
201
202    @property
203    def complex(self): 
204        return self._gm_orientablecurve.complex
205
206    @complex.setter
207    def complex(self, value):   
208            self._gm_orientablecurve.complex = value
209
210    @property
211    def primitive(self):       
212        return self._gm_orientablecurve.primitive
213
214    @primitive.setter
215    def primitive(self, value): 
216            self._gm_orientablecurve.primitive = value
217
218    def __key(self):
219        return (self.topology, self.segment, self.containedPrimitive, self.composite, self.composite, self.CRS, self.orientation, self.proxy, self.containingPrimitive, self.complex, self.primitive)
220
221    def __eq__(self, y):
222        '''
223        Cannot compare classes which do not define a "__key" attribute
224        '''
225        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
226            return self.__key() == y.__key()
227        return id(self) == id(y)
228
229    def __hash__(self):
230        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.