source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/informative/spatial_examples_from_iso_19107/application_schema/topology_simple/cellular_topology/cell.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/informative/spatial_examples_from_iso_19107/application_schema/topology_simple/cellular_topology/cell.py@8457
Revision 8457, 3.4 KB checked in by mnagni, 7 years ago (diff)

Corrected an error in the generation of the classes "synchronize" method.

  • Property svn:mime-type set to text/plain
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 ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_primitive import  TP_Primitive
23from ascore.utils import has_value, collectionProofHash
24
25'''
26Created on 10-Jul-2012 14:15:14
27
28@author: mnagni
29'''
30
31class Cell(TP_Primitive,GM_Primitive):
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_primitive = GM_Primitive()     
44                self._tp_primitive = TP_Primitive()     
45
46                self.maximalComplex = None
47                self.dimension = None
48                self.CRS = None
49                self.proxy = None
50                self.geometry = None
51                self.complex = []
52                self.container = None
53                super(Cell, self).__init__()
54        @property
55        def containedPrimitive(self):   
56                return self._gm_primitive.containedPrimitive
57
58        @containedPrimitive.setter
59        def containedPrimitive(self, value):   
60                        self._gm_primitive.containedPrimitive = value
61        @property
62        def composite(self):   
63                return self._gm_primitive.composite
64
65        @composite.setter
66        def composite(self, value):     
67                        self._gm_primitive.composite = value
68        @property
69        def maximalComplex(self):       
70                return self._tp_primitive.maximalComplex
71
72        @maximalComplex.setter
73        def maximalComplex(self, value):       
74                        self._tp_primitive.maximalComplex = value
75        @property
76        def containingPrimitive(self): 
77                return self._gm_primitive.containingPrimitive
78
79        @containingPrimitive.setter
80        def containingPrimitive(self, value):   
81                        self._gm_primitive.containingPrimitive = value
82        @property
83        def topology(self):     
84                return self._gm_primitive.topology
85
86        @topology.setter
87        def topology(self, value):     
88                        self._gm_primitive.topology = value
89        @property
90        def isolated(self):     
91                return self._tp_primitive.isolated
92
93        @isolated.setter
94        def isolated(self, value):     
95                        self._tp_primitive.isolated = value
96        @property
97        def CRS(self): 
98                return self._gm_primitive.CRS
99
100        @CRS.setter
101        def CRS(self, value):   
102                        self._gm_primitive.CRS = value
103        @property
104        def proxy(self):       
105                return self._gm_primitive.proxy
106
107        @proxy.setter
108        def proxy(self, value):
109                        self._gm_primitive.proxy = value
110        @property
111        def geometry(self):     
112                return self._tp_primitive.geometry
113
114        @geometry.setter
115        def geometry(self, value):     
116                        self._tp_primitive.geometry = value
117        @property
118        def complex(self):     
119                return self._gm_primitive.complex
120
121        @complex.setter
122        def complex(self, value):       
123                        self._gm_primitive.complex = value
124        @property
125        def container(self):   
126                return self._tp_primitive.container
127
128        @container.setter
129        def container(self, value):     
130                        self._tp_primitive.container = value
131
132        def synchronize(self):
133                pass
134
135        def __key(self):
136                return (self.containedPrimitive, self.composite, self.maximalComplex, self.dimension, self.containingPrimitive, self.topology, self.isolated, self.CRS, self.proxy, self.geometry, self.complex, self.complex, self.container)
137
138        def __eq__(self, y):
139                if type(self) != type(y):
140                        return False
141                '''
142                Cannot compare classes which do not define a "__key" attribute
143                '''
144                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
145                        return self.__key() == y.__key()
146                return id(self) == id(y)
147
148        def __hash__(self):
149                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.