Salome HOME
e79f93943e1a2521756b6e44d66363e73cb4c5d4
[modules/hydro.git] / src / HYDROData / HYDROData_Region.h
1
2 #ifndef HYDROData_Region_HeaderFile
3 #define HYDROData_Region_HeaderFile
4
5 #include "HYDROData_Entity.h"
6
7
8 DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity)
9
10 class Handle(HYDROData_Zone);
11
12 /**\class HYDROData_Region
13  * \brief Regions are groups (lists) of zones, they can include one or several zones.
14  */
15 class HYDROData_Region : public HYDROData_Entity
16 {
17
18 public:
19
20   // Enumeration of mergin types for conflict bathymetries
21   enum MergeBathymetriesType
22   {
23     Merge_ZMIN,
24     Merge_ZMAX
25   };
26
27 protected:
28
29   /**
30    * Enumeration of tags corresponding to the persistent object parameters.
31    */
32   enum DataTag
33   {
34     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
35     DataTag_Zone,         ///< reference zones
36     DataTag_MergeType,    ///< mergin type of conflict bathymetries
37   };
38
39   /**
40    * Enumeration of tags corresponding to the child sub-objects of object.
41    */
42   enum ChildTag
43   {
44     ChildTag_First = HYDROData_Entity::ChildTag_First + 100, ///< first tag, to reserve
45     ChildTag_Zone      ///< child zones
46   };
47
48 public:
49   DEFINE_STANDARD_RTTI(HYDROData_Region);
50
51   /**
52    * Returns the kind of this object. Must be redefined in all objects of known type.
53    */
54   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; }
55
56   /**
57    * Dump object to Python script representation.
58    */
59   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
60
61
62   /**
63    * Create new one reference zone for region on child label.
64    * The new zone is not added into the list of reference zones.
65    */
66   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) AddNewZone();
67
68   /**
69    * Removes all child zones from region.
70    */
71   HYDRODATA_EXPORT virtual void RemoveChildZones();
72
73
74   /**
75    * Sets the merging type for conflict bathymetries.
76    * By default it is set to Merge_ZMIN.
77    */
78   HYDRODATA_EXPORT virtual void SetMergeType( const MergeBathymetriesType& theType );
79
80   /**
81    * Returns the merging type for conflict bathymetries.
82    */
83   HYDRODATA_EXPORT virtual MergeBathymetriesType GetMergeType() const;
84
85
86
87   /**
88    * Returns number of reference zones of region.
89    */
90   int NbZones() const;
91
92   /**
93    * Add new one reference zone for region.
94    */
95   HYDRODATA_EXPORT virtual void AddZone( const Handle(HYDROData_Zone)& theZone );
96
97   /**
98    * Replace the reference zone for region.
99    */
100   HYDRODATA_EXPORT virtual void SetZone( const int                     theIndex,
101                                          const Handle(HYDROData_Zone)& theZone );
102
103   /**
104    * Inserts the reference zone for region before given index.
105    */
106   HYDRODATA_EXPORT virtual void InsertZone( const int                     theBeforeIndex,
107                                             const Handle(HYDROData_Zone)& theZone );
108
109   /**
110    * Sets reference zones for calculation region.
111    */
112   HYDRODATA_EXPORT virtual void SetZones( const HYDROData_SequenceOfObjects& theZones );
113
114   /**
115    * Returns reference zone of region by index.
116    */
117   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZone( const int theIndex ) const;
118
119   /**
120    * Returns all reference zone of region.
121    */
122   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const;
123
124   /**
125    * Removes reference zone from region.
126    */
127   HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone );
128
129   /**
130    * Removes reference zone from region by it index.
131    */
132   HYDRODATA_EXPORT virtual void RemoveZone( const int theIndex );
133
134   /**
135    * Removes all reference zones from region.
136    */
137   HYDRODATA_EXPORT virtual void RemoveZones();
138
139
140 protected:
141
142   friend class HYDROData_Calculation;
143   friend class HYDROData_Iterator;
144
145   /**
146    * Creates new object in the internal data structure. Use higher level objects 
147    * to create objects with real content.
148    */
149   HYDROData_Region();
150
151   /**
152    * Destructs properties of the object and object itself, removes it from the document.
153    */
154   ~HYDROData_Region();
155 };
156
157 #endif