Salome HOME
Update names of regions in calculation case if its order has been changed (Bug #47).
[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_ChildZone,    ///< child zones
27     DataTag_Zone,         ///< reference zones
28   };
29
30 public:
31   DEFINE_STANDARD_RTTI(HYDROData_Region);
32
33   /**
34    * Returns the kind of this object. Must be redefined in all objects of known type.
35    */
36   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; }
37
38   /**
39    * Dump object to Python script representation.
40    */
41   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
42
43
44   /**
45    * Removes object and it child sub-objects from the data structure.
46    * Reimplemented to update names of regions in father calculation.
47    */
48   HYDRODATA_EXPORT virtual void Remove();
49
50
51   /**
52    * Add new one reference zone for region.
53    * The label of theZone is changed in case if old parent is not this region.
54    */
55   HYDRODATA_EXPORT virtual bool AddZone( const Handle(HYDROData_Zone)& theZone );
56
57   /**
58    * Returns all reference zone of region.
59    */
60   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const;
61
62   /**
63    * Removes reference zone from region.
64    */
65   HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone );
66
67   /**
68    * Removes all reference zones from region.
69    */
70   HYDRODATA_EXPORT virtual void RemoveZones();
71
72
73 protected:
74
75   /**
76    * Create new one reference zone for region on child label.
77    * The new zone is added into the list of reference zones.
78    */
79   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) addNewZone();
80
81 protected:
82
83   friend class HYDROData_CalculationCase;
84   friend class HYDROData_Iterator;
85
86   /**
87    * Creates new object in the internal data structure. Use higher level objects 
88    * to create objects with real content.
89    */
90   HYDROData_Region();
91
92   /**
93    * Destructs properties of the object and object itself, removes it from the document.
94    */
95   ~HYDROData_Region();
96 };
97
98 #endif