Salome HOME
Merge branch 'BR_LCM_COMP' into BR_LAND_COVER_MAP
[modules/hydro.git] / src / HYDROPy / HYDROData_Entity.sip
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 %ExportedHeaderCode
20 #include <HYDROData_Entity.h>
21 %End
22
23 typedef int ObjectKind;
24
25 const ObjectKind KIND_UNKNOWN;
26 const ObjectKind KIND_IMAGE;
27 const ObjectKind KIND_POLYLINE;
28 const ObjectKind KIND_BATHYMETRY;
29 const ObjectKind KIND_ALTITUDE;
30 const ObjectKind KIND_IMMERSIBLE_ZONE;
31 const ObjectKind KIND_RIVER;
32 const ObjectKind KIND_STREAM;
33 const ObjectKind KIND_CONFLUENCE;
34 const ObjectKind KIND_CHANNEL;
35 const ObjectKind KIND_OBSTACLE;
36 const ObjectKind KIND_DIGUE;
37 const ObjectKind KIND_PROFILE;
38 const ObjectKind KIND_PROFILEUZ;
39 const ObjectKind KIND_POLYLINEXY;
40 const ObjectKind KIND_CALCULATION;
41 const ObjectKind KIND_ZONE;
42 const ObjectKind KIND_REGION;
43 const ObjectKind KIND_SHAPES_GROUP;
44 const ObjectKind KIND_SPLITTED_GROUP;
45 const ObjectKind KIND_OBSTACLE_ALTITUDE;
46 const ObjectKind KIND_STRICKLER_TABLE;
47 const ObjectKind KIND_LAND_COVER_MAP;
48
49 class HYDROData_Entity
50 {
51 %TypeHeaderCode
52 #include <HYDROData_Entity.h>
53 %End
54
55 %ConvertToSubClassCode
56     // HYDROData_Entity sub-classes provide a unique kind ID.
57     switch ( sipCpp->GetKind() )
58     {
59       case KIND_IMAGE:
60         sipClass = sipClass_HYDROData_Image;
61         break;
62
63       case KIND_POLYLINE:
64         sipClass = sipClass_HYDROData_Polyline3D;
65         break;
66
67       case KIND_BATHYMETRY:
68         sipClass = sipClass_HYDROData_Bathymetry;
69         break;
70
71       case KIND_ALTITUDE:
72         sipClass = sipClass_HYDROData_AltitudeObject;
73         break;
74
75       case KIND_IMMERSIBLE_ZONE:
76         sipClass = sipClass_HYDROData_ImmersibleZone;
77         break;
78
79       case KIND_RIVER:
80         sipClass = sipClass_HYDROData_River;
81         break;
82
83       case KIND_STREAM:
84         sipClass = sipClass_HYDROData_Stream;
85         break;
86
87       case KIND_CONFLUENCE:
88         sipClass = sipClass_HYDROData_Confluence;
89         break;
90
91       case KIND_CHANNEL:
92         sipClass = sipClass_HYDROData_Channel;
93         break;
94
95       case KIND_OBSTACLE:
96         sipClass = sipClass_HYDROData_Obstacle;
97         break;
98
99       case KIND_DIGUE:
100         sipClass = sipClass_HYDROData_Digue;
101         break;
102
103       case KIND_PROFILE:
104         sipClass = sipClass_HYDROData_Profile;
105         break;
106
107       case KIND_PROFILEUZ:
108         sipClass = sipClass_HYDROData_ProfileUZ;
109         break;
110
111       case KIND_POLYLINEXY:
112         sipClass = sipClass_HYDROData_PolylineXY;
113         break;
114
115       case KIND_CALCULATION:
116         sipClass = sipClass_HYDROData_CalculationCase;
117         break;
118
119       case KIND_ZONE:
120         sipClass = sipClass_HYDROData_Zone;
121         break;
122
123       case KIND_REGION:
124         sipClass = sipClass_HYDROData_Region;
125         break;
126
127       case KIND_SHAPES_GROUP:
128         sipClass = sipClass_HYDROData_ShapesGroup;
129         break;
130         
131       case KIND_SPLITTED_GROUP:
132         sipClass = sipClass_HYDROData_SplittedShapesGroup;
133         break;
134
135       case KIND_STREAM_ALTITUDE:
136         sipClass = sipClass_HYDROData_StreamAltitude;
137         break;
138
139       case KIND_OBSTACLE_ALTITUDE:
140         sipClass = sipClass_HYDROData_ObstacleAltitude;
141         break;
142
143       case KIND_STRICKLER_TABLE:
144         sipClass = sipClass_HYDROData_StricklerTable;
145         break;
146
147       case KIND_LAND_COVER_MAP:
148         sipClass = sipClass_HYDROData_LandCoverMap;
149         break;
150
151       case KIND_UNKNOWN:
152         sipClass = sipClass_HYDROData_Entity;
153         break;
154
155       default:
156         // We don't recognise the type.
157         sipClass = NULL;
158     }
159 %End
160
161 public:
162   enum Geometry
163   {
164     Geom_No = 1,
165     Geom_2d = 2,
166     Geom_Z  = 4,
167     Geom_Groups = 8,
168
169     Geom_3d = 6,
170     Geom_2d_and_groups = 10,
171   };
172
173   /**
174    * Returns the kind of this object. Must be redefined in all objects of known type.
175    */
176   virtual const ObjectKind GetKind() const;
177
178   /**
179    * Returns the name of this object.
180    */
181   virtual QString GetName() const;
182
183   /**
184    * Updates the name of this object.
185    */
186   virtual void SetName(const QString& theName);
187
188   /**
189    * Updates object state.
190    */
191   virtual void Update();
192
193   /**
194    * Checks that object has 2D presentation. Base implementation returns false.
195    */
196   virtual bool IsHas2dPrs() const;
197
198   /**
199    * Returns data of object wrapped to QVariant.
200    * Base implementation returns null value.
201    */
202   virtual QVariant GetDataVariant();
203
204   /**
205    * Returns flag indicating that object is updateble or not.
206    */
207   virtual bool CanBeUpdated() const;
208
209   
210   /**
211    * Checks is object exists in the data structure.
212    * \returns true is object is not exists in the data model
213    */
214   bool IsRemoved() const;
215
216   /**
217    * Removes object from the data structure.
218    */
219   virtual void Remove();
220
221   /**
222    * Returns father object. For object created under root document label
223    * this method always return NULL object.
224    */
225   HYDROData_Entity GetFatherObject() const [Handle_HYDROData_Entity ()];
226   %MethodCode
227     Handle(HYDROData_Entity) aFather;
228     
229     Py_BEGIN_ALLOW_THREADS
230     aFather = sipSelfWasArg ? sipCpp->HYDROData_Entity::GetFatherObject() : 
231                               sipCpp->GetFatherObject();
232     Py_END_ALLOW_THREADS
233     
234     sipRes = createPointer( aFather );
235   %End
236
237   /**
238    * Returns the list of all reference objects of this object.
239    * Base implementation always return empty list.
240    */
241   virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
242
243
244   /**
245    * Returns the z-level for object presentation, -1 if no z-level.
246    */
247   virtual bool GetZLevel( int& theLevel ) const [Standard_Boolean ( Standard_Integer& )];
248
249   /**
250    * Set the z-level for object presentation.
251    */
252   virtual void SetZLevel( const int& theLevel ) [void ( const Standard_Integer& )];
253
254   /**
255    * Remove the z-level of object presentation.
256    */
257   virtual void RemoveZLevel();
258
259
260 protected:
261
262   /**
263    * Creates new object in the internal data structure. Use higher level objects 
264    * to create objects with real content.
265    */
266   HYDROData_Entity( Geometry );
267
268   /**
269    * Destructs properties of the object and object itself, removes it from the document.
270    */
271   virtual ~HYDROData_Entity();
272   
273 };