Salome HOME
83d75bbeab969b72f10f63a9f6982b7d3d580b40
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.h
1
2
3 #ifndef HYDROData_CalculationCase_HeaderFile
4 #define HYDROData_CalculationCase_HeaderFile
5
6 #include <HYDROData_Entity.h>
7
8 class TopoDS_Shell;
9
10 class Handle(HYDROData_Object);
11 class Handle(HYDROData_Region);
12 class Handle(HYDROData_Zone);
13 class Handle(HYDROData_PolylineXY);
14
15 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
16
17
18 /**\class HYDROData_CalculationCase
19  * \brief Calculation case is defined by selection of Geometry objects with or without \93Zone of water\94.
20  *
21  */
22 class HYDROData_CalculationCase : public HYDROData_Entity
23 {
24
25 protected:
26
27   /**
28    * Enumeration of tags corresponding to the persistent object parameters.
29    */
30   enum DataTag
31   {
32     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
33     DataTag_GeometryObject,   ///< reference geometry objects
34     DataTag_ChildRegion,      ///< child regions
35     DataTag_Region,           ///< reference regions
36     DataTag_Polyline          ///< reference boundary polyline
37   };
38
39 public:
40
41   DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
42
43   /**
44    * Returns the kind of this object. Must be redefined in all objects of known type.
45    */
46   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
47
48   /**
49    * Updates the name of this object.
50    * Reimplemented to update the names of regions and zones.
51    */
52   HYDRODATA_EXPORT virtual void SetName( const QString& theName );
53
54   /**
55    * Dump Calculation object to Python script representation.
56    */
57   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
58
59   /**
60    * Returns the list of all reference objects of this object.
61    */
62   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
63
64 public:      
65   // Public methods to work with Calculation
66
67   /**
68    * Split reference geometry objects to non-intersected regions.
69    */
70   HYDRODATA_EXPORT virtual void SplitGeometryObjects();
71
72
73   /**
74    * Add new one reference geometry object for calculation case.
75    */
76   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
77
78   /**
79    * Returns all reference geometry objects of calculation case.
80    */
81   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
82
83   /**
84    * Removes reference geometry object from calculation case.
85    */
86   HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
87
88   /**
89    * Removes all reference geometry objects from calculation case.
90    */
91   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
92
93
94   /**
95    * Sets reference boundary polyline object for calculation case.
96    */
97   HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
98
99   /**
100    * Returns reference boundary polyline object of calculation case.
101    */
102   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
103
104   /**
105    * Remove reference boundary polyline object from calculation case.
106    */
107   HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
108
109
110   /**
111    * Add new one child region for calculation case.
112    * The new region is added into the list of reference regions.
113    * The label of theZone is changed during this operation
114    * because of new region becomes the new parent for this zone.
115    */
116   HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
117
118
119   /**
120    * Add new one reference region for calculation case.
121    * The label of theRegion is changed in case if old parent is not this calculation.
122    */
123   HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
124
125   /**
126    * Returns all reference regions of calculation case.
127    */
128   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
129
130   /**
131    * Updates names of regions to correct order.
132    */
133   HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
134
135   /**
136    * Removes reference region from calculation case.
137    */
138   HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
139
140   /**
141    * Removes all reference regions from calculation case.
142    */
143   HYDRODATA_EXPORT virtual void RemoveRegions();
144
145   /**
146    * Returns shell containing faces which correspond to regions.
147    * \return shell as TopoDS_Shell
148    */
149   HYDRODATA_EXPORT virtual TopoDS_Shell GetShell();
150
151 private:
152
153   /**
154    * Add new one region for calculation case.
155    * The new region is added into the list of reference regions.
156    */
157   HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
158
159
160 protected:
161
162   friend class HYDROData_Iterator;
163
164   /**
165    * Creates new object in the internal data structure. Use higher level objects 
166    * to create objects with real content.
167    */
168   HYDRODATA_EXPORT HYDROData_CalculationCase();
169
170   /**
171    * Destructs properties of the object and object itself, removes it from the document.
172    */
173   HYDRODATA_EXPORT ~HYDROData_CalculationCase();
174 };
175
176 #endif