source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/geometry/coordinate_geometry/gm_offsetcurve.py @ 8089

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

Played with DOJO
New EA library
Addede CEDA_Process to the migration

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_curvesegment import  GM_CurveSegment
22from ascore.utils import has_value
23
24'''
25Created on 14-Feb-2012 17:19:28
26
27@author: mnagni
28'''
29
30class GM_OffsetCurve(GM_CurveSegment):
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_curvesegment = GM_CurveSegment()       
43
44        self._baseCurve_gm_arcstringbybulge = None
45        self._baseCurve_gm_linestring = None
46        self._baseCurve_gm_arcstring = None
47        self._baseCurve_gm_clothoid = None
48        self._baseCurve_gm_conic = None
49        self._baseCurve_gm_geodesicstring = None
50        self._baseCurve_gm_offsetcurve = None
51        self._baseCurve_gm_splinecurve = None
52        self.refDirection = None
53        self.numDerivativesAtEnd = None
54        self.curve = None
55        self.distance = None
56        self.interpolation = None
57        self.numDerivativesAtStart = None
58        self.numDerivativeInterior = None
59        super(GM_OffsetCurve, self).__init__()
60
61    @property
62    def baseCurve(self):       
63        if(has_value(self._baseCurve_gm_arcstringbybulge)):
64            return self._baseCurve_gm_arcstringbybulge
65        if(has_value(self._baseCurve_gm_linestring)):
66            return self._baseCurve_gm_linestring
67        if(has_value(self._baseCurve_gm_arcstring)):
68            return self._baseCurve_gm_arcstring
69        if(has_value(self._baseCurve_gm_clothoid)):
70            return self._baseCurve_gm_clothoid
71        if(has_value(self._baseCurve_gm_conic)):
72            return self._baseCurve_gm_conic
73        if(has_value(self._baseCurve_gm_geodesicstring)):
74            return self._baseCurve_gm_geodesicstring
75        if(has_value(self._baseCurve_gm_offsetcurve)):
76            return self._baseCurve_gm_offsetcurve
77        if(has_value(self._baseCurve_gm_splinecurve)):
78            return self._baseCurve_gm_splinecurve
79        return  None
80
81    @baseCurve.setter
82    def baseCurve(self, value): 
83        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
84        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstringbybulge.GM_ArcStringByBulge":
85            self._baseCurve_gm_arcstringbybulge = value
86            self._baseCurve_gm_linestring = None
87            self._baseCurve_gm_arcstring = None
88            self._baseCurve_gm_clothoid = None
89            self._baseCurve_gm_conic = None
90            self._baseCurve_gm_geodesicstring = None
91            self._baseCurve_gm_offsetcurve = None
92            self._baseCurve_gm_splinecurve = None
93        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_linestring.GM_LineString":
94            self._baseCurve_gm_linestring = value
95            self._baseCurve_gm_arcstringbybulge = None
96            self._baseCurve_gm_arcstring = None
97            self._baseCurve_gm_clothoid = None
98            self._baseCurve_gm_conic = None
99            self._baseCurve_gm_geodesicstring = None
100            self._baseCurve_gm_offsetcurve = None
101            self._baseCurve_gm_splinecurve = None
102        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_arcstring.GM_ArcString":
103            self._baseCurve_gm_arcstring = value
104            self._baseCurve_gm_arcstringbybulge = None
105            self._baseCurve_gm_linestring = None
106            self._baseCurve_gm_clothoid = None
107            self._baseCurve_gm_conic = None
108            self._baseCurve_gm_geodesicstring = None
109            self._baseCurve_gm_offsetcurve = None
110            self._baseCurve_gm_splinecurve = None
111        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_clothoid.GM_Clothoid":
112            self._baseCurve_gm_clothoid = value
113            self._baseCurve_gm_arcstringbybulge = None
114            self._baseCurve_gm_linestring = None
115            self._baseCurve_gm_arcstring = None
116            self._baseCurve_gm_conic = None
117            self._baseCurve_gm_geodesicstring = None
118            self._baseCurve_gm_offsetcurve = None
119            self._baseCurve_gm_splinecurve = None
120        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_conic.GM_Conic":
121            self._baseCurve_gm_conic = value
122            self._baseCurve_gm_arcstringbybulge = None
123            self._baseCurve_gm_linestring = None
124            self._baseCurve_gm_arcstring = None
125            self._baseCurve_gm_clothoid = None
126            self._baseCurve_gm_geodesicstring = None
127            self._baseCurve_gm_offsetcurve = None
128            self._baseCurve_gm_splinecurve = None
129        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_geodesicstring.GM_GeodesicString":
130            self._baseCurve_gm_geodesicstring = value
131            self._baseCurve_gm_arcstringbybulge = None
132            self._baseCurve_gm_linestring = None
133            self._baseCurve_gm_arcstring = None
134            self._baseCurve_gm_clothoid = None
135            self._baseCurve_gm_conic = None
136            self._baseCurve_gm_offsetcurve = None
137            self._baseCurve_gm_splinecurve = None
138        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_offsetcurve.GM_OffsetCurve":
139            self._baseCurve_gm_offsetcurve = value
140            self._baseCurve_gm_arcstringbybulge = None
141            self._baseCurve_gm_linestring = None
142            self._baseCurve_gm_arcstring = None
143            self._baseCurve_gm_clothoid = None
144            self._baseCurve_gm_conic = None
145            self._baseCurve_gm_geodesicstring = None
146            self._baseCurve_gm_splinecurve = None
147        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_splinecurve.GM_SplineCurve":
148            self._baseCurve_gm_splinecurve = value
149            self._baseCurve_gm_arcstringbybulge = None
150            self._baseCurve_gm_linestring = None
151            self._baseCurve_gm_arcstring = None
152            self._baseCurve_gm_clothoid = None
153            self._baseCurve_gm_conic = None
154            self._baseCurve_gm_geodesicstring = None
155            self._baseCurve_gm_offsetcurve = None
156
157    @property
158    def numDerivativesAtEnd(self):     
159        return self._gm_curvesegment.numDerivativesAtEnd
160
161    @numDerivativesAtEnd.setter
162    def numDerivativesAtEnd(self, value):       
163            self._gm_curvesegment.numDerivativesAtEnd = value
164
165    @property
166    def curve(self):   
167        return self._gm_curvesegment.curve
168
169    @curve.setter
170    def curve(self, value):     
171            self._gm_curvesegment.curve = value
172
173    @property
174    def interpolation(self):   
175        return self._gm_curvesegment.interpolation
176
177    @interpolation.setter
178    def interpolation(self, value):     
179            self._gm_curvesegment.interpolation = value
180
181    @property
182    def numDerivativesAtStart(self):   
183        return self._gm_curvesegment.numDerivativesAtStart
184
185    @numDerivativesAtStart.setter
186    def numDerivativesAtStart(self, value):     
187            self._gm_curvesegment.numDerivativesAtStart = value
188
189    @property
190    def numDerivativeInterior(self):   
191        return self._gm_curvesegment.numDerivativeInterior
192
193    @numDerivativeInterior.setter
194    def numDerivativeInterior(self, value):     
195            self._gm_curvesegment.numDerivativeInterior = value
196
197    def __key(self):
198        return (self.baseCurve, self.refDirection, self.numDerivativesAtEnd, self.curve, self.distance, self.interpolation, self.numDerivativesAtStart, self.numDerivativeInterior)
199
200    def __eq__(self, y):
201        '''
202        Cannot compare classes which do not define a "__key" attribute
203        '''
204        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
205            return self.__key() == y.__key()
206        return id(self) == id(y)
207
208    def __hash__(self):
209        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.