source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_directedtopo.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_directedtopo.py@8091
Revision 8091, 5.5 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.topology.topological_primitive.tp_primitive import  TP_Primitive
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:05
26
27@author: mnagni
28'''
29
30class TP_DirectedTopo(TP_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._tp_primitive = TP_Primitive()     
43
44        self._isolated_tp_directedtopo = []
45        self._isolated_tp_edge = []
46        self._isolated_tp_node = []
47        self._isolated_tp_solid = []
48        self._isolated_tp_face = []
49        self._topo_tp_directedtopo = None
50        self._topo_tp_edge = None
51        self._topo_tp_node = None
52        self._topo_tp_solid = None
53        self._topo_tp_face = None
54        self.maximalComplex = None
55        self.orientation = None
56        self._proxy_tp_directedface = None
57        self._proxy_tp_directednode = None
58        self._proxy_tp_directedsolid = None
59        self._proxy_tp_directededge = None
60        self._geometry_gm_orientableprimitive = None
61        self._geometry_gm_point = None
62        self._geometry_gm_solid = None
63        self.complex = []
64        self._container_tp_directedtopo = None
65        self._container_tp_edge = None
66        self._container_tp_node = None
67        self._container_tp_solid = None
68        self._container_tp_face = None
69        self.term = []
70        super(TP_DirectedTopo, self).__init__()
71
72    @property
73    def isolated(self): 
74        return self._tp_primitive.isolated
75
76    @isolated.setter
77    def isolated(self, value): 
78            self._tp_primitive.isolated = value
79
80    @property
81    def topo(self):     
82        if(has_value(self._topo_tp_directedtopo)):
83            return self._topo_tp_directedtopo
84        if(has_value(self._topo_tp_edge)):
85            return self._topo_tp_edge
86        if(has_value(self._topo_tp_node)):
87            return self._topo_tp_node
88        if(has_value(self._topo_tp_solid)):
89            return self._topo_tp_solid
90        if(has_value(self._topo_tp_face)):
91            return self._topo_tp_face
92        return  None
93
94    @topo.setter
95    def topo(self, value):     
96        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
97        if valueClass == "ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_directedtopo.TP_DirectedTopo":
98            self._topo_tp_directedtopo = value
99            self._topo_tp_edge = None
100            self._topo_tp_node = None
101            self._topo_tp_solid = None
102            self._topo_tp_face = None
103        if valueClass == "ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_edge.TP_Edge":
104            self._topo_tp_edge = value
105            self._topo_tp_directedtopo = None
106            self._topo_tp_node = None
107            self._topo_tp_solid = None
108            self._topo_tp_face = None
109        if valueClass == "ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_node.TP_Node":
110            self._topo_tp_node = value
111            self._topo_tp_directedtopo = None
112            self._topo_tp_edge = None
113            self._topo_tp_solid = None
114            self._topo_tp_face = None
115        if valueClass == "ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_solid.TP_Solid":
116            self._topo_tp_solid = value
117            self._topo_tp_directedtopo = None
118            self._topo_tp_edge = None
119            self._topo_tp_node = None
120            self._topo_tp_face = None
121        if valueClass == "ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_face.TP_Face":
122            self._topo_tp_face = value
123            self._topo_tp_directedtopo = None
124            self._topo_tp_edge = None
125            self._topo_tp_node = None
126            self._topo_tp_solid = None
127
128    @property
129    def maximalComplex(self):   
130        return self._tp_primitive.maximalComplex
131
132    @maximalComplex.setter
133    def maximalComplex(self, value):   
134            self._tp_primitive.maximalComplex = value
135
136    @property
137    def proxy(self):   
138        return self._tp_primitive.proxy
139
140    @proxy.setter
141    def proxy(self, value):     
142            self._tp_primitive.proxy = value
143
144    @property
145    def geometry(self): 
146        return self._tp_primitive.geometry
147
148    @geometry.setter
149    def geometry(self, value): 
150            self._tp_primitive.geometry = value
151
152    @property
153    def complex(self): 
154        return self._tp_primitive.complex
155
156    @complex.setter
157    def complex(self, value):   
158            self._tp_primitive.complex = value
159
160    @property
161    def container(self):       
162        return self._tp_primitive.container
163
164    @container.setter
165    def container(self, value): 
166            self._tp_primitive.container = value
167
168    def __key(self):
169        return (self.isolated, self.topo, self.maximalComplex, self.orientation, self.proxy, self.geometry, self.complex, self.container, self.term)
170
171    def __eq__(self, y):
172        '''
173        Cannot compare classes which do not define a "__key" attribute
174        '''
175        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
176            return self.__key() == y.__key()
177        return id(self) == id(y)
178
179    def __hash__(self):
180        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.