1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROData_Zone_HeaderFile
24 #define HYDROData_Zone_HeaderFile
26 #include "HYDROData_Entity.h"
27 #include "HYDROData_IInterpolator.h"
29 class Handle(HYDROData_Object);
30 class Handle(HYDROData_IAltitudeObject);
33 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
36 /**\class HYDROData_Zone
37 * \brief Class that stores/retreives information about the 2d face.
39 class HYDROData_Zone : public HYDROData_Entity
44 // Enumeration of mergin types for conflict altitudes
45 enum MergeAltitudesType
47 Merge_UNKNOWN, // Undefined
48 Merge_ZMIN, // The minimum values
49 Merge_ZMAX, // The maximum values
50 Merge_Object // Only one altitude will be taken into account
55 * Enumeration of tags corresponding to the persistent object parameters.
59 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
60 DataTag_Shape, ///< reference shape
61 DataTag_GeometryObject, ///< reference geometry objects
62 DataTag_MergeType, ///< mergin type of conflict bathymetries
63 DataTag_MergeAltitude, ///< reference altitude for conflict merge
67 DEFINE_STANDARD_RTTI(HYDROData_Zone);
70 * Returns the kind of this object. Must be redefined in all objects of known type.
72 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
76 * Returns flag indicating that object is updateble or not.
78 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
82 * Checks that object has 2D presentation. Reimlemented to retun true.
84 HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
88 * Returns flag indicating that object can be removed or not.
90 HYDRODATA_EXPORT virtual bool CanRemove();
93 * Returns the list of all reference objects of this object.
95 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
99 * Sets the shape of the zone.
101 HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
104 * Returns the shape of the zone.
106 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
110 * Returns true if zone needs merge of bathymetries.
112 HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
116 * Sets the interpolator for zone. By default it is NULL and original
117 * interpolation algorithms are used to calculate points altitudes.
118 * If you set interpolator it won't be stored in the data model structure,
119 * it will be deleted during that time as this zone will be freed.
121 HYDRODATA_EXPORT virtual void SetInterpolator( HYDROData_IInterpolator* theInter );
124 * * Returns the interpolator of zone object.
126 HYDRODATA_EXPORT virtual HYDROData_IInterpolator* GetInterpolator() const;
130 * Sets the merging type for conflict altitudes.
131 * By default it is set to Merge_UNKNOWN.
133 HYDRODATA_EXPORT virtual void SetMergeType( const MergeAltitudesType& theType );
136 * Returns the merging type for conflict altitudes.
138 HYDRODATA_EXPORT virtual MergeAltitudesType GetMergeType() const;
142 * Sets the reference altitude to resolve the conflict.
143 * This object is used only in case of "Merge_Object" merge type.
145 HYDRODATA_EXPORT virtual void SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude );
148 * Returns the reference altitude to resolve the conflict.
150 HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetMergeAltitude() const;
153 * Removes the reference altitude for resolving the conflict.
155 HYDRODATA_EXPORT virtual void RemoveMergeAltitude();
159 * Add new one geometry object for zone.
161 HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
164 * Returns all geometry objects of zone.
166 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
169 * Removes all geometry objects from zone.
171 HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
175 friend class HYDROData_Region;
176 friend class HYDROData_Iterator;
179 * Creates new object in the internal data structure. Use higher level objects
180 * to create objects with real content.
182 HYDRODATA_EXPORT HYDROData_Zone();
185 * Destructs properties of the object and object itself, removes it from the document.
187 HYDRODATA_EXPORT ~HYDROData_Zone();
190 HYDROData_IInterpolator* myInterpolator;