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 : public 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 double theCoordX,
293 const double theCoordY ) const [double ( const gp_XY& )];
295 gp_XY aPnt( a0, a1 );
297 Py_BEGIN_ALLOW_THREADS
298 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudeForPoint( aPnt ) :
299 sipCpp->GetAltitudeForPoint( aPnt );
304 * Returns altitude for given point on given region.
305 * \param thePoint the point to examine
306 * \param theRegion reference region to check
307 * \return result altitude value
309 double GetAltitudeForPoint( const double theCoordX,
310 const double theCoordY,
311 HYDROData_Region theRegion ) const
312 [double ( const gp_XY&, const Handle_HYDROData_Region& )];
314 gp_XY aPnt( a0, a1 );
315 Handle(HYDROData_Region) aRefRegion =
316 Handle(HYDROData_Region)::DownCast( createHandle( a2 ) );
318 Py_BEGIN_ALLOW_THREADS
319 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudeForPoint( aPnt, aRefRegion ) :
320 sipCpp->GetAltitudeForPoint( aPnt, aRefRegion );
325 * Returns altitude for given point on given zone.
326 * \param thePoint the point to examine
327 * \param theZone reference zone to check
328 * \return result altitude value
330 double GetAltitudeForPoint( const double theCoordX,
331 const double theCoordY,
332 HYDROData_Zone theZone ) const
333 [double ( const gp_XY&, const Handle_HYDROData_Zone& )];
335 gp_XY aPnt( a0, a1 );
336 Handle(HYDROData_Zone) aRefZone =
337 Handle(HYDROData_Zone)::DownCast( createHandle( a2 ) );
339 Py_BEGIN_ALLOW_THREADS
340 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudeForPoint( aPnt, aRefZone ) :
341 sipCpp->GetAltitudeForPoint( aPnt, aRefZone );
346 * Returns altitudes for given points on given region.
347 * \param thePoints the points to examine
348 * \param theZone reference region to check
349 * \return result altitude value
351 NCollection_Sequence<double> GetAltitudesForPoints( const NCollection_Sequence<double>& theCoordsX,
352 const NCollection_Sequence<double>& theCoordsY,
353 HYDROData_Region theRegion ) const
354 [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, const Handle_HYDROData_Region& )];
357 NCollection_Sequence<gp_XY> aPnts;
359 int aLen = qMin( a0->Length(), a1->Length() );
360 for ( int i = 1; i <= aLen; ++i )
362 gp_XY aPnt( a0->Value( i ), a1->Value( i ) );
363 aPnts.Append( aPnt );
366 Handle(HYDROData_Region) aRefRegion =
367 Handle(HYDROData_Region)::DownCast( createHandle( a2 ) );
369 NCollection_Sequence<double> aRes;
370 Py_BEGIN_ALLOW_THREADS
371 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudesForPoints( aPnts, aRefRegion ) :
372 sipCpp->GetAltitudesForPoints( aPnts, aRefRegion );
375 sipRes = new NCollection_Sequence<double>( aRes );
379 * Returns altitudes for given points on given zone.
380 * \param thePoints the points to examine
381 * \param theZone reference zone to check
382 * \return result altitude value
384 NCollection_Sequence<double> GetAltitudesForPoints( const NCollection_Sequence<double>& theCoordsX,
385 const NCollection_Sequence<double>& theCoordsY,
386 HYDROData_Zone theZone ) const
387 [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, const Handle_HYDROData_Zone& )];
390 NCollection_Sequence<gp_XY> aPnts;
392 int aLen = qMin( a0->Length(), a1->Length() );
393 for ( int i = 1; i <= aLen; ++i )
395 gp_XY aPnt( a0->Value( i ), a1->Value( i ) );
396 aPnts.Append( aPnt );
399 Handle(HYDROData_Zone) aRefZone =
400 Handle(HYDROData_Zone)::DownCast( createHandle( a2 ) );
402 NCollection_Sequence<double> aRes;
403 Py_BEGIN_ALLOW_THREADS
404 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudesForPoints( aPnts, aRefZone ) :
405 sipCpp->GetAltitudesForPoints( aPnts, aRefZone );
408 sipRes = new NCollection_Sequence<double>( aRes );
412 * Returns region to which the point is belongs.
413 * \param thePoint the point to examine
414 * \return result region
416 HYDROData_Region GetRegionFromPoint( const double theCoordX,
417 const double theCoordY ) const
418 [Handle_HYDROData_Region ( const gp_XY& )];
420 Handle(HYDROData_Region) aRes;
422 gp_XY aPnt( a0, a1 );
424 Py_BEGIN_ALLOW_THREADS
425 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetRegionFromPoint( aPnt ) :
426 sipCpp->GetRegionFromPoint( aPnt );
429 sipRes = (HYDROData_Region*)createPointer( aRes );
433 * Returns zone to which the point is belongs.
434 * \param thePoint the point to examine
435 * \return result zone
437 HYDROData_Zone GetZoneFromPoint( const double theCoordX,
438 const double theCoordY ) const
439 [Handle_HYDROData_Zone ( const gp_XY& )];
441 Handle(HYDROData_Zone) aRes;
443 gp_XY aPnt( a0, a1 );
445 Py_BEGIN_ALLOW_THREADS
446 aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetZoneFromPoint( aPnt ) :
447 sipCpp->GetZoneFromPoint( aPnt );
450 sipRes = (HYDROData_Zone*)createPointer( aRes );
454 * Returns classification of point for given zone.
455 * \param thePoint the point to examine
456 * \param theZone the zone to examine
457 * \return result classification
459 PointClassification GetPointClassification( const double theCoordX,
460 const double theCoordY,
461 HYDROData_Zone theZone ) const
462 [PointClassification ( const gp_XY&, const Handle_HYDROData_Zone& )];
464 gp_XY aPnt( a0, a1 );
466 Handle(HYDROData_Zone) aRef =
467 Handle(HYDROData_Zone)::DownCast( createHandle( a2 ) );
469 Py_BEGIN_ALLOW_THREADS
470 sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetPointClassification( aPnt, aRef ) :
471 sipCpp->GetPointClassification( aPnt, aRef );
478 * Creates new object in the internal data structure. Use higher level objects
479 * to create objects with real content.
481 HYDROData_CalculationCase();
484 * Destructs properties of the object and object itself, removes it from the document.
486 ~HYDROData_CalculationCase();