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 if ( !aSplittedEdgesGroupsMap.contains( anObjName ) )
231 aSplittedEdgesGroupsMap.insert( anObjName, addNewSplittedGroup() );
233 Handle(HYDROData_SplittedEdgesGroup) aSplittedGroup = aSplittedEdgesGroupsMap[ anObjName ];
234 if ( aSplittedGroup.IsNull() )
237 TopoDS_Edge anEdge = TopoDS::Edge( aSplitData.Shape );
238 aSplittedGroup->AddEdge( anEdge );
243 bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
245 if ( !HYDROData_Tool::IsGeometryObject( theObject ) )
246 return false; // Wrong type of object
248 if ( HasReference( theObject, DataTag_GeometryObject ) )
249 return false; // Object is already in reference list
251 AddReferenceObject( theObject, DataTag_GeometryObject );
253 // Indicate model of the need to update splitting
259 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryObjects() const
261 return GetReferenceObjects( DataTag_GeometryObject );
264 void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
266 if ( theObject.IsNull() )
269 RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
271 // Indicate model of the need to update splitting
275 void HYDROData_CalculationCase::RemoveGeometryObjects()
277 ClearReferenceObjects( DataTag_GeometryObject );
279 // Indicate model of the need to update splitting
283 bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
285 if ( theGroup.IsNull() )
288 if ( HasReference( theGroup, DataTag_GeometryGroup ) )
289 return false; // Object is already in reference list
291 AddReferenceObject( theGroup, DataTag_GeometryGroup );
293 // Indicate model of the need to update splitting
299 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const
301 return GetReferenceObjects( DataTag_GeometryGroup );
304 void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
306 if ( theGroup.IsNull() )
309 RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
311 // Indicate model of the need to update splitting
315 void HYDROData_CalculationCase::RemoveGeometryGroups()
317 ClearReferenceObjects( DataTag_GeometryGroup );
319 // Indicate model of the need to update splitting
323 void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
325 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
327 SetReferenceObject( thePolyline, DataTag_Polyline );
329 // Indicate model of the need to update zones splitting
330 SetToUpdate( !IsEqual( aPrevPolyline, thePolyline ) || IsMustBeUpdated() );
333 Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
335 return Handle(HYDROData_PolylineXY)::DownCast(
336 GetReferenceObject( DataTag_Polyline ) );
339 void HYDROData_CalculationCase::RemoveBoundaryPolyline()
341 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
343 ClearReferenceObjects( DataTag_Polyline );
345 // Indicate model of the need to update zones splitting
346 SetToUpdate( !aPrevPolyline.IsNull() || IsMustBeUpdated() );
349 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
351 Handle(HYDROData_Region) aNewRegion = addNewRegion();
352 if ( aNewRegion.IsNull() )
355 // Generate new name for new region
356 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
357 if ( !aDocument.IsNull() )
359 QString aRegsPref = CALCULATION_REGIONS_PREF;
361 QString aNewRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
362 aNewRegion->SetName( aNewRegionName );
365 aNewRegion->AddZone( theZone );
370 bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRegion )
372 if ( theRegion.IsNull() )
375 if ( HasReference( theRegion, DataTag_Region ) )
376 return false; // Object is already in reference list
378 // Move the region from other calculation
379 Handle(HYDROData_CalculationCase) aFatherCalc =
380 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
381 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
383 Handle(HYDROData_Region) aNewRegion = addNewRegion();
384 theRegion->CopyTo( aNewRegion );
386 aFatherCalc->RemoveRegion( theRegion );
388 theRegion->SetLabel( aNewRegion->Label() );
392 AddReferenceObject( theRegion, DataTag_Region );
398 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetRegions() const
400 return GetReferenceObjects( DataTag_Region );
403 void HYDROData_CalculationCase::UpdateRegionsOrder()
405 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
406 if ( aDocument.IsNull() )
409 HYDROData_SequenceOfObjects aRegions = GetRegions();
411 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
412 for ( ; anIter.More(); anIter.Next() )
414 Handle(HYDROData_Region) aRegion =
415 Handle(HYDROData_Region)::DownCast( anIter.Value() );
416 if ( aRegion.IsNull() )
419 aRegion->SetName( "" );
422 QString aRegsPref = CALCULATION_REGIONS_PREF;
424 anIter.Init( aRegions );
425 for ( ; anIter.More(); anIter.Next() )
427 Handle(HYDROData_Region) aRegion =
428 Handle(HYDROData_Region)::DownCast( anIter.Value() );
429 if ( aRegion.IsNull() )
432 QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
433 aRegion->SetName( aRegionName );
437 void HYDROData_CalculationCase::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
439 if ( theRegion.IsNull() )
442 RemoveReferenceObject( theRegion->Label(), DataTag_Region );
444 // Remove region from data model
445 Handle(HYDROData_CalculationCase) aFatherCalc =
446 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
447 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
451 void HYDROData_CalculationCase::RemoveRegions()
453 myLab.FindChild( DataTag_ChildRegion ).ForgetAllAttributes();
456 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetSplittedGroups() const
458 return GetReferenceObjects( DataTag_SplittedGroups );
461 void HYDROData_CalculationCase::RemoveSplittedGroups()
463 myLab.FindChild( DataTag_SplittedGroups ).ForgetAllAttributes();
466 TopoDS_Shell HYDROData_CalculationCase::GetShell()
470 TopTools_ListOfShape aFacesList;
472 // Make shell containing all region shapes
473 BRepBuilderAPI_Sewing aSewing( Precision::Confusion()*10.0 );
475 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
476 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
477 for ( ; aRegionIter.More(); aRegionIter.Next() ) {
478 Handle(HYDROData_Region) aRegion =
479 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
480 if( aRegion.IsNull() ) {
484 TopoDS_Shape aRegionShape = aRegion->GetShape();
485 if( !aRegionShape.IsNull() ) {
486 if ( aRegionShape.ShapeType() == TopAbs_FACE ) {
487 TopoDS_Face aFace = TopoDS::Face( aRegionShape );
488 if ( !aFace.IsNull() ) {
489 aFacesList.Append( aFace );
490 aSewing.Add( aFace );
493 TopExp_Explorer anExp( aRegionShape, TopAbs_FACE );
494 for ( ; anExp.More(); anExp.Next() ) {
495 TopoDS_Face aFace = TopoDS::Face( anExp.Current() );
496 if ( !aFace.IsNull() ) {
497 aFacesList.Append( aFace );
498 aSewing.Add( aFace );
503 } // regions iterator
506 TopoDS_Shape aSewedShape = aSewing.SewedShape();
508 if ( !aSewedShape.IsNull() )
510 if ( aSewedShape.ShapeType() == TopAbs_FACE && aCaseRegions.Length() ==1 ) {
511 // create shell from one face
512 BRep_Builder aBuilder;
513 aBuilder.MakeShell( aShell );
514 aBuilder.Add( aShell, aSewedShape);
516 TopExp_Explorer anExpShells( aSewedShape, TopAbs_SHELL );
517 Standard_Integer aNbOfShells = 0;
518 for ( ; anExpShells.More(); anExpShells.Next() ) {
519 aShell = TopoDS::Shell( anExpShells.Current() );
523 if ( aNbOfShells != 1 ) {
525 BRep_Builder aBuilder;
526 aBuilder.MakeShell( aShell );
528 TopExp_Explorer anExpFaces( aSewedShape, TopAbs_FACE );
529 for ( ; anExpFaces.More(); anExpFaces.Next() ) {
530 TopoDS_Face aFace = TopoDS::Face( anExpFaces.Current() );
531 if ( !aFace.IsNull() ) {
532 aBuilder.Add( aShell, aFace );
539 if ( !aShell.IsNull() ) {
540 TopTools_IndexedMapOfShape aMapOfFaces;
541 TopExp::MapShapes( aShell, TopAbs_FACE, aMapOfFaces );
542 if ( aMapOfFaces.Extent() != aFacesList.Extent() ) {
544 BRep_Builder aBuilder;
545 aBuilder.MakeShell( aShell );
547 TopTools_ListIteratorOfListOfShape anIter( aFacesList );
548 for ( ; anIter.More(); anIter.Next() ) {
549 TopoDS_Face aFace = TopoDS::Face( anIter.Value() );
550 aBuilder.Add( aShell, aFace );
557 BRep_Builder aBuilder;
558 aBuilder.MakeShell( aShell );
560 // Make shell containing all region shapes
561 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
562 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
563 for ( ; aRegionIter.More(); aRegionIter.Next() ) {
564 Handle(HYDROData_Region) aRegion =
565 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
566 if( aRegion.IsNull() ) {
570 TopoDS_Shape aRegionShape = aRegion->GetShape();
572 // Add shape (face or shell) corresponding to the region into the shell
573 if( !aRegionShape.IsNull() ) {
574 if ( aRegionShape.ShapeType() == TopAbs_FACE ) {
575 aBuilder.Add( aShell, aRegionShape );
577 TopExp_Explorer anExp( aRegionShape, TopAbs_FACE );
578 for( ; anExp.More(); anExp.Next() ) {
579 TopoDS_Face aFace = TopoDS::Face( anExp.Current() );
580 if( !aFace.IsNull() ) {
581 aBuilder.Add( aShell, aFace );
586 } // regions iterator
589 // Nullify shell if it is empty
590 if ( !aShell.IsNull() && !TopoDS_Iterator(aShell).More() ) {
597 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) const
599 double aResAltitude = HYDROData_Bathymetry::GetInvalidAltitude();
601 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
602 if ( aZone.IsNull() )
605 HYDROData_Zone::MergeBathymetriesType aZoneMergeType = aZone->GetMergeType();
606 if ( !aZone->IsMergingNeed() )
608 aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
610 else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
615 if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
617 Handle(HYDROData_Bathymetry) aMergeBathymetry = aZone->GetMergeBathymetry();
618 if ( !aMergeBathymetry.IsNull() )
619 aResAltitude = aMergeBathymetry->GetAltitudeForPoint( thePoint );
623 HYDROData_SequenceOfObjects aZoneObjects = aZone->GetGeometryObjects();
624 HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
625 for ( ; anIter.More(); anIter.Next() )
627 Handle(HYDROData_Object) aZoneObj =
628 Handle(HYDROData_Object)::DownCast( anIter.Value() );
629 if ( aZoneObj.IsNull() )
632 Handle(HYDROData_Bathymetry) anObjBathymetry = aZoneObj->GetBathymetry();
633 if ( anObjBathymetry.IsNull() )
636 double aPointAltitude = anObjBathymetry->GetAltitudeForPoint( thePoint );
637 if ( ValuesEquals( aPointAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) )
640 if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
642 aResAltitude = aPointAltitude;
645 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMIN )
647 if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
648 aResAltitude > aPointAltitude )
650 aResAltitude = aPointAltitude;
653 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMAX )
655 if ( ValuesEquals( aResAltitude, HYDROData_Bathymetry::GetInvalidAltitude() ) ||
656 aResAltitude < aPointAltitude )
658 aResAltitude = aPointAltitude;
667 Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& thePoint ) const
669 Handle(HYDROData_Zone) aResZone;
671 HYDROData_SequenceOfObjects aRegions = GetRegions();
673 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
674 for ( ; anIter.More() && aResZone.IsNull(); anIter.Next() )
676 Handle(HYDROData_Region) aRegion =
677 Handle(HYDROData_Region)::DownCast( anIter.Value() );
678 if ( aRegion.IsNull() )
681 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
682 HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
683 for ( ; aZonesIter.More() && aResZone.IsNull(); aZonesIter.Next() )
685 Handle(HYDROData_Zone) aRegZone =
686 Handle(HYDROData_Zone)::DownCast( aZonesIter.Value() );
687 if ( aRegZone.IsNull() )
690 PointClassification aPointRelation = GetPointClassification( thePoint, aRegZone );
691 if ( aPointRelation != POINT_OUT )
692 aResZone = aRegZone; // We found the desired zone
699 HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPointClassification(
700 const gp_XY& thePoint,
701 const Handle(HYDROData_Zone)& theZone ) const
703 PointClassification aRes = POINT_OUT;
704 if ( theZone.IsNull() )
707 TopoDS_Face aZoneFace = TopoDS::Face( theZone->GetShape() );
708 if ( aZoneFace.IsNull() )
711 BRepTopAdaptor_FClass2d aClassifier( aZoneFace, Precision::Confusion() );
712 TopAbs_State State = aClassifier.Perform( gp_Pnt2d(thePoint), Standard_False );
713 if (State == TopAbs_OUT)
715 else if(State == TopAbs_IN)
717 else if(State == TopAbs_ON)
722 Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion()
724 TDF_Label aNewLab = myLab.FindChild( DataTag_ChildRegion ).NewChild();
726 Handle(HYDROData_Region) aNewRegion =
727 Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
728 AddRegion( aNewRegion );
733 Handle(HYDROData_SplittedEdgesGroup) HYDROData_CalculationCase::addNewSplittedGroup()
735 TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild();
737 Handle(HYDROData_SplittedEdgesGroup) aNewGroup =
738 Handle(HYDROData_SplittedEdgesGroup)::DownCast(
739 HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) );
740 AddReferenceObject( aNewGroup, DataTag_SplittedGroups );