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;
48 const ObjectKind KIND_BC_POLYGON;
50 class HYDROData_Entity
53 #include <HYDROData_Entity.h>
56 %ConvertToSubClassCode
57 // HYDROData_Entity sub-classes provide a unique kind ID.
58 switch ( sipCpp->GetKind() )
61 sipClass = sipClass_HYDROData_Image;
65 sipClass = sipClass_HYDROData_Polyline3D;
69 sipClass = sipClass_HYDROData_Bathymetry;
73 sipClass = sipClass_HYDROData_AltitudeObject;
76 case KIND_IMMERSIBLE_ZONE:
77 sipClass = sipClass_HYDROData_ImmersibleZone;
81 sipClass = sipClass_HYDROData_River;
85 sipClass = sipClass_HYDROData_Stream;
89 sipClass = sipClass_HYDROData_Confluence;
93 sipClass = sipClass_HYDROData_Channel;
97 sipClass = sipClass_HYDROData_Obstacle;
101 sipClass = sipClass_HYDROData_Digue;
105 sipClass = sipClass_HYDROData_Profile;
109 sipClass = sipClass_HYDROData_ProfileUZ;
112 case KIND_POLYLINEXY:
113 sipClass = sipClass_HYDROData_PolylineXY;
116 case KIND_CALCULATION:
117 sipClass = sipClass_HYDROData_CalculationCase;
121 sipClass = sipClass_HYDROData_Zone;
125 sipClass = sipClass_HYDROData_Region;
128 case KIND_SHAPES_GROUP:
129 sipClass = sipClass_HYDROData_ShapesGroup;
132 case KIND_SPLIT_GROUP:
133 sipClass = sipClass_HYDROData_SplitShapesGroup;
136 case KIND_STREAM_ALTITUDE:
137 sipClass = sipClass_HYDROData_StreamAltitude;
140 case KIND_OBSTACLE_ALTITUDE:
141 sipClass = sipClass_HYDROData_ObstacleAltitude;
144 case KIND_STRICKLER_TABLE:
145 sipClass = sipClass_HYDROData_StricklerTable;
148 case KIND_LAND_COVER_MAP:
149 sipClass = sipClass_HYDROData_LandCoverMap;
152 case KIND_BC_POLYGON:
153 sipClass = sipClass_HYDROData_BCPolygon;
157 sipClass = sipClass_HYDROData_Entity;
161 // We don't recognise the type.
175 Geom_2d_and_groups = 10,
179 * Returns the kind of this object. Must be redefined in all objects of known type.
181 virtual const ObjectKind GetKind() const;
184 * Returns the name of this object.
186 virtual QString GetName() const;
189 * Updates the name of this object.
191 virtual void SetName(const QString& theName);
194 * Updates object state.
196 virtual void Update();
199 * Checks that object has 2D presentation. Base implementation returns false.
201 virtual bool IsHas2dPrs() const;
204 * Returns data of object wrapped to QVariant.
205 * Base implementation returns null value.
207 virtual QVariant GetDataVariant();
210 * Returns flag indicating that object is updateble or not.
212 virtual bool CanBeUpdated() const;
216 * Checks is object exists in the data structure.
217 * \returns true is object is not exists in the data model
219 bool IsRemoved() const;
222 * Removes object from the data structure.
224 virtual void Remove();
227 * Returns father object. For object created under root document label
228 * this method always return NULL object.
230 HYDROData_Entity GetFatherObject() const [opencascade::handle<HYDROData_Entity> ()];
232 Handle(HYDROData_Entity) aFather;
234 Py_BEGIN_ALLOW_THREADS
235 aFather = sipSelfWasArg ? sipCpp->HYDROData_Entity::GetFatherObject() :
236 sipCpp->GetFatherObject();
239 sipRes = createPointer( aFather );
243 * Returns the list of all reference objects of this object.
244 * Base implementation always return empty list.
246 virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
250 * Returns the z-level for object presentation, -1 if no z-level.
252 virtual bool GetZLevel( int& theLevel ) const [bool ( Standard_Integer& )];
255 * Set the z-level for object presentation.
257 virtual void SetZLevel( const int& theLevel ) [void ( const Standard_Integer& )];
260 * Remove the z-level of object presentation.
262 virtual void RemoveZLevel();
264 void SetColor( const QColor& theColor, const int theTag = 0 );
269 * Creates new object in the internal data structure. Use higher level objects
270 * to create objects with real content.
272 HYDROData_Entity( Geometry );
275 * Destructs properties of the object and object itself, removes it from the document.
277 virtual ~HYDROData_Entity();