Salome HOME
patch for correct compilation on Linux
[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 can be removed or not.
60    */
61   HYDRODATA_EXPORT virtual bool CanRemove();
62
63   /**
64    * Returns the list of all reference objects of this object.
65    */
66   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
67
68
69   /**
70    * Sets the shape of the zone.
71    */
72   HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
73
74   /**
75    * Returns the shape of the zone.
76    */
77   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
78
79
80   /**
81    * Returns true if zone needs merge of bathymetries.
82    */
83   HYDRODATA_EXPORT virtual bool IsMergingNeed() const;
84
85
86   /**
87    * Sets the merging type for conflict bathymetries.
88    * By default it is set to Merge_UNKNOWN.
89    */
90   HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType );
91
92   /**
93    * Returns the merging type for conflict bathymetries.
94    */
95   HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const;
96
97
98   /**
99    * Sets the reference bathymetry to resolve the conflict.
100    * This object is used only in case of "Merge_Object" merge type.
101    */
102   HYDRODATA_EXPORT virtual void SetMergeBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
103
104   /**
105    * Returns the reference bathymetry to resolve the conflict.
106    */
107   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetMergeBathymetry() const;
108
109   /**
110    * Removes the reference bathymetry for resolving the conflict.
111    */
112   HYDRODATA_EXPORT virtual void RemoveMergeBathymetry();
113   
114
115   /**
116    * Add new one geometry object for zone.
117    */
118   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
119
120   /**
121    * Returns all geometry objects of zone.
122    */
123   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
124
125   /**
126    * Removes all geometry objects from zone.
127    */
128   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
129
130
131 protected:
132
133   friend class HYDROData_Region;
134   friend class HYDROData_Iterator;
135
136   /**
137    * Creates new object in the internal data structure. Use higher level objects 
138    * to create objects with real content.
139    */
140   HYDRODATA_EXPORT HYDROData_Zone();
141
142   /**
143    * Destructs properties of the object and object itself, removes it from the document.
144    */
145   HYDRODATA_EXPORT ~HYDROData_Zone();
146
147 };
148
149 #endif