1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | from ea_model.iso_19107_2003_spatial_schema.geometry.coordinate_geometry.gm_linestring import GM_LineString |
---|
22 | from ascore.utils import has_value |
---|
23 | |
---|
24 | ''' |
---|
25 | Created on 16-Feb-2012 16:18:08 |
---|
26 | |
---|
27 | @author: mnagni |
---|
28 | ''' |
---|
29 | |
---|
30 | class GM_LineSegment(GM_LineString): |
---|
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_linestring = GM_LineString() |
---|
43 | |
---|
44 | self.numDerivativesAtEnd = None |
---|
45 | self.curve = None |
---|
46 | self.interpolation = None |
---|
47 | self.numDerivativesAtStart = None |
---|
48 | self.numDerivativeInterior = None |
---|
49 | self.controlPoint = None |
---|
50 | super(GM_LineSegment, self).__init__() |
---|
51 | |
---|
52 | @property |
---|
53 | def numDerivativesAtEnd(self): |
---|
54 | return self._gm_linestring.numDerivativesAtEnd |
---|
55 | |
---|
56 | @numDerivativesAtEnd.setter |
---|
57 | def numDerivativesAtEnd(self, value): |
---|
58 | self._gm_linestring.numDerivativesAtEnd = value |
---|
59 | |
---|
60 | @property |
---|
61 | def curve(self): |
---|
62 | return self._gm_linestring.curve |
---|
63 | |
---|
64 | @curve.setter |
---|
65 | def curve(self, value): |
---|
66 | self._gm_linestring.curve = value |
---|
67 | |
---|
68 | @property |
---|
69 | def interpolation(self): |
---|
70 | return self._gm_linestring.interpolation |
---|
71 | |
---|
72 | @interpolation.setter |
---|
73 | def interpolation(self, value): |
---|
74 | self._gm_linestring.interpolation = value |
---|
75 | |
---|
76 | @property |
---|
77 | def numDerivativesAtStart(self): |
---|
78 | return self._gm_linestring.numDerivativesAtStart |
---|
79 | |
---|
80 | @numDerivativesAtStart.setter |
---|
81 | def numDerivativesAtStart(self, value): |
---|
82 | self._gm_linestring.numDerivativesAtStart = value |
---|
83 | |
---|
84 | @property |
---|
85 | def numDerivativeInterior(self): |
---|
86 | return self._gm_linestring.numDerivativeInterior |
---|
87 | |
---|
88 | @numDerivativeInterior.setter |
---|
89 | def numDerivativeInterior(self, value): |
---|
90 | self._gm_linestring.numDerivativeInterior = value |
---|
91 | |
---|
92 | @property |
---|
93 | def controlPoint(self): |
---|
94 | return self._gm_linestring.controlPoint |
---|
95 | |
---|
96 | @controlPoint.setter |
---|
97 | def controlPoint(self, value): |
---|
98 | self._gm_linestring.controlPoint = value |
---|
99 | |
---|
100 | def __key(self): |
---|
101 | return (self.numDerivativesAtEnd, self.curve, self.interpolation, self.numDerivativesAtStart, self.numDerivativeInterior, self.controlPoint) |
---|
102 | |
---|
103 | def __eq__(self, y): |
---|
104 | ''' |
---|
105 | Cannot compare classes which do not define a "__key" attribute |
---|
106 | ''' |
---|
107 | if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): |
---|
108 | return self.__key() == y.__key() |
---|
109 | return id(self) == id(y) |
---|
110 | |
---|
111 | def __hash__(self): |
---|
112 | return hash(self.__key()) |
---|