source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/geometry/coordinate_geometry/gm_conic.py @ 8086

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_conic.py@8086
Revision 8086, 2.8 KB checked in by mnagni, 8 years ago (diff)

Fixed the multiple CI_Party INSERT in the DB
Refactored the ingestion thanks to the new eq method in the imported classes DB library

RevLine 
[8045]1
2
3
4
5
6
7
8
9
10
11
12
[8074]13
14
15
16
[8086]17
[8049]18from ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_curvesegment import  GM_CurveSegment
[8045]19
20'''
[8086]21Created on 03-Feb-2012 10:41:13
[8045]22
23@author: mnagni
24'''
25
26class GM_Conic(GM_CurveSegment):
[8074]27    '''
28        Represents a data entity defined in a UML diagram and supposed to
29        be persisted in a relational database.
[8045]30 
[8074]31        This class has been genererated automatically using the Apache Velocity project.
32    '''
33    '''
34        Please note that any access to the inner attributes should be done using
35        the given get/set methods and NOT accessing them directly.
36    '''
37    def __init__(self):
38        self._gm_curvesegment = GM_CurveSegment()       
[8045]39
[8074]40        self.startConstrParam = None
[8086]41        self.numDerivativesAtEnd = None
[8074]42        self.curve = None
43        self.interpolation = None
44        self.numDerivativesAtStart = None
45        self.endConstrParam = None
46        self.numDerivativeInterior = None
47        self.shifted = None
48        self.position = None
49        self.semiLatusRectum = None
50        self.eccentricity = None
51        super(GM_Conic, self).__init__()
[8045]52
53
54
[8074]55    @property
[8086]56    def numDerivativesAtEnd(self):
57        return self._gm_curvesegment.numDerivativesAtEnd
58
59    @numDerivativesAtEnd.setter
60    def numDerivativesAtEnd(self, value):
61            self._gm_curvesegment.numDerivativesAtEnd = value
62
63    @property
[8074]64    def curve(self):
65        return self._gm_curvesegment.curve
[8045]66
[8074]67    @curve.setter
68    def curve(self, value):
[8086]69            self._gm_curvesegment.curve = value
[8045]70
[8074]71    @property
72    def interpolation(self):
73        return self._gm_curvesegment.interpolation
[8049]74
[8074]75    @interpolation.setter
76    def interpolation(self, value):
[8086]77            self._gm_curvesegment.interpolation = value
[8045]78
[8074]79    @property
80    def numDerivativesAtStart(self):
81        return self._gm_curvesegment.numDerivativesAtStart
[8045]82
[8074]83    @numDerivativesAtStart.setter
84    def numDerivativesAtStart(self, value):
[8086]85            self._gm_curvesegment.numDerivativesAtStart = value
[8045]86
87
88
[8074]89    @property
90    def numDerivativeInterior(self):
91        return self._gm_curvesegment.numDerivativeInterior
[8045]92
[8074]93    @numDerivativeInterior.setter
94    def numDerivativeInterior(self, value):
[8086]95            self._gm_curvesegment.numDerivativeInterior = value
[8045]96
97
98
99
100
[8049]101
102
[8074]103
[8086]104
105    def __key(self):
106        return (self.startConstrParam, self.numDerivativesAtEnd, self.curve, self.interpolation, self.numDerivativesAtStart, self.endConstrParam, self.numDerivativeInterior, self.shifted, self.position, self.semiLatusRectum, self.eccentricity)
107
108    def __eq__(x, y):
109        '''
110        Cannot compare classes which do not define a "__key" attribute
111        '''
112        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
113            return x.__key() == y.__key()
114        return id(x) == id(y)
115
116    def __hash__(self):
117        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.