3 #ifndef HYDROData_CalculationCase_HeaderFile
4 #define HYDROData_CalculationCase_HeaderFile
6 #include <HYDROData_Entity.h>
12 class Handle(HYDROData_Object);
13 class Handle(HYDROData_Region);
14 class Handle(HYDROData_Zone);
15 class Handle(HYDROData_PolylineXY);
16 class Handle(HYDROData_EdgesGroup);
17 class Handle(HYDROData_SplittedEdgesGroup);
19 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
22 /**\class HYDROData_CalculationCase
23 * \brief Calculation case is defined by selection of Geometry objects with or without
\93Zone of water
\94.
26 class HYDROData_CalculationCase : public HYDROData_Entity
30 enum PointClassification
32 POINT_OUT, ///< point is out of zone face
33 POINT_IN, ///< point is inside of zone face
34 POINT_ON ///< point is on the edge of zone face
40 * Enumeration of tags corresponding to the persistent object parameters.
44 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
45 DataTag_GeometryObject, ///< reference geometry objects
46 DataTag_ChildRegion, ///< child regions
47 DataTag_Region, ///< reference regions
48 DataTag_Polyline, ///< reference boundary polyline
49 DataTag_GeometryGroup, ///< reference geometry groups
50 DataTag_SplittedGroups, ///< reference splitted groups
55 DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
58 * Returns the kind of this object. Must be redefined in all objects of known type.
60 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
63 * Updates the name of this object.
64 * Reimplemented to update the names of regions and zones.
66 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
69 * Dump Calculation object to Python script representation.
71 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
74 * Update the calcualtion case object.
75 * Call this method whenever you made changes for object data.
77 HYDRODATA_EXPORT virtual void Update();
80 * Returns the list of all reference objects of this object.
82 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
85 // Public methods to work with Calculation
88 * Add new one reference geometry object for calculation case.
90 HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
93 * Returns all reference geometry objects of calculation case.
95 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
98 * Removes reference geometry object from calculation case.
100 HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
103 * Removes all reference geometry objects from calculation case.
105 HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
109 * Add new one reference geometry group for calculation case.
111 HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
114 * Returns all reference geometry groups of calculation case.
116 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryGroups() const;
119 * Removes reference geometry group from calculation case.
121 HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
124 * Removes all reference geometry groups from calculation case.
126 HYDRODATA_EXPORT virtual void RemoveGeometryGroups();
130 * Sets reference boundary polyline object for calculation case.
132 HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
135 * Returns reference boundary polyline object of calculation case.
137 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
140 * Remove reference boundary polyline object from calculation case.
142 HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
146 * Add new one child region for calculation case.
147 * The new region is added into the list of reference regions.
148 * The label of theZone is changed during this operation
149 * because of new region becomes the new parent for this zone.
151 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
155 * Add new one reference region for calculation case.
156 * The label of theRegion is changed in case if old parent is not this calculation.
158 HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
161 * Returns all reference regions of calculation case.
163 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
166 * Updates names of regions to correct order.
168 HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
171 * Removes reference region from calculation case.
173 HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
176 * Removes all reference regions from calculation case.
178 HYDRODATA_EXPORT virtual void RemoveRegions();
182 * Returns all reference geometry groups of calculation case.
184 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetSplittedGroups() const;
187 * Removes all reference geometry groups from calculation case.
189 HYDRODATA_EXPORT virtual void RemoveSplittedGroups();
193 * Returns shell containing faces which correspond to regions.
194 * \return shell as TopoDS_Shell
196 HYDRODATA_EXPORT virtual TopoDS_Shell GetShell();
200 // Public methods to work with Calculation services
203 * Returns altitude for given point.
204 * \param thePoint the point to examine
205 * \return result altitude value
207 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
210 * Returns zone to which the point is belongs.
211 * \param thePoint the point to examine
212 * \return result zone
214 HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZoneFromPoint( const gp_XY& thePoint ) const;
217 * Returns classification of point for given zone.
218 * \param thePoint the point to examine
219 * \param theZone the zone to examine
220 * \return result classification
222 HYDRODATA_EXPORT virtual PointClassification GetPointClassification(
223 const gp_XY& thePoint,
224 const Handle(HYDROData_Zone)& theZone ) const;
229 * Add new one region for calculation case.
230 * The new region is added into the list of reference regions.
232 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
235 * Add new one splitted edges group for calculation case.
237 HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedEdgesGroup) addNewSplittedGroup();
241 friend class HYDROData_Iterator;
244 * Creates new object in the internal data structure. Use higher level objects
245 * to create objects with real content.
247 HYDRODATA_EXPORT HYDROData_CalculationCase();
250 * Destructs properties of the object and object itself, removes it from the document.
252 HYDRODATA_EXPORT ~HYDROData_CalculationCase();