source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19123_2005_coverages/coverages/thiessen_polygon/cv_thiessenpolygoncoverage.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19123_2005_coverages/coverages/thiessen_polygon/cv_thiessenpolygoncoverage.py@8457
Revision 8457, 3.9 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_19123_2005_coverages.coverages.coverage_core.cv_continuouscoverage import  CV_ContinuousCoverage
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:06
26
27@author: mnagni
28'''
29
30class CV_ThiessenPolygonCoverage(CV_ContinuousCoverage):
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._cv_continuouscoverage = CV_ContinuousCoverage()   
43
44                self._clipArea_polygon = None
45                self._clipArea_gm_polyhedralsurface = None
46                self._clipArea = None
47                self.discreteThiessen = None
48                self.interpolationType = None
49                self.CRS = None
50                self.commonPointRule = None
51                self.rangeType = None
52                self.element = []
53                self.interpolationParametersType = None
54                super(CV_ThiessenPolygonCoverage, self).__init__()
55        @property
56        def clipArea(self):     
57                if(has_value(self._clipArea_polygon)):
58                        return self._clipArea_polygon
59                if(has_value(self._clipArea_gm_polyhedralsurface)):
60                        return self._clipArea_gm_polyhedralsurface
61                return  None
62
63        @clipArea.setter
64        def clipArea(self, value):     
65                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
66                if valueClass == "ea_model.iso_19136_gml.geometry2d.polygon.Polygon":
67                        self._clipArea_polygon = value
68                        self._clipArea_gm_polyhedralsurface = None
69                if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_polyhedralsurface.GM_PolyhedralSurface":
70                        self._clipArea_gm_polyhedralsurface = value
71                        self._clipArea_polygon = None
72        @property
73        def domainExtent(self):
74                return self._cv_continuouscoverage.domainExtent
75
76        @domainExtent.setter
77        def domainExtent(self, value): 
78                        self._cv_continuouscoverage.domainExtent = value
79        @property
80        def CRS(self): 
81                return self._cv_continuouscoverage.CRS
82
83        @CRS.setter
84        def CRS(self, value):   
85                        self._cv_continuouscoverage.CRS = value
86        @property
87        def domainElement(self):       
88                return self._cv_continuouscoverage.domainElement
89
90        @domainElement.setter
91        def domainElement(self, value):
92                        self._cv_continuouscoverage.domainElement = value
93        @property
94        def commonPointRule(self):     
95                return self._cv_continuouscoverage.commonPointRule
96
97        @commonPointRule.setter
98        def commonPointRule(self, value):       
99                        self._cv_continuouscoverage.commonPointRule = value
100        @property
101        def rangeType(self):   
102                return self._cv_continuouscoverage.rangeType
103
104        @rangeType.setter
105        def rangeType(self, value):     
106                        self._cv_continuouscoverage.rangeType = value
107        @property
108        def element(self):     
109                return self._cv_continuouscoverage.element
110
111        @element.setter
112        def element(self, value):       
113                        self._cv_continuouscoverage.element = value
114        @property
115        def rangeElement(self):
116                return self._cv_continuouscoverage.rangeElement
117
118        @rangeElement.setter
119        def rangeElement(self, value): 
120                        self._cv_continuouscoverage.rangeElement = value
121        @property
122        def interpolationParametersType(self): 
123                return self._cv_continuouscoverage.interpolationParametersType
124
125        @interpolationParametersType.setter
126        def interpolationParametersType(self, value):   
127                        self._cv_continuouscoverage.interpolationParametersType = value
128
129        def synchronize(self):
130                pass
131
132        def __key(self):
133                return (self.clipArea, self.discreteThiessen, self.domainExtent, self.interpolationType, self.CRS, self.domainElement, self.commonPointRule, self.rangeType, self.element, self.element, self.rangeElement, self.interpolationParametersType)
134
135        def __eq__(self, y):
136                if type(self) != type(y):
137                        return False
138                '''
139                Cannot compare classes which do not define a "__key" attribute
140                '''
141                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
142                        return self.__key() == y.__key()
143                return id(self) == id(y)
144
145        def __hash__(self):
146                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.