Salome HOME
Comments moved.
[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 gp_XY;
9
10 class TopoDS_Shell;
11
12 class Handle(HYDROData_Object);
13 class Handle(HYDROData_Region);
14 class Handle(HYDROData_Zone);
15 class Handle(HYDROData_PolylineXY);
16
17 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
18
19
20 /**\class HYDROData_CalculationCase
21  * \brief Calculation case is defined by selection of Geometry objects with or without \93Zone of water\94.
22  *
23  */
24 class HYDROData_CalculationCase : public HYDROData_Entity
25 {
26 public:
27
28   enum PointClassification
29   {
30     POINT_OUT,  ///< point is out of zone face
31     POINT_IN,   ///< point is inside of zone face
32     POINT_ON    ///< point is on the edge of zone face
33   };
34
35 protected:
36
37   /**
38    * Enumeration of tags corresponding to the persistent object parameters.
39    */
40   enum DataTag
41   {
42     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
43     DataTag_GeometryObject,   ///< reference geometry objects
44     DataTag_ChildRegion,      ///< child regions
45     DataTag_Region,           ///< reference regions
46     DataTag_Polyline          ///< reference boundary polyline
47   };
48
49 public:
50
51   DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
52
53   /**
54    * Returns the kind of this object. Must be redefined in all objects of known type.
55    */
56   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
57
58   /**
59    * Updates the name of this object.
60    * Reimplemented to update the names of regions and zones.
61    */
62   HYDRODATA_EXPORT virtual void SetName( const QString& theName );
63
64   /**
65    * Dump Calculation object to Python script representation.
66    */
67   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
68
69   /**
70    * Update the calcualtion case object.
71    * Call this method whenever you made changes for object data.
72    */
73   HYDRODATA_EXPORT virtual void Update();
74
75   /**
76    * Returns the list of all reference objects of this object.
77    */
78   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
79
80 public:      
81   // Public methods to work with Calculation
82
83   /**
84    * Add new one reference geometry object for calculation case.
85    */
86   HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
87
88   /**
89    * Returns all reference geometry objects of calculation case.
90    */
91   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
92
93   /**
94    * Removes reference geometry object from calculation case.
95    */
96   HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
97
98   /**
99    * Removes all reference geometry objects from calculation case.
100    */
101   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
102
103
104   /**
105    * Sets reference boundary polyline object for calculation case.
106    */
107   HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
108
109   /**
110    * Returns reference boundary polyline object of calculation case.
111    */
112   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
113
114   /**
115    * Remove reference boundary polyline object from calculation case.
116    */
117   HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
118
119
120   /**
121    * Add new one child region for calculation case.
122    * The new region is added into the list of reference regions.
123    * The label of theZone is changed during this operation
124    * because of new region becomes the new parent for this zone.
125    */
126   HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
127
128
129   /**
130    * Add new one reference region for calculation case.
131    * The label of theRegion is changed in case if old parent is not this calculation.
132    */
133   HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
134
135   /**
136    * Returns all reference regions of calculation case.
137    */
138   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
139
140   /**
141    * Updates names of regions to correct order.
142    */
143   HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
144
145   /**
146    * Removes reference region from calculation case.
147    */
148   HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
149
150   /**
151    * Removes all reference regions from calculation case.
152    */
153   HYDRODATA_EXPORT virtual void RemoveRegions();
154
155   /**
156    * Returns shell containing faces which correspond to regions.
157    * \return shell as TopoDS_Shell
158    */
159   HYDRODATA_EXPORT virtual TopoDS_Shell GetShell();
160
161
162 public:      
163   // Public methods to work with Calculation services
164
165   /**
166    * Returns altitude for given point.
167    * \param thePoint the point to examine
168    * \return result altitude value
169    */
170   HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
171
172   /**
173    * Returns zone to which the point is belongs.
174    * \param thePoint the point to examine
175    * \return result zone
176    */
177   HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZoneFromPoint( const gp_XY& thePoint ) const;
178
179   /**
180    * Returns classification of point for given zone.
181    * \param thePoint the point to examine
182    * \param theZone the zone to examine
183    * \return result classification
184    */
185   HYDRODATA_EXPORT virtual PointClassification GetPointClassification(
186     const gp_XY&                  thePoint,
187     const Handle(HYDROData_Zone)& theZone ) const;
188
189 private:
190
191   /**
192    * Add new one region for calculation case.
193    * The new region is added into the list of reference regions.
194    */
195   HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
196
197
198 protected:
199
200   friend class HYDROData_Iterator;
201
202   /**
203    * Creates new object in the internal data structure. Use higher level objects 
204    * to create objects with real content.
205    */
206   HYDRODATA_EXPORT HYDROData_CalculationCase();
207
208   /**
209    * Destructs properties of the object and object itself, removes it from the document.
210    */
211   HYDRODATA_EXPORT ~HYDROData_CalculationCase();
212 };
213
214 #endif