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);
18 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
21 /**\class HYDROData_CalculationCase
22 * \brief Calculation case is defined by selection of Geometry objects with or without
\93Zone of water
\94.
25 class HYDROData_CalculationCase : public HYDROData_Entity
29 enum PointClassification
31 POINT_OUT, ///< point is out of zone face
32 POINT_IN, ///< point is inside of zone face
33 POINT_ON ///< point is on the edge of zone face
39 * Enumeration of tags corresponding to the persistent object parameters.
43 DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
44 DataTag_GeometryObject, ///< reference geometry objects
45 DataTag_ChildRegion, ///< child regions
46 DataTag_Region, ///< reference regions
47 DataTag_Polyline, ///< reference boundary polyline
48 DataTag_GeometryGroup, ///< reference geometry groups
49 DataTag_SplittedGroups, ///< reference splitted groups
54 DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
57 * Returns the kind of this object. Must be redefined in all objects of known type.
59 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
62 * Updates the name of this object.
63 * Reimplemented to update the names of regions and zones.
65 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
68 * Dump Calculation object to Python script representation.
70 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
73 * Update the calcualtion case object.
74 * Call this method whenever you made changes for object data.
76 HYDRODATA_EXPORT virtual void Update();
79 * Returns the list of all reference objects of this object.
81 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
84 // Public methods to work with Calculation
87 * Add new one reference geometry object for calculation case.
89 HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
92 * Returns all reference geometry objects of calculation case.
94 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
97 * Removes reference geometry object from calculation case.
99 HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
102 * Removes all reference geometry objects from calculation case.
104 HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
108 * Add new one reference geometry group for calculation case.
110 HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
113 * Returns all reference geometry groups of calculation case.
115 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryGroups() const;
118 * Removes reference geometry group from calculation case.
120 HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
123 * Removes all reference geometry groups from calculation case.
125 HYDRODATA_EXPORT virtual void RemoveGeometryGroups();
129 * Sets reference boundary polyline object for calculation case.
131 HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
134 * Returns reference boundary polyline object of calculation case.
136 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
139 * Remove reference boundary polyline object from calculation case.
141 HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
145 * Add new one child region for calculation case.
146 * The new region is added into the list of reference regions.
147 * The label of theZone is changed during this operation
148 * because of new region becomes the new parent for this zone.
150 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
154 * Add new one reference region for calculation case.
155 * The label of theRegion is changed in case if old parent is not this calculation.
157 HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
160 * Returns all reference regions of calculation case.
162 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
165 * Updates names of regions to correct order.
167 HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
170 * Removes reference region from calculation case.
172 HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
175 * Removes all reference regions from calculation case.
177 HYDRODATA_EXPORT virtual void RemoveRegions();
180 * Returns shell containing faces which correspond to regions.
181 * \return shell as TopoDS_Shell
183 HYDRODATA_EXPORT virtual TopoDS_Shell GetShell();
187 // Public methods to work with Calculation services
190 * Returns altitude for given point.
191 * \param thePoint the point to examine
192 * \return result altitude value
194 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
197 * Returns zone to which the point is belongs.
198 * \param thePoint the point to examine
199 * \return result zone
201 HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZoneFromPoint( const gp_XY& thePoint ) const;
204 * Returns classification of point for given zone.
205 * \param thePoint the point to examine
206 * \param theZone the zone to examine
207 * \return result classification
209 HYDRODATA_EXPORT virtual PointClassification GetPointClassification(
210 const gp_XY& thePoint,
211 const Handle(HYDROData_Zone)& theZone ) const;
216 * Add new one region for calculation case.
217 * The new region is added into the list of reference regions.
219 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
224 friend class HYDROData_Iterator;
227 * Creates new object in the internal data structure. Use higher level objects
228 * to create objects with real content.
230 HYDRODATA_EXPORT HYDROData_CalculationCase();
233 * Destructs properties of the object and object itself, removes it from the document.
235 HYDRODATA_EXPORT ~HYDROData_CalculationCase();