1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include <HYDROData_CalculationCase.h>
27 class HYDROData_CalculationCase : HYDROData_Entity
31 #include <HYDROData_CalculationCase.h>
34 %ConvertToSubClassCode
35 switch ( sipCpp->GetKind() )
37 case KIND_CALCULATION:
38 sipClass = sipClass_HYDROData_CalculationCase;
42 // We don't recognise the type.
49 enum PointClassification
51 POINT_OUT, ///< point is out of zone face
52 POINT_IN, ///< point is inside of zone face
53 POINT_ON ///< point is on the edge of zone face
58 * Add new one reference geometry object for calculation case.
60 bool AddGeometryObject( HYDROData_Object theObject ) [bool ( const Handle_HYDROData_Object& )];
62 Handle(HYDROData_Object) aRef =
63 Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
66 Py_BEGIN_ALLOW_THREADS
67 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddGeometryObject( aRef ):
68 sipCpp->AddGeometryObject( aRef );
74 * Returns all reference geometry objects of calculation case.
76 HYDROData_SequenceOfObjects GetGeometryObjects() const;
79 * Removes reference geometry object from calculation case.
81 void RemoveGeometryObject( HYDROData_Object theObject ) [void ( const Handle_HYDROData_Object& )];
83 Handle(HYDROData_Object) aRef =
84 Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
87 Py_BEGIN_ALLOW_THREADS
88 if ( sipSelfWasArg ) {
89 sipCpp->HYDROData_CalculationCase::RemoveGeometryObject( aRef );
91 sipCpp->RemoveGeometryObject( aRef );
98 * Removes all reference geometry objects from calculation case.
100 void RemoveGeometryObjects();
104 * Add new one reference geometry group for calculation case.
106 bool AddGeometryGroup( HYDROData_ShapesGroup theGroup ) [bool ( const Handle_HYDROData_ShapesGroup& )];
108 Handle(HYDROData_ShapesGroup) aRef =
109 Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) );
110 if ( !aRef.IsNull() )
112 Py_BEGIN_ALLOW_THREADS
113 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddGeometryGroup( aRef ):
114 sipCpp->AddGeometryGroup( aRef );
120 * Returns all reference geometry groups of calculation case.
122 HYDROData_SequenceOfObjects GetGeometryGroups() const;
125 * Removes reference geometry group from calculation case.
127 void RemoveGeometryGroup( HYDROData_ShapesGroup theGroup ) [void ( const Handle_HYDROData_ShapesGroup& )];
129 Handle(HYDROData_ShapesGroup) aRef =
130 Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) );
131 if ( !aRef.IsNull() )
133 Py_BEGIN_ALLOW_THREADS
134 if ( sipSelfWasArg ) {
135 sipCpp->HYDROData_CalculationCase::RemoveGeometryGroup( aRef );
137 sipCpp->RemoveGeometryGroup( aRef );
144 * Removes all reference geometry groups from calculation case.
146 void RemoveGeometryGroups();
150 * Sets reference boundary polyline object for calculation case.
152 void SetBoundaryPolyline( HYDROData_PolylineXY thePolyline ) [void ( const Handle_HYDROData_PolylineXY& )];
154 Handle(HYDROData_PolylineXY) aRef =
155 Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
156 if ( !aRef.IsNull() )
158 Py_BEGIN_ALLOW_THREADS
159 if ( sipSelfWasArg ) {
160 sipCpp->HYDROData_CalculationCase::SetBoundaryPolyline( aRef );
162 sipCpp->SetBoundaryPolyline( aRef );
169 * Returns reference boundary polyline object of calculation case.
171 HYDROData_PolylineXY GetBoundaryPolyline() const [Handle_HYDROData_PolylineXY ()];
173 Handle(HYDROData_PolylineXY) aRef;
175 Py_BEGIN_ALLOW_THREADS
176 aRef = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetBoundaryPolyline() :
177 sipCpp->GetBoundaryPolyline();
180 sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
184 * Remove reference boundary polyline object from calculation case.
186 void RemoveBoundaryPolyline();
190 * Add new one child region for calculation case.
191 * The new region is added into the list of reference regions.
192 * The label of theZone is changed during this operation
193 * because of new region becomes the new parent for this zone.
195 HYDROData_Region AddNewRegion( HYDROData_Zone theZone ) [Handle_HYDROData_Region ( const Handle_HYDROData_Zone& )];
197 Handle(HYDROData_Zone) aRef =
198 Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) );
199 Handle(HYDROData_Region) aRes;
201 if ( !aRef.IsNull() )
203 Py_BEGIN_ALLOW_THREADS
204 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddNewRegion( aRef ) :
205 sipCpp->AddNewRegion( aRef );
209 sipRes = (HYDROData_Region*)createPointer( aRes );
213 * Add new one reference region for calculation case.
214 * The label of theRegion is changed in case if old parent is not this calculation.
216 bool AddRegion( HYDROData_Region theRegion ) [bool ( const Handle_HYDROData_Region& )];
218 Handle(HYDROData_Region) aRef =
219 Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
220 if ( !aRef.IsNull() )
222 Py_BEGIN_ALLOW_THREADS
223 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddRegion( aRef ):
224 sipCpp->AddRegion( aRef );
230 * Returns all reference regions of calculation case.
232 HYDROData_SequenceOfObjects GetRegions() const;
235 * Updates names of regions to correct order.
237 void UpdateRegionsOrder();
240 * Removes reference region from calculation case.
242 void RemoveRegion( HYDROData_Region theRegion ) [void ( const Handle_HYDROData_Region& )];
244 Handle(HYDROData_Region) aRef =
245 Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
246 if ( !aRef.IsNull() )
248 Py_BEGIN_ALLOW_THREADS
249 if ( sipSelfWasArg ) {
250 sipCpp->HYDROData_CalculationCase::RemoveRegion( aRef );
252 sipCpp->RemoveRegion( aRef );
259 * Removes all reference regions from calculation case.
261 void RemoveRegions();
265 * Returns all reference geometry groups of calculation case.
267 HYDROData_SequenceOfObjects GetSplittedGroups() const;
270 * Removes all reference geometry groups from calculation case.
272 void RemoveSplittedGroups();
276 * Exports the calculation case data (shell and groups) to GEOM module.
277 * \param theGeomEngine GEOM module engine
278 * \param theStudy SALOMEDS study, is used for publishing of GEOM objects
279 * \return true in case of success
281 //TODO: virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine,
282 // SALOMEDS::Study_ptr theStudy );
285 // Public methods to work with Calculation services
288 * Returns altitude for given point.
289 * \param thePoint the point to examine
290 * \return result altitude value
292 double GetAltitudeForPoint( const gp_XY& thePoint ) const;
295 * Returns zone to which the point is belongs.
296 * \param thePoint the point to examine
297 * \return result zone
299 HYDROData_Zone GetZoneFromPoint( const gp_XY& thePoint ) const [Handle_HYDROData_Zone ( const gp_XY& )];
301 Handle(HYDROData_Zone) aRes;
303 Py_BEGIN_ALLOW_THREADS
304 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetZoneFromPoint( *a0 ) :
305 sipCpp->GetZoneFromPoint( *a0 );
308 sipRes = (HYDROData_Zone*)createPointer( aRes );
312 * Returns classification of point for given zone.
313 * \param thePoint the point to examine
314 * \param theZone the zone to examine
315 * \return result classification
317 PointClassification GetPointClassification(
318 const gp_XY& thePoint,
319 HYDROData_Zone theZone ) const
320 [PointClassification ( const gp_XY&, const Handle_HYDROData_Zone& )];
323 Handle(HYDROData_Zone) aRef =
324 Handle(HYDROData_Zone)::DownCast( createHandle( a1 ) );
326 if ( !aRef.IsNull() )
328 Py_BEGIN_ALLOW_THREADS
329 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetPointClassification( *a0, aRef ) :
330 sipCpp->GetPointClassification( *a0, aRef );
338 * Creates new object in the internal data structure. Use higher level objects
339 * to create objects with real content.
341 HYDROData_CalculationCase();
344 * Destructs properties of the object and object itself, removes it from the document.
346 ~HYDROData_CalculationCase();