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