3 #ifndef HYDROData_CalculationCase_HeaderFile
4 #define HYDROData_CalculationCase_HeaderFile
6 #include <HYDROData_ShapesGroup.h>
9 #include <SALOMEconfig.h>
10 #include CORBA_SERVER_HEADER(GEOM_Gen)
16 class TopTools_ListOfShape;
18 class Handle(HYDROData_Object);
19 class Handle(HYDROData_Region);
20 class Handle(HYDROData_Zone);
21 class Handle(HYDROData_PolylineXY);
22 class Handle(HYDROData_ShapesGroup);
23 class Handle(HYDROData_SplittedShapesGroup);
25 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
28 /**\class HYDROData_CalculationCase
29 * \brief Calculation case is defined by selection of Geometry objects with or without
\93Zone of water
\94.
32 class HYDROData_CalculationCase : public HYDROData_Entity
36 enum PointClassification
38 POINT_OUT, ///< point is out of zone face
39 POINT_IN, ///< point is inside of zone face
40 POINT_ON ///< point is on the edge of zone face
46 * Enumeration of tags corresponding to the persistent object parameters.
50 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
51 DataTag_GeometryObject, ///< reference geometry objects
52 DataTag_ChildRegion, ///< child regions
53 DataTag_Region, ///< reference regions
54 DataTag_Polyline, ///< reference boundary polyline
55 DataTag_GeometryGroup, ///< reference geometry groups
56 DataTag_SplittedGroups, ///< reference splitted groups
61 DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
64 * Returns the kind of this object. Must be redefined in all objects of known type.
66 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
69 * Updates the name of this object.
70 * Reimplemented to update the names of regions, zones and splitted groups.
72 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
75 * Dump Calculation object to Python script representation.
77 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
80 * Update the calcualtion case object.
81 * Call this method whenever you made changes for object data.
83 HYDRODATA_EXPORT virtual void Update();
86 * Returns the list of all reference objects of this object.
88 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
91 // Public methods to work with Calculation
94 * Add new one reference geometry object for calculation case.
96 HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
99 * Returns all reference geometry objects of calculation case.
101 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
104 * Removes reference geometry object from calculation case.
106 HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
109 * Removes all reference geometry objects from calculation case.
111 HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
115 * Add new one reference geometry group for calculation case.
117 HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup );
120 * Returns all reference geometry groups of calculation case.
122 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryGroups() const;
125 * Removes reference geometry group from calculation case.
127 HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup );
130 * Removes all reference geometry groups from calculation case.
132 HYDRODATA_EXPORT virtual void RemoveGeometryGroups();
136 * Sets reference boundary polyline object for calculation case.
138 HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
141 * Returns reference boundary polyline object of calculation case.
143 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
146 * Remove reference boundary polyline object from calculation case.
148 HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
152 * Add new one child region for calculation case.
153 * The new region is added into the list of reference regions.
154 * The label of theZone is changed during this operation
155 * because of new region becomes the new parent for this zone.
157 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
161 * Add new one reference region for calculation case.
162 * The label of theRegion is changed in case if old parent is not this calculation.
164 HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
167 * Returns all reference regions of calculation case.
169 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
172 * Updates names of regions to correct order.
174 HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
177 * Removes reference region from calculation case.
179 HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
182 * Removes all reference regions from calculation case.
184 HYDRODATA_EXPORT virtual void RemoveRegions();
188 * Returns all reference geometry groups of calculation case.
190 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetSplittedGroups() const;
193 * Removes all reference geometry groups from calculation case.
195 HYDRODATA_EXPORT virtual void RemoveSplittedGroups();
199 * Exports the calculation case data (shell and groups) to GEOM module.
200 * \param theGeomEngine GEOM module engine
201 * \param theStudy SALOMEDS study, is used for publishing of GEOM objects
202 * \return true in case of success
204 HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine,
205 SALOMEDS::Study_ptr theStudy ) const;
208 // Public methods to work with Calculation services
211 * Returns altitude for given point.
212 * \param thePoint the point to examine
213 * \return result altitude value
215 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
218 * Returns altitude for given point on given zone.
219 * \param thePoint the point to examine
220 * \param theZone reference zone to check
221 * \return result altitude value
223 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint,
224 const Handle(HYDROData_Zone)& theZone ) const;
227 * Returns altitudes for given points on given zone.
228 * \param thePoints the points to examine
229 * \param theZone reference zone to check
230 * \return result altitude value
232 HYDRODATA_EXPORT virtual NCollection_Sequence<double> GetAltitudesForPoints(
233 const NCollection_Sequence<gp_XY>& thePoints,
234 const Handle(HYDROData_Zone)& theZone ) const;
237 * Returns zone to which the point is belongs.
238 * \param thePoint the point to examine
239 * \return result zone
241 HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZoneFromPoint( const gp_XY& thePoint ) const;
244 * Returns classification of point for given zone.
245 * \param thePoint the point to examine
246 * \param theZone the zone to examine
247 * \return result classification
249 HYDRODATA_EXPORT virtual PointClassification GetPointClassification(
250 const gp_XY& thePoint,
251 const Handle(HYDROData_Zone)& theZone ) const;
256 * Add new one region for calculation case.
257 * The new region is added into the list of reference regions.
259 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
262 * Add new one splitted edges group for calculation case.
264 HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedShapesGroup) addNewSplittedGroup();
267 * Exports the given faces as shell and the given groups to GEOM module.
268 * \param theGeomEngine GEOM module engine
269 * \param theStudy SALOMEDS study, is used for publishing of GEOM objects
270 * \param theFaces the list of faces to make shell
271 * \param theSplittedGroups the list of groups
272 * \return true in case of success
274 HYDRODATA_EXPORT bool Export( GEOM::GEOM_Gen_var theGeomEngine,
275 SALOMEDS::Study_ptr theStudy,
276 const TopTools_ListOfShape& theFaces,
277 const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs ) const;
280 * Publish the given shape in GEOM as a GEOM object.
281 * \param theGeomEngine GEOM module engine
282 * \param theStudy SALOMEDS study, used for publishing of the shape
283 * \param theShape the shape to publish as a GEOM object
284 * \param theName the name of the published object
285 * \return the published GEOM object
287 GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
288 SALOMEDS::Study_ptr theStudy,
289 const TopoDS_Shape& theShape,
290 const QString& theName ) const;
294 friend class HYDROData_Iterator;
297 * Creates new object in the internal data structure. Use higher level objects
298 * to create objects with real content.
300 HYDRODATA_EXPORT HYDROData_CalculationCase();
303 * Destructs properties of the object and object itself, removes it from the document.
305 HYDRODATA_EXPORT ~HYDROData_CalculationCase();