2 #include "HYDROData_CalculationCase.h"
4 #include "HYDROData_ArtificialObject.h"
5 #include "HYDROData_Bathymetry.h"
6 #include "HYDROData_Document.h"
7 #include "HYDROData_EdgesGroup.h"
8 #include "HYDROData_Iterator.h"
9 #include "HYDROData_NaturalObject.h"
10 #include "HYDROData_PolylineXY.h"
11 #include "HYDROData_SplitToZonesTool.h"
12 #include "HYDROData_SplittedEdgesGroup.h"
13 #include "HYDROData_Region.h"
14 #include "HYDROData_Tool.h"
15 #include "HYDROData_Zone.h"
18 #include <TopoDS_Shell.hxx>
19 #include <TopoDS_Edge.hxx>
21 #include <BRep_Builder.hxx>
22 #include <BRepBuilderAPI_Sewing.hxx>
23 #include <BRepTopAdaptor_FClass2d.hxx>
26 #include <TopExp_Explorer.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <TopTools_ListIteratorOfListOfShape.hxx>
32 #define CALCULATION_REGIONS_PREF GetName() + "_Reg"
33 #define CALCULATION_ZONES_PREF GetName() + "_Zone"
35 #define PYTHON_CALCULATION_ID "KIND_CALCULATION"
37 IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
38 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
40 HYDROData_CalculationCase::HYDROData_CalculationCase()
45 HYDROData_CalculationCase::~HYDROData_CalculationCase()
49 void HYDROData_CalculationCase::SetName( const QString& theName )
51 QString anOldCaseName = GetName();
52 if ( anOldCaseName != theName )
54 HYDROData_SequenceOfObjects aRegions = GetRegions();
56 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
57 for ( ; anIter.More(); anIter.Next() )
59 Handle(HYDROData_Region) aRegion =
60 Handle(HYDROData_Region)::DownCast( anIter.Value() );
61 if ( aRegion.IsNull() )
64 QString aRegionName = aRegion->GetName();
65 if ( aRegionName.startsWith( anOldCaseName ) )
67 aRegionName.replace( anOldCaseName, theName );
68 aRegion->SetName( aRegionName );
71 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
72 HYDROData_SequenceOfObjects::Iterator anIter( aZones );
73 for ( ; anIter.More(); anIter.Next() )
75 Handle(HYDROData_Zone) aRegZone =
76 Handle(HYDROData_Zone)::DownCast( anIter.Value() );
77 if ( aRegZone.IsNull() )
80 QString aRegionZoneName = aRegZone->GetName();
81 if ( aRegionZoneName.startsWith( anOldCaseName ) )
83 aRegionZoneName.replace( anOldCaseName, theName );
84 aRegZone->SetName( aRegionZoneName );
90 HYDROData_Entity::SetName( theName );
93 QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
97 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
98 if ( aDocument.IsNull() )
101 QString aDocName = aDocument->GetDocPyName();
102 QString aCalculName = GetName();
104 aResList << QString( "%1 = %2.CreateObject( %3 );" )
105 .arg( aCalculName ).arg( aDocName ).arg( PYTHON_CALCULATION_ID );
106 aResList << QString( "%1.SetName( \"%2\" );" )
107 .arg( aCalculName ).arg( aCalculName );
108 aResList << QString( "" );
110 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
111 HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
112 for ( ; anIter.More(); anIter.Next() )
114 Handle(HYDROData_Object) aRefGeomObj =
115 Handle(HYDROData_Object)::DownCast( anIter.Value() );
116 if ( !aRefGeomObj.IsNull() )
117 setPythonReferenceObject( theTreatedObjects, aResList, aRefGeomObj, "AddGeometryObject" );
119 aResList << QString( "" );
121 aResList << QString( "%1.SplitGeometryObjects();" ).arg( aCalculName );
122 aResList << QString( "" );
124 // Now we restore the regions and zones order
125 HYDROData_SequenceOfObjects aRegions = GetRegions();
126 anIter.Init( aRegions );
127 for ( ; anIter.More(); anIter.Next() )
129 Handle(HYDROData_Region) aRegion =
130 Handle(HYDROData_Region)::DownCast( anIter.Value() );
131 if ( aRegion.IsNull() )
134 QString aRegionName = aRegion->GetName();
141 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const
143 HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
145 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
146 if ( !aBoundaryPolyline.IsNull() )
147 aResSeq.Append( aBoundaryPolyline );
149 HYDROData_SequenceOfObjects aSeqOfRegions = GetRegions();
150 aResSeq.Append( aSeqOfRegions );
155 void HYDROData_CalculationCase::Update()
157 HYDROData_Entity::Update();
159 // At first we remove previously created objects
161 RemoveSplittedGroups();
163 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
164 if ( aDocument.IsNull() )
167 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
168 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
169 if ( aGeomObjects.IsEmpty() )
172 HYDROData_SequenceOfObjects aGeomGroups = GetGeometryGroups();
174 HYDROData_SplitToZonesTool::SplitDataList aSplitedObjects =
175 HYDROData_SplitToZonesTool::Split( aGeomObjects, aGeomGroups, aBoundaryPolyline );
176 if ( aSplitedObjects.isEmpty() )
179 QString aRegsPref = CALCULATION_REGIONS_PREF;
180 QString aZonesPref = CALCULATION_ZONES_PREF;
182 QMap<QString,Handle(HYDROData_SplittedEdgesGroup)> aSplittedEdgesGroupsMap;
184 // Create result regions for case, by default one zone for one region
185 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitedObjects );
186 while( anIter.hasNext() )
188 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
190 if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Zone )
193 Handle(HYDROData_Region) aRegion = addNewRegion();
195 QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
196 aRegion->SetName( aRegionName );
198 // Add the zone for region
199 Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone();
201 QString aZoneName = HYDROData_Tool::GenerateObjectName( aDocument, aZonesPref );
202 aRegionZone->SetName( aZoneName );
204 aRegionZone->SetShape( aSplitData.Face() );
206 // Add the reference object for zone
207 for ( int i = 0, n = aSplitData.ObjectNames.length(); i < n; ++i )
209 const QString& anObjName = aSplitData.ObjectNames.at( i );
211 Handle(HYDROData_Object) aRefObject = Handle(HYDROData_Object)::DownCast(
212 HYDROData_Tool::FindObjectByName( aDocument, anObjName ) );
213 if ( aRefObject.IsNull() )
216 aRegionZone->AddGeometryObject( aRefObject );
219 else if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Edge )
221 // Create new edges group
222 if ( aSplitData.ObjectNames.isEmpty() ||
223 aSplitData.Shape.IsNull() || aSplitData.Shape.ShapeType() != TopAbs_EDGE )
226 QString anObjName = aSplitData.ObjectNames.first();
227 if ( anObjName.isEmpty() )
230 Handle(HYDROData_SplittedEdgesGroup) aSplittedGroup;
231 if ( !aSplittedEdgesGroupsMap.contains( anObjName ) )
233 aSplittedGroup = addNewSplittedGroup();
235 QString aCalcGroupName = GetName() + "_" + anObjName;
236 aSplittedGroup->SetName( aCalcGroupName );
238 aSplittedEdgesGroupsMap.insert( anObjName, aSplittedGroup );
242 aSplittedGroup = aSplittedEdgesGroupsMap[ anObjName ];
245 if ( aSplittedGroup.IsNull() )
248 TopoDS_Edge anEdge = TopoDS::Edge( aSplitData.Shape );
249 aSplittedGroup->AddEdge( anEdge );
254 bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
256 if ( !HYDROData_Tool::IsGeometryObject( theObject ) )
257 return false; // Wrong type of object
259 if ( HasReference( theObject, DataTag_GeometryObject ) )
260 return false; // Object is already in reference list
262 AddReferenceObject( theObject, DataTag_GeometryObject );
264 // Indicate model of the need to update splitting
270 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryObjects() const
272 return GetReferenceObjects( DataTag_GeometryObject );
275 void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
277 if ( theObject.IsNull() )
280 RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
282 // Indicate model of the need to update splitting
286 void HYDROData_CalculationCase::RemoveGeometryObjects()
288 ClearReferenceObjects( DataTag_GeometryObject );
290 // Indicate model of the need to update splitting
294 bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
296 if ( theGroup.IsNull() )
299 if ( HasReference( theGroup, DataTag_GeometryGroup ) )
300 return false; // Object is already in reference list
302 AddReferenceObject( theGroup, DataTag_GeometryGroup );
304 // Indicate model of the need to update splitting
310 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const
312 return GetReferenceObjects( DataTag_GeometryGroup );
315 void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
317 if ( theGroup.IsNull() )
320 RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
322 // Indicate model of the need to update splitting
326 void HYDROData_CalculationCase::RemoveGeometryGroups()
328 ClearReferenceObjects( DataTag_GeometryGroup );
330 // Indicate model of the need to update splitting
334 void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
336 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
338 SetReferenceObject( thePolyline, DataTag_Polyline );
340 // Indicate model of the need to update zones splitting
341 SetToUpdate( !IsEqual( aPrevPolyline, thePolyline ) || IsMustBeUpdated() );
344 Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
346 return Handle(HYDROData_PolylineXY)::DownCast(
347 GetReferenceObject( DataTag_Polyline ) );
350 void HYDROData_CalculationCase::RemoveBoundaryPolyline()
352 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
354 ClearReferenceObjects( DataTag_Polyline );
356 // Indicate model of the need to update zones splitting
357 SetToUpdate( !aPrevPolyline.IsNull() || IsMustBeUpdated() );
360 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
362 Handle(HYDROData_Region) aNewRegion = addNewRegion();
363 if ( aNewRegion.IsNull() )
366 // Generate new name for new region
367 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
368 if ( !aDocument.IsNull() )
370 QString aRegsPref = CALCULATION_REGIONS_PREF;
372 QString aNewRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
373 aNewRegion->SetName( aNewRegionName );
376 aNewRegion->AddZone( theZone );
381 bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRegion )
383 if ( theRegion.IsNull() )
386 if ( HasReference( theRegion, DataTag_Region ) )
387 return false; // Object is already in reference list
389 // Move the region from other calculation
390 Handle(HYDROData_CalculationCase) aFatherCalc =
391 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
392 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
394 Handle(HYDROData_Region) aNewRegion = addNewRegion();
395 theRegion->CopyTo( aNewRegion );
397 aFatherCalc->RemoveRegion( theRegion );
399 theRegion->SetLabel( aNewRegion->Label() );
403 AddReferenceObject( theRegion, DataTag_Region );
409 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetRegions() const
411 return GetReferenceObjects( DataTag_Region );
414 void HYDROData_CalculationCase::UpdateRegionsOrder()
416 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
417 if ( aDocument.IsNull() )
420 HYDROData_SequenceOfObjects aRegions = GetRegions();
422 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
423 for ( ; anIter.More(); anIter.Next() )
425 Handle(HYDROData_Region) aRegion =
426 Handle(HYDROData_Region)::DownCast( anIter.Value() );
427 if ( aRegion.IsNull() )
430 aRegion->SetName( "" );
433 QString aRegsPref = CALCULATION_REGIONS_PREF;
435 anIter.Init( aRegions );
436 for ( ; anIter.More(); anIter.Next() )
438 Handle(HYDROData_Region) aRegion =
439 Handle(HYDROData_Region)::DownCast( anIter.Value() );
440 if ( aRegion.IsNull() )
443 QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
444 aRegion->SetName( aRegionName );
448 void HYDROData_CalculationCase::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
450 if ( theRegion.IsNull() )
453 RemoveReferenceObject( theRegion->Label(), DataTag_Region );
455 // Remove region from data model
456 Handle(HYDROData_CalculationCase) aFatherCalc =
457 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
458 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
462 void HYDROData_CalculationCase::RemoveRegions()
464 myLab.FindChild( DataTag_ChildRegion ).ForgetAllAttributes();
467 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetSplittedGroups() const
469 return GetReferenceObjects( DataTag_SplittedGroups );
472 void HYDROData_CalculationCase::RemoveSplittedGroups()
474 myLab.FindChild( DataTag_SplittedGroups ).ForgetAllAttributes();
477 TopoDS_Shell HYDROData_CalculationCase::GetShell()
481 TopTools_ListOfShape aFacesList;
483 // Make shell containing all region shapes
484 BRepBuilderAPI_Sewing aSewing( Precision::Confusion()*10.0 );
486 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
487 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
488 for ( ; aRegionIter.More(); aRegionIter.Next() ) {
489 Handle(HYDROData_Region) aRegion =
490 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
491 if( aRegion.IsNull() ) {
495 TopoDS_Shape aRegionShape = aRegion->GetShape();
496 if( !aRegionShape.IsNull() ) {
497 if ( aRegionShape.ShapeType() == TopAbs_FACE ) {
498 TopoDS_Face aFace = TopoDS::Face( aRegionShape );
499 if ( !aFace.IsNull() ) {
500 aFacesList.Append( aFace );
501 aSewing.Add( aFace );
504 TopExp_Explorer anExp( aRegionShape, TopAbs_FACE );
505 for ( ; anExp.More(); anExp.Next() ) {
506 TopoDS_Face aFace = TopoDS::Face( anExp.Current() );
507 if ( !aFace.IsNull() ) {
508 aFacesList.Append( aFace );
509 aSewing.Add( aFace );
514 } // regions iterator
517 TopoDS_Shape aSewedShape = aSewing.SewedShape();
519 if ( !aSewedShape.IsNull() )
521 if ( aSewedShape.ShapeType() == TopAbs_FACE && aCaseRegions.Length() ==1 ) {
522 // create shell from one face
523 BRep_Builder aBuilder;
524 aBuilder.MakeShell( aShell );
525 aBuilder.Add( aShell, aSewedShape);
527 TopExp_Explorer anExpShells( aSewedShape, TopAbs_SHELL );
528 Standard_Integer aNbOfShells = 0;
529 for ( ; anExpShells.More(); anExpShells.Next() ) {
530 aShell = TopoDS::Shell( anExpShells.Current() );
534 if ( aNbOfShells != 1 ) {
536 BRep_Builder aBuilder;
537 aBuilder.MakeShell( aShell );
539 TopExp_Explorer anExpFaces( aSewedShape, TopAbs_FACE );
540 for ( ; anExpFaces.More(); anExpFaces.Next() ) {
541 TopoDS_Face aFace = TopoDS::Face( anExpFaces.Current() );
542 if ( !aFace.IsNull() ) {
543 aBuilder.Add( aShell, aFace );
550 if ( !aShell.IsNull() ) {
551 TopTools_IndexedMapOfShape aMapOfFaces;
552 TopExp::MapShapes( aShell, TopAbs_FACE, aMapOfFaces );
553 if ( aMapOfFaces.Extent() != aFacesList.Extent() ) {
555 BRep_Builder aBuilder;
556 aBuilder.MakeShell( aShell );
558 TopTools_ListIteratorOfListOfShape anIter( aFacesList );
559 for ( ; anIter.More(); anIter.Next() ) {
560 TopoDS_Face aFace = TopoDS::Face( anIter.Value() );
561 aBuilder.Add( aShell, aFace );
568 BRep_Builder aBuilder;
569 aBuilder.MakeShell( aShell );
571 // Make shell containing all region shapes
572 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
573 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
574 for ( ; aRegionIter.More(); aRegionIter.Next() ) {
575 Handle(HYDROData_Region) aRegion =
576 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
577 if( aRegion.IsNull() ) {
581 TopoDS_Shape aRegionShape = aRegion->GetShape();
583 // Add shape (face or shell) corresponding to the region into the shell
584 if( !aRegionShape.IsNull() ) {
585 if ( aRegionShape.ShapeType() == TopAbs_FACE ) {
586 aBuilder.Add( aShell, aRegionShape );
588 TopExp_Explorer anExp( aRegionShape, TopAbs_FACE );
589 for( ; anExp.More(); anExp.Next() ) {
590 TopoDS_Face aFace = TopoDS::Face( anExp.Current() );
591 if( !aFace.IsNull() ) {
592 aBuilder.Add( aShell, aFace );
597 } // regions iterator
600 // Nullify shell if it is empty
601 if ( !aShell.IsNull() && !TopoDS_Iterator(aShell).More() ) {
608 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) const
610 double aResAltitude = HYDROData_Bathymetry::GetInvalidAltitude();
612 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
613 if ( aZone.IsNull() )
616 HYDROData_Zone::MergeBathymetriesType aZoneMergeType = aZone->GetMergeType();
617 if ( !aZone->IsMergingNeed() )
619 aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
621 else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
626 if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
628 Handle(HYDROData_Bathymetry) aMergeBathymetry = aZone->GetMergeBathymetry();
629 if ( !aMergeBathymetry.IsNull() )
630 aResAltitude = aMergeBathymetry->GetAltitudeForPoint( thePoint );
634 HYDROData_SequenceOfObjects aZoneObjects = aZone->GetGeometryObjects();
635 HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
636 for ( ; anIter.More(); anIter.Next() )
638 Handle(HYDROData_Object) aZoneObj =
639 Handle(HYDROData_Object)::DownCast( anIter.Value() );
640 if ( aZoneObj.IsNull() )
643 Handle(HYDROData_Bathymetry) anObjBathymetry = aZoneObj->GetBathymetry();
644 if ( anObjBathymetry.IsNull() )
647 double aPointAltitude = anObjBathymetry->GetAltitudeForPoint( thePoint );
648 if ( ValuesEquals( aPointAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) )
651 if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
653 aResAltitude = aPointAltitude;
656 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMIN )
658 if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
659 aResAltitude > aPointAltitude )
661 aResAltitude = aPointAltitude;
664 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMAX )
666 if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
667 aResAltitude < aPointAltitude )
669 aResAltitude = aPointAltitude;
678 Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& thePoint ) const
680 Handle(HYDROData_Zone) aResZone;
682 HYDROData_SequenceOfObjects aRegions = GetRegions();
684 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
685 for ( ; anIter.More() && aResZone.IsNull(); anIter.Next() )
687 Handle(HYDROData_Region) aRegion =
688 Handle(HYDROData_Region)::DownCast( anIter.Value() );
689 if ( aRegion.IsNull() )
692 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
693 HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
694 for ( ; aZonesIter.More() && aResZone.IsNull(); aZonesIter.Next() )
696 Handle(HYDROData_Zone) aRegZone =
697 Handle(HYDROData_Zone)::DownCast( aZonesIter.Value() );
698 if ( aRegZone.IsNull() )
701 PointClassification aPointRelation = GetPointClassification( thePoint, aRegZone );
702 if ( aPointRelation != POINT_OUT )
703 aResZone = aRegZone; // We found the desired zone
710 HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPointClassification(
711 const gp_XY& thePoint,
712 const Handle(HYDROData_Zone)& theZone ) const
714 PointClassification aRes = POINT_OUT;
715 if ( theZone.IsNull() )
718 TopoDS_Face aZoneFace = TopoDS::Face( theZone->GetShape() );
719 if ( aZoneFace.IsNull() )
722 BRepTopAdaptor_FClass2d aClassifier( aZoneFace, Precision::Confusion() );
723 TopAbs_State State = aClassifier.Perform( gp_Pnt2d(thePoint), Standard_False );
724 if (State == TopAbs_OUT)
726 else if(State == TopAbs_IN)
728 else if(State == TopAbs_ON)
733 Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion()
735 TDF_Label aNewLab = myLab.FindChild( DataTag_ChildRegion ).NewChild();
737 Handle(HYDROData_Region) aNewRegion =
738 Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
739 AddRegion( aNewRegion );
744 Handle(HYDROData_SplittedEdgesGroup) HYDROData_CalculationCase::addNewSplittedGroup()
746 TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild();
748 Handle(HYDROData_SplittedEdgesGroup) aNewGroup =
749 Handle(HYDROData_SplittedEdgesGroup)::DownCast(
750 HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) );
751 AddReferenceObject( aNewGroup, DataTag_SplittedGroups );