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