Salome HOME
#refs 522 (very draft) //import only
[modules/hydro.git] / src / HYDROData / HYDROData_Zone.h
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROData_Zone_HeaderFile
24 #define HYDROData_Zone_HeaderFile
25
26 #include "HYDROData_Entity.h"
27 #include "HYDROData_IInterpolator.h"
28
29 class Handle(HYDROData_Object);
30 class Handle(HYDROData_IAltitudeObject);
31 class TopoDS_Shape;
32
33 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
34
35
36 /**\class HYDROData_Zone
37  * \brief Class that stores/retreives information about the 2d face.
38  */
39 class HYDROData_Zone : public HYDROData_Entity
40 {
41
42 public:
43
44   // Enumeration of mergin types for conflict altitudes
45   enum MergeAltitudesType
46   {
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
51   };
52
53 protected:
54   /**
55    * Enumeration of tags corresponding to the persistent object parameters.
56    */
57   enum DataTag
58   {
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
64   };
65
66 public:
67   DEFINE_STANDARD_RTTI(HYDROData_Zone);
68
69   /**
70    * Returns the kind of this object. Must be redefined in all objects of known type.
71    */
72   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
73
74
75   /**
76    * Returns flag indicating that object is updateble or not.
77    */
78   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
79
80
81   /**
82    * Checks that object has 2D presentation. Reimlemented to retun true.
83    */
84   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
85
86
87   /**
88    * Returns flag indicating that object can be removed or not.
89    */
90   HYDRODATA_EXPORT virtual bool CanRemove();
91
92   /**
93    * Returns the list of all reference objects of this object.
94    */
95   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
96
97
98   /**
99    * Sets the shape of the zone.
100    */
101   HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
102
103   /**
104    * Returns the shape of the zone.
105    */
106   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
107
108
109   /**
110    * Returns true if zone needs merge of bathymetries.
111    */
112   HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
113
114
115   /**
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.
120    */
121   HYDRODATA_EXPORT virtual void SetInterpolator( HYDROData_IInterpolator* theInter );
122
123   /**
124    * * Returns the interpolator of zone object.
125    */
126   HYDRODATA_EXPORT virtual HYDROData_IInterpolator* GetInterpolator() const;
127
128
129   /**
130    * Sets the merging type for conflict altitudes.
131    * By default it is set to Merge_UNKNOWN.
132    */
133   HYDRODATA_EXPORT virtual void SetMergeType( const MergeAltitudesType& theType );
134
135   /**
136    * Returns the merging type for conflict altitudes.
137    */
138   HYDRODATA_EXPORT virtual MergeAltitudesType GetMergeType() const;
139
140
141   /**
142    * Sets the reference altitude to resolve the conflict.
143    * This object is used only in case of "Merge_Object" merge type.
144    */
145   HYDRODATA_EXPORT virtual void SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude );
146
147   /**
148    * Returns the reference altitude to resolve the conflict.
149    */
150   HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetMergeAltitude() const;
151
152   /**
153    * Removes the reference altitude for resolving the conflict.
154    */
155   HYDRODATA_EXPORT virtual void RemoveMergeAltitude();
156   
157
158   /**
159    * Add new one geometry object for zone.
160    */
161   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
162
163   /**
164    * Returns all geometry objects of zone.
165    */
166   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
167
168   /**
169    * Removes all geometry objects from zone.
170    */
171   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
172
173 protected:
174
175   friend class HYDROData_Region;
176   friend class HYDROData_Iterator;
177
178   /**
179    * Creates new object in the internal data structure. Use higher level objects 
180    * to create objects with real content.
181    */
182   HYDRODATA_EXPORT HYDROData_Zone();
183
184   /**
185    * Destructs properties of the object and object itself, removes it from the document.
186    */
187   HYDRODATA_EXPORT ~HYDROData_Zone();
188
189 private:
190   HYDROData_IInterpolator* myInterpolator;
191
192 };
193
194 #endif