Salome HOME
refs #562: basic logic for Strickler table operation and dialog.
[modules/hydro.git] / src / HYDROData / HYDROData_Zone.h
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.
6 //
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.
11 //
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
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROData_Zone_HeaderFile
20 #define HYDROData_Zone_HeaderFile
21
22 #include "HYDROData_Entity.h"
23 #include "HYDROData_IInterpolator.h"
24
25 class Handle(HYDROData_Object);
26 class Handle(HYDROData_IAltitudeObject);
27 class TopoDS_Shape;
28
29 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
30
31
32 /**\class HYDROData_Zone
33  * \brief Class that stores/retreives information about the 2d face.
34  */
35 class HYDROData_Zone : public HYDROData_Entity
36 {
37
38 public:
39
40   // Enumeration of mergin types for conflict altitudes
41   enum MergeAltitudesType
42   {
43     Merge_UNKNOWN, // Undefined
44     Merge_ZMIN,    // The minimum values
45     Merge_ZMAX,    // The maximum values
46     Merge_Object   // Only one altitude will be taken into account
47   };
48
49 protected:
50   /**
51    * Enumeration of tags corresponding to the persistent object parameters.
52    */
53   enum DataTag
54   {
55     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
56     DataTag_Shape,           ///< reference shape
57     DataTag_GeometryObject,  ///< reference geometry objects
58     DataTag_MergeType,       ///< mergin type of conflict bathymetries
59     DataTag_MergeAltitude,   ///< reference altitude for conflict merge
60   };
61
62 public:
63   DEFINE_STANDARD_RTTI(HYDROData_Zone);
64
65   /**
66    * Returns the kind of this object. Must be redefined in all objects of known type.
67    */
68   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
69
70
71   /**
72    * Returns flag indicating that object is updateble or not.
73    */
74   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
75
76
77   /**
78    * Checks that object has 2D presentation. Reimlemented to retun true.
79    */
80   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
81
82
83   /**
84    * Returns flag indicating that object can be removed or not.
85    */
86   HYDRODATA_EXPORT virtual bool CanRemove();
87
88   /**
89    * Returns the list of all reference objects of this object.
90    */
91   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
92
93
94   /**
95    * Sets the shape of the zone.
96    */
97   HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
98
99   /**
100    * Returns the shape of the zone.
101    */
102   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
103
104
105   /**
106    * Returns true if zone needs merge of bathymetries.
107    */
108   HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
109
110
111   /**
112    * Sets the interpolator for zone. By default it is NULL and original
113    * interpolation algorithms are used to calculate points altitudes.
114    * If you set interpolator it won't be stored in the data model structure,
115    * it will be deleted during that time as this zone will be freed.
116    */
117   HYDRODATA_EXPORT virtual void SetInterpolator( HYDROData_IInterpolator* theInter );
118
119   /**
120    * * Returns the interpolator of zone object.
121    */
122   HYDRODATA_EXPORT virtual HYDROData_IInterpolator* GetInterpolator() const;
123
124
125   /**
126    * Sets the merging type for conflict altitudes.
127    * By default it is set to Merge_UNKNOWN.
128    */
129   HYDRODATA_EXPORT virtual void SetMergeType( const MergeAltitudesType& theType );
130
131   /**
132    * Returns the merging type for conflict altitudes.
133    */
134   HYDRODATA_EXPORT virtual MergeAltitudesType GetMergeType() const;
135
136
137   /**
138    * Sets the reference altitude to resolve the conflict.
139    * This object is used only in case of "Merge_Object" merge type.
140    */
141   HYDRODATA_EXPORT virtual void SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude );
142
143   /**
144    * Returns the reference altitude to resolve the conflict.
145    */
146   HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetMergeAltitude() const;
147
148   /**
149    * Removes the reference altitude for resolving the conflict.
150    */
151   HYDRODATA_EXPORT virtual void RemoveMergeAltitude();
152   
153
154   /**
155    * Add new one geometry object for zone.
156    */
157   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
158
159   /**
160    * Returns all geometry objects of zone.
161    */
162   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
163
164   /**
165    * Removes all geometry objects from zone.
166    */
167   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
168
169   HYDRODATA_EXPORT bool IsSubmersible() const;
170
171 protected:
172
173   friend class HYDROData_Region;
174   friend class HYDROData_Iterator;
175
176   /**
177    * Creates new object in the internal data structure. Use higher level objects 
178    * to create objects with real content.
179    */
180   HYDRODATA_EXPORT HYDROData_Zone();
181
182   /**
183    * Destructs properties of the object and object itself, removes it from the document.
184    */
185   HYDRODATA_EXPORT ~HYDROData_Zone();
186
187 private:
188   HYDROData_IInterpolator* myInterpolator;
189
190 };
191
192 #endif