Salome HOME
Linux compilation.
[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 protected:
19
20   /**
21    * Enumeration of tags corresponding to the persistent object parameters.
22    */
23   enum DataTag
24   {
25     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
26     DataTag_Zone    ///< reference zones
27   };
28
29   /**
30    * Enumeration of tags corresponding to the child sub-objects of object.
31    */
32   enum ChildTag
33   {
34     ChildTag_First = HYDROData_Entity::ChildTag_First + 100, ///< first tag, to reserve
35     ChildTag_Zone      ///< child zones
36   };
37
38 public:
39   DEFINE_STANDARD_RTTI(HYDROData_Region);
40
41   /**
42    * Returns the kind of this object. Must be redefined in all objects of known type.
43    */
44   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; }
45
46   /**
47    * Dump object to Python script representation.
48    */
49   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
50
51
52   /**
53    * Create new one reference zone for region on child label.
54    * The new zone is not added into the list of reference zones.
55    */
56   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) AddNewZone();
57
58   /**
59    * Removes all child zones from region.
60    */
61   HYDRODATA_EXPORT virtual void RemoveChildZones();
62
63
64   /**
65    * Returns number of reference zones of region.
66    */
67   int NbZones() const;
68
69   /**
70    * Add new one reference zone for region.
71    */
72   HYDRODATA_EXPORT virtual void AddZone( const Handle(HYDROData_Zone)& theZone );
73
74   /**
75    * Replace the reference zone for region.
76    */
77   HYDRODATA_EXPORT virtual void SetZone( const int                     theIndex,
78                                          const Handle(HYDROData_Zone)& theZone );
79
80   /**
81    * Inserts the reference zone for region before given index.
82    */
83   HYDRODATA_EXPORT virtual void InsertZone( const int                     theBeforeIndex,
84                                             const Handle(HYDROData_Zone)& theZone );
85
86   /**
87    * Sets reference zones for calculation region.
88    */
89   HYDRODATA_EXPORT virtual void SetZones( const HYDROData_SequenceOfObjects& theZones );
90
91   /**
92    * Returns reference zone of region by index.
93    */
94   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZone( const int theIndex ) const;
95
96   /**
97    * Returns all reference zone of region.
98    */
99   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const;
100
101   /**
102    * Removes reference zone from region.
103    */
104   HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone );
105
106   /**
107    * Removes reference zone from region by it index.
108    */
109   HYDRODATA_EXPORT virtual void RemoveZone( const int theIndex );
110
111   /**
112    * Removes all reference zones from region.
113    */
114   HYDRODATA_EXPORT virtual void RemoveZones();
115
116
117 protected:
118
119   friend class HYDROData_Calculation;
120   friend class HYDROData_Iterator;
121
122   /**
123    * Creates new object in the internal data structure. Use higher level objects 
124    * to create objects with real content.
125    */
126   HYDROData_Region();
127
128   /**
129    * Destructs properties of the object and object itself, removes it from the document.
130    */
131   ~HYDROData_Region();
132 };
133
134 #endif