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
19 #ifndef HYDROData_Zone_HeaderFile
20 #define HYDROData_Zone_HeaderFile
22 #include "HYDROData_Entity.h"
23 #include "HYDROData_IInterpolator.h"
25 class Handle(HYDROData_LandCover);
28 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
31 /**\class HYDROData_Zone
32 * \brief Class that stores/retreives information about the 2d face.
34 class HYDROData_Zone : public HYDROData_Entity
39 // Enumeration of mergin types for conflict altitudes/types
42 Merge_UNKNOWN, // Undefined
43 Merge_ZMIN, // The minimum values
44 Merge_ZMAX, // The maximum values
45 Merge_Object // Only one altitude/land cover will be taken into account
50 * Enumeration of tags corresponding to the persistent object parameters.
54 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
55 DataTag_Shape, ///< reference shape
56 DataTag_Object, ///< reference objects
57 DataTag_MergeType, ///< mergin type of conflict bathymetries/types
58 DataTag_MergeObject, ///< reference altitude/land cover for conflict merge
62 DEFINE_STANDARD_RTTI(HYDROData_Zone);
65 * Returns the kind of this object. Must be redefined in all objects of known type.
67 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
71 * Returns flag indicating that object is updateble or not.
73 HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
77 * Checks that object has 2D presentation. Reimlemented to retun true.
79 HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
83 * Returns flag indicating that object can be removed or not.
85 HYDRODATA_EXPORT virtual bool CanRemove();
88 * Returns the list of all reference objects of this object.
90 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
94 * Sets the shape of the zone.
96 HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
99 * Returns the shape of the zone.
101 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
105 * Returns true if zone needs merge of bathymetries.
107 HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
111 * Sets the interpolator for zone. By default it is NULL and original
112 * interpolation algorithms are used to calculate points altitudes.
113 * If you set interpolator it won't be stored in the data model structure,
114 * it will be deleted during that time as this zone will be freed.
116 HYDRODATA_EXPORT virtual void SetInterpolator( HYDROData_IInterpolator* theInter );
119 * * Returns the interpolator of zone object.
121 HYDRODATA_EXPORT virtual HYDROData_IInterpolator* GetInterpolator() const;
124 * Sets the merging type for conflict altitudes.
125 * By default it is set to Merge_UNKNOWN.
127 HYDRODATA_EXPORT virtual void SetMergeType( const MergeType& theType );
130 * Returns the merging type for conflict altitudes/types.
132 HYDRODATA_EXPORT virtual MergeType GetMergeType() const;
136 * Sets the reference object to resolve the conflict.
137 * This object is used only in case of "Merge_Object" merge type.
138 * \param theObject the merge object
140 HYDRODATA_EXPORT virtual void SetMergeObject( const Handle(HYDROData_Entity)& theObject );
143 * Returns the reference object to resolve the conflict.
144 * \return the merge object
146 HYDRODATA_EXPORT virtual Handle(HYDROData_Entity) GetMergeObject() const;
149 * Removes the reference object for resolving the conflict.
151 HYDRODATA_EXPORT virtual void RemoveMergeObject();
154 * Add new one object for zone.
155 * \param theObject the object to add
157 HYDRODATA_EXPORT virtual bool AddObject( const Handle(HYDROData_Entity)& theObject );
160 * Returns all objects of zone.
161 * \return the list of objects
163 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetObjects() const;
166 * Removes all objects from zone.
168 HYDRODATA_EXPORT virtual void RemoveObjects();
171 * Returns submersible flag.
172 * \return true if all objects of the zone is submersible
174 HYDRODATA_EXPORT bool IsSubmersible() const;
178 friend class HYDROData_Region;
179 friend class HYDROData_Iterator;
182 * Creates new object in the internal data structure. Use higher level objects
183 * to create objects with real content.
185 HYDRODATA_EXPORT HYDROData_Zone();
188 * Destructs properties of the object and object itself, removes it from the document.
190 HYDRODATA_EXPORT ~HYDROData_Zone();
193 HYDROData_IInterpolator* myInterpolator;