source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/geometry/geometric_primitive/gm_orientableprimitive.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_orientableprimitive.py@8091
Revision 8091, 5.0 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_primitive import  GM_Primitive
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:03
26
27@author: mnagni
28'''
29
30class GM_OrientablePrimitive(GM_Primitive):
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_primitive = GM_Primitive()     
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._containedPrimitive_gm_orientableprimitive = []
50        self._containedPrimitive_gm_point = []
51        self._containedPrimitive_gm_solid = []
52        self._composite_gm_compositecurve = []
53        self._composite_gm_compositesolid = []
54        self._composite_gm_compositesurface = []
55        self._composite_gm_compositepoint = []
56        self._CRS_sc_singlecrs = None
57        self._CRS_sc_compoundcrs = None
58        self.orientation = None
59        self._proxy_gm_orientablesurface = None
60        self._proxy_gm_orientablecurve = None
61        self._containingPrimitive_gm_orientableprimitive = []
62        self._containingPrimitive_gm_point = []
63        self._containingPrimitive_gm_solid = []
64        self.complex = []
65        self._primitive_gm_orientableprimitive = None
66        self._primitive_gm_point = None
67        self._primitive_gm_solid = None
68        super(GM_OrientablePrimitive, self).__init__()
69
70    @property
71    def topology(self): 
72        return self._gm_primitive.topology
73
74    @topology.setter
75    def topology(self, value): 
76            self._gm_primitive.topology = value
77
78    @property
79    def containedPrimitive(self):       
80        return self._gm_primitive.containedPrimitive
81
82    @containedPrimitive.setter
83    def containedPrimitive(self, value):       
84            self._gm_primitive.containedPrimitive = value
85
86    @property
87    def composite(self):       
88        return self._gm_primitive.composite
89
90    @composite.setter
91    def composite(self, value): 
92            self._gm_primitive.composite = value
93
94    @property
95    def CRS(self):     
96        return self._gm_primitive.CRS
97
98    @CRS.setter
99    def CRS(self, value):       
100            self._gm_primitive.CRS = value
101
102    @property
103    def proxy(self):   
104        return self._gm_primitive.proxy
105
106    @proxy.setter
107    def proxy(self, value):     
108            self._gm_primitive.proxy = value
109
110    @property
111    def containingPrimitive(self):     
112        return self._gm_primitive.containingPrimitive
113
114    @containingPrimitive.setter
115    def containingPrimitive(self, value):       
116            self._gm_primitive.containingPrimitive = value
117
118    @property
119    def complex(self): 
120        return self._gm_primitive.complex
121
122    @complex.setter
123    def complex(self, value):   
124            self._gm_primitive.complex = value
125
126    @property
127    def primitive(self):       
128        if(has_value(self._primitive_gm_orientableprimitive)):
129            return self._primitive_gm_orientableprimitive
130        if(has_value(self._primitive_gm_point)):
131            return self._primitive_gm_point
132        if(has_value(self._primitive_gm_solid)):
133            return self._primitive_gm_solid
134        return  None
135
136    @primitive.setter
137    def primitive(self, value): 
138        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
139        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_orientableprimitive.GM_OrientablePrimitive":
140            self._primitive_gm_orientableprimitive = value
141            self._primitive_gm_point = None
142            self._primitive_gm_solid = None
143        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_point.GM_Point":
144            self._primitive_gm_point = value
145            self._primitive_gm_orientableprimitive = None
146            self._primitive_gm_solid = None
147        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_solid.GM_Solid":
148            self._primitive_gm_solid = value
149            self._primitive_gm_orientableprimitive = None
150            self._primitive_gm_point = None
151
152    def __key(self):
153        return (self.topology, self.containedPrimitive, self.composite, self.CRS, self.orientation, self.proxy, self.containingPrimitive, self.complex, self.primitive)
154
155    def __eq__(self, y):
156        '''
157        Cannot compare classes which do not define a "__key" attribute
158        '''
159        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
160            return self.__key() == y.__key()
161        return id(self) == id(y)
162
163    def __hash__(self):
164        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.