Salome HOME
patch for correct compilation on Linux
[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 TopoDS_Shape;
13
14 /**\class HYDROData_Region
15  * \brief Regions are groups (lists) of zones, they can include one or several zones.
16  */
17 class HYDROData_Region : public HYDROData_Entity
18 {
19
20 protected:
21
22   /**
23    * Enumeration of tags corresponding to the persistent object parameters.
24    */
25   enum DataTag
26   {
27     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
28     DataTag_ChildZone,    ///< child zones
29     DataTag_Zone,         ///< reference zones
30   };
31
32 public:
33   DEFINE_STANDARD_RTTI(HYDROData_Region);
34
35   /**
36    * Returns the kind of this object. Must be redefined in all objects of known type.
37    */
38   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_REGION; }
39
40   /**
41    * Dump object to Python script representation.
42    */
43   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
44
45
46   /**
47    * Returns flag indicating that object is updateble or not.
48    */
49   HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
50
51
52   /**
53    * Removes object and it child sub-objects from the data structure.
54    * Reimplemented to update names of regions in father calculation.
55    */
56   HYDRODATA_EXPORT virtual void Remove();
57
58   /**
59    * Returns flag indicating that object can be removed or not.
60    */
61   HYDRODATA_EXPORT virtual bool CanRemove();
62
63   /**
64    * Returns the list of all reference objects of this object.
65    */
66   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
67
68
69   /**
70    * Add new one reference zone for region.
71    * The label of theZone is changed in case if old parent is not this region.
72    */
73   HYDRODATA_EXPORT virtual bool AddZone( const Handle(HYDROData_Zone)& theZone );
74
75   /**
76    * Returns all reference zone of region.
77    */
78   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetZones() const;
79
80   /**
81    * Removes reference zone from region.
82    */
83   HYDRODATA_EXPORT virtual void RemoveZone( const Handle(HYDROData_Zone)& theZone );
84
85   /**
86    * Removes all reference zones from region.
87    */
88   HYDRODATA_EXPORT virtual void RemoveZones();
89
90   /**
91    * \brief Returns the shape of the region.
92    * Shape of the region could be:
93    * - a face which is the union of the region zones faces
94    * - a shell if the zones faces can't be united into one face
95    * \return shape as TopoDS_Shape
96    */
97   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
98
99 protected:
100
101   /**
102    * Create new one reference zone for region on child label.
103    * The new zone is added into the list of reference zones.
104    */
105   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) addNewZone();
106
107 protected:
108
109   friend class HYDROData_CalculationCase;
110   friend class HYDROData_Iterator;
111
112   /**
113    * Creates new object in the internal data structure. Use higher level objects 
114    * to create objects with real content.
115    */
116   HYDRODATA_EXPORT HYDROData_Region();
117
118   /**
119    * Destructs properties of the object and object itself, removes it from the document.
120    */
121   HYDRODATA_EXPORT ~HYDROData_Region();
122 };
123
124 #endif