Salome HOME
a01db41e835c4b10c06d2ddb0b584bd4fe203f78
[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
7 class Handle(HYDROData_Object);
8 class Handle(HYDROData_Bathymetry);
9 class TopoDS_Shape;
10
11 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
12
13
14 /**\class HYDROData_Zone
15  * \brief Class that stores/retreives information about the 2d face.
16  */
17 class HYDROData_Zone : public HYDROData_Entity
18 {
19
20 public:
21
22   // Enumeration of mergin types for conflict bathymetries
23   enum MergeBathymetriesType
24   {
25     Merge_UNKNOWN, // Undefined
26     Merge_ZMIN,    // The minimum values
27     Merge_ZMAX,    // The maximum values
28     Merge_Object   // Only one bathymetry will be taken into account
29   };
30
31 protected:
32   /**
33    * Enumeration of tags corresponding to the persistent object parameters.
34    */
35   enum DataTag
36   {
37     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
38     DataTag_Shape,           ///< reference shape
39     DataTag_GeometryObject,  ///< reference geometry objects
40     DataTag_MergeType,       ///< mergin type of conflict bathymetries
41     DataTag_Bathymetry,      ///< reference bathymetry
42   };
43
44 public:
45   DEFINE_STANDARD_RTTI(HYDROData_Zone);
46
47   /**
48    * Returns the kind of this object. Must be redefined in all objects of known type.
49    */
50   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
51
52   /**
53    * Dump object to Python script representation.
54    */
55   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
56
57
58   /**
59    * Returns flag indicating that object is updateble or not.
60    */
61   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
62
63
64   /**
65    * Returns flag indicating that object can be removed or not.
66    */
67   HYDRODATA_EXPORT virtual bool CanRemove();
68
69   /**
70    * Returns the list of all reference objects of this object.
71    */
72   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
73
74
75   /**
76    * Sets the shape of the zone.
77    */
78   HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
79
80   /**
81    * Returns the shape of the zone.
82    */
83   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
84
85
86   /**
87    * Returns true if zone needs merge of bathymetries.
88    */
89   HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
90
91
92   /**
93    * Sets the merging type for conflict bathymetries.
94    * By default it is set to Merge_UNKNOWN.
95    */
96   HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType );
97
98   /**
99    * Returns the merging type for conflict bathymetries.
100    */
101   HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const;
102
103
104   /**
105    * Sets the reference bathymetry to resolve the conflict.
106    * This object is used only in case of "Merge_Object" merge type.
107    */
108   HYDRODATA_EXPORT virtual void SetMergeBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
109
110   /**
111    * Returns the reference bathymetry to resolve the conflict.
112    */
113   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetMergeBathymetry() const;
114
115   /**
116    * Removes the reference bathymetry for resolving the conflict.
117    */
118   HYDRODATA_EXPORT virtual void RemoveMergeBathymetry();
119   
120
121   /**
122    * Add new one geometry object for zone.
123    */
124   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
125
126   /**
127    * Returns all geometry objects of zone.
128    */
129   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
130
131   /**
132    * Removes all geometry objects from zone.
133    */
134   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
135
136
137 protected:
138
139   friend class HYDROData_Region;
140   friend class HYDROData_Iterator;
141
142   /**
143    * Creates new object in the internal data structure. Use higher level objects 
144    * to create objects with real content.
145    */
146   HYDRODATA_EXPORT HYDROData_Zone();
147
148   /**
149    * Destructs properties of the object and object itself, removes it from the document.
150    */
151   HYDRODATA_EXPORT ~HYDROData_Zone();
152
153 };
154
155 #endif