Salome HOME
Fix for new zone creation.
[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_ZMIN,   // The minimum values
26     Merge_ZMAX,   // The maximum values
27     Merge_Object  // Only one bathymetry will be taken into account
28   };
29
30 protected:
31   /**
32    * Enumeration of tags corresponding to the persistent object parameters.
33    */
34   enum DataTag
35   {
36     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
37     DataTag_Shape,           ///< reference shape
38     DataTag_GeometryObject,  ///< reference geometry objects
39     DataTag_MergeType,       ///< mergin type of conflict bathymetries
40     DataTag_Bathymetry,      ///< reference bathymetry
41   };
42
43 public:
44   DEFINE_STANDARD_RTTI(HYDROData_Zone);
45
46   /**
47    * Returns the kind of this object. Must be redefined in all objects of known type.
48    */
49   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_ZONE; }
50
51   /**
52    * Dump object to Python script representation.
53    */
54   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
55
56
57   /**
58    * Sets the shape of the zone.
59    */
60   HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape );
61
62   /**
63    * Returns the shape of the zone.
64    */
65   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
66
67
68   /**
69    * Sets the merging type for conflict bathymetries.
70    * By default it is set to Merge_ZMIN.
71    */
72   HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType );
73
74   /**
75    * Returns the merging type for conflict bathymetries.
76    */
77   HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const;
78
79
80   /**
81    * Sets the reference bathymetry to resolve the conflict.
82    * This object is used only in case of "Merge_Object" merge type.
83    */
84   HYDRODATA_EXPORT virtual void SetMergeBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
85
86   /**
87    * Returns the reference bathymetry to resolve the conflict.
88    */
89   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetMergeBathymetry() const;
90
91   /**
92    * Removes the reference bathymetry for resolving the conflict.
93    */
94   HYDRODATA_EXPORT virtual void RemoveMergeBathymetry();
95   
96
97   /**
98    * Add new one geometry object for zone.
99    */
100   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
101
102   /**
103    * Returns all geometry objects of zone.
104    */
105   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
106
107   /**
108    * Removes all geometry objects from zone.
109    */
110   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
111
112
113 protected:
114
115   friend class HYDROData_Region;
116   friend class HYDROData_Iterator;
117
118   /**
119    * Creates new object in the internal data structure. Use higher level objects 
120    * to create objects with real content.
121    */
122   HYDROData_Zone();
123
124   /**
125    * Destructs properties of the object and object itself, removes it from the document.
126    */
127   ~HYDROData_Zone();
128
129 };
130
131 #endif