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.
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.
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
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <HYDROData_Entity.h>
23 typedef int ObjectKind;
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_SPLIT_GROUP;
45 const ObjectKind KIND_OBSTACLE_ALTITUDE;
46 const ObjectKind KIND_STRICKLER_TABLE;
47 const ObjectKind KIND_LAND_COVER_MAP;
49 class HYDROData_Entity
52 #include <HYDROData_Entity.h>
55 %ConvertToSubClassCode
56 // HYDROData_Entity sub-classes provide a unique kind ID.
57 switch ( sipCpp->GetKind() )
60 sipClass = sipClass_HYDROData_Image;
64 sipClass = sipClass_HYDROData_Polyline3D;
68 sipClass = sipClass_HYDROData_Bathymetry;
72 sipClass = sipClass_HYDROData_AltitudeObject;
75 case KIND_IMMERSIBLE_ZONE:
76 sipClass = sipClass_HYDROData_ImmersibleZone;
80 sipClass = sipClass_HYDROData_River;
84 sipClass = sipClass_HYDROData_Stream;
88 sipClass = sipClass_HYDROData_Confluence;
92 sipClass = sipClass_HYDROData_Channel;
96 sipClass = sipClass_HYDROData_Obstacle;
100 sipClass = sipClass_HYDROData_Digue;
104 sipClass = sipClass_HYDROData_Profile;
108 sipClass = sipClass_HYDROData_ProfileUZ;
111 case KIND_POLYLINEXY:
112 sipClass = sipClass_HYDROData_PolylineXY;
115 case KIND_CALCULATION:
116 sipClass = sipClass_HYDROData_CalculationCase;
120 sipClass = sipClass_HYDROData_Zone;
124 sipClass = sipClass_HYDROData_Region;
127 case KIND_SHAPES_GROUP:
128 sipClass = sipClass_HYDROData_ShapesGroup;
131 case KIND_SPLIT_GROUP:
132 sipClass = sipClass_HYDROData_SplitShapesGroup;
135 case KIND_STREAM_ALTITUDE:
136 sipClass = sipClass_HYDROData_StreamAltitude;
139 case KIND_OBSTACLE_ALTITUDE:
140 sipClass = sipClass_HYDROData_ObstacleAltitude;
143 case KIND_STRICKLER_TABLE:
144 sipClass = sipClass_HYDROData_StricklerTable;
147 case KIND_LAND_COVER_MAP:
148 sipClass = sipClass_HYDROData_LandCoverMap;
152 sipClass = sipClass_HYDROData_Entity;
156 // We don't recognise the type.
170 Geom_2d_and_groups = 10,
174 * Returns the kind of this object. Must be redefined in all objects of known type.
176 virtual const ObjectKind GetKind() const;
179 * Returns the name of this object.
181 virtual QString GetName() const;
184 * Updates the name of this object.
186 virtual void SetName(const QString& theName);
189 * Updates object state.
191 virtual void Update();
194 * Checks that object has 2D presentation. Base implementation returns false.
196 virtual bool IsHas2dPrs() const;
199 * Returns data of object wrapped to QVariant.
200 * Base implementation returns null value.
202 virtual QVariant GetDataVariant();
205 * Returns flag indicating that object is updateble or not.
207 virtual bool CanBeUpdated() const;
211 * Checks is object exists in the data structure.
212 * \returns true is object is not exists in the data model
214 bool IsRemoved() const;
217 * Removes object from the data structure.
219 virtual void Remove();
222 * Returns father object. For object created under root document label
223 * this method always return NULL object.
225 HYDROData_Entity GetFatherObject() const [opencascade::handle<HYDROData_Entity> ()];
227 Handle(HYDROData_Entity) aFather;
229 Py_BEGIN_ALLOW_THREADS
230 aFather = sipSelfWasArg ? sipCpp->HYDROData_Entity::GetFatherObject() :
231 sipCpp->GetFatherObject();
234 sipRes = createPointer( aFather );
238 * Returns the list of all reference objects of this object.
239 * Base implementation always return empty list.
241 virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
245 * Returns the z-level for object presentation, -1 if no z-level.
247 virtual bool GetZLevel( int& theLevel ) const [bool ( Standard_Integer& )];
250 * Set the z-level for object presentation.
252 virtual void SetZLevel( const int& theLevel ) [void ( const Standard_Integer& )];
255 * Remove the z-level of object presentation.
257 virtual void RemoveZLevel();
259 void SetColor( const QColor& theColor, const int theTag = 0 );
264 * Creates new object in the internal data structure. Use higher level objects
265 * to create objects with real content.
267 HYDROData_Entity( Geometry );
270 * Destructs properties of the object and object itself, removes it from the document.
272 virtual ~HYDROData_Entity();