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);
17 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
20 /**\class HYDROData_CalculationCase
21 * \brief Calculation case is defined by selection of Geometry objects with or without
\93Zone of water
\94.
24 class HYDROData_CalculationCase : public HYDROData_Entity
28 enum PointClassification
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
38 * Enumeration of tags corresponding to the persistent object parameters.
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
51 DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
54 * Returns the kind of this object. Must be redefined in all objects of known type.
56 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_CALCULATION; }
59 * Updates the name of this object.
60 * Reimplemented to update the names of regions and zones.
62 HYDRODATA_EXPORT virtual void SetName( const QString& theName );
65 * Dump Calculation object to Python script representation.
67 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
70 * Update the calcualtion case object.
71 * Call this method whenever you made changes for object data.
73 HYDRODATA_EXPORT virtual void Update();
76 * Returns the list of all reference objects of this object.
78 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
81 // Public methods to work with Calculation
84 * Add new one reference geometry object for calculation case.
86 HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
89 * Returns all reference geometry objects of calculation case.
91 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
94 * Removes reference geometry object from calculation case.
96 HYDRODATA_EXPORT virtual void RemoveGeometryObject( const Handle(HYDROData_Object)& theObject );
99 * Removes all reference geometry objects from calculation case.
101 HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
105 * Sets reference boundary polyline object for calculation case.
107 HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
110 * Returns reference boundary polyline object of calculation case.
112 HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetBoundaryPolyline() const;
115 * Remove reference boundary polyline object from calculation case.
117 HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
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.
126 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) AddNewRegion( const Handle(HYDROData_Zone)& theZone );
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.
133 HYDRODATA_EXPORT virtual bool AddRegion( const Handle(HYDROData_Region)& theRegion );
136 * Returns all reference regions of calculation case.
138 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetRegions() const;
141 * Updates names of regions to correct order.
143 HYDRODATA_EXPORT virtual void UpdateRegionsOrder();
146 * Removes reference region from calculation case.
148 HYDRODATA_EXPORT virtual void RemoveRegion( const Handle(HYDROData_Region)& theRegion );
151 * Removes all reference regions from calculation case.
153 HYDRODATA_EXPORT virtual void RemoveRegions();
156 * Returns shell containing faces which correspond to regions.
157 * \return shell as TopoDS_Shell
159 HYDRODATA_EXPORT virtual TopoDS_Shell GetShell();
163 // Public methods to work with Calculation services
166 * Returns altitude for given point.
167 * \param thePoint the point to examine
168 * \return result altitude value
170 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
173 * Returns zone to which the point is belongs.
174 * \param thePoint the point to examine
175 * \return result zone
177 HYDRODATA_EXPORT virtual Handle(HYDROData_Zone) GetZoneFromPoint( const gp_XY& thePoint ) const;
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
185 HYDRODATA_EXPORT virtual PointClassification GetPointClassification(
186 const gp_XY& thePoint,
187 const Handle(HYDROData_Zone)& theZone ) const;
192 * Add new one region for calculation case.
193 * The new region is added into the list of reference regions.
195 HYDRODATA_EXPORT virtual Handle(HYDROData_Region) addNewRegion();
200 friend class HYDROData_Iterator;
203 * Creates new object in the internal data structure. Use higher level objects
204 * to create objects with real content.
206 HYDRODATA_EXPORT HYDROData_CalculationCase();
209 * Destructs properties of the object and object itself, removes it from the document.
211 HYDRODATA_EXPORT ~HYDROData_CalculationCase();