TopoDS_Wire aZoneOuterWire = ShapeAnalysis::OuterWire( aZoneFace );
- TopTools_SequenceOfShape anInnerEdges;
+ // Create outer edges group
+ QString anOutWiresGroupName = GetName() + "_Outer";
+
+ Handle(HYDROData_ShapesGroup) anOutWiresGroup = createGroupObject();
+ anOutWiresGroup->SetName( anOutWiresGroupName );
+
+ TopTools_SequenceOfShape anOuterEdges;
+ HYDROData_ShapesTool::ExploreShapeToShapes( aZoneOuterWire, TopAbs_EDGE, anOuterEdges );
+ anOutWiresGroup->SetShapes( anOuterEdges );
+ int anInnerCounter = 1;
TopExp_Explorer aZoneFaceExp( aZoneFace, TopAbs_WIRE );
for ( ; aZoneFaceExp.More(); aZoneFaceExp.Next() )
{
if ( aZoneWire.IsEqual( aZoneOuterWire ) )
continue; // Skip the outer wire
- TopTools_SequenceOfShape anEdges;
- HYDROData_ShapesTool::ExploreShapeToShapes( aZoneWire, TopAbs_EDGE, anEdges );
- anInnerEdges.Append( anEdges );
- }
-
- // Create outer edges group
- QString anOutWiresGroupName = GetName() + "_Outer";
+ TopTools_SequenceOfShape anInnerEdges;
+ HYDROData_ShapesTool::ExploreShapeToShapes( aZoneWire, TopAbs_EDGE, anInnerEdges );
+ if ( anInnerEdges.IsEmpty() )
+ continue;
- Handle(HYDROData_ShapesGroup) anOutWiresGroup = createGroupObject();
- anOutWiresGroup->SetName( anOutWiresGroupName );
-
- TopTools_SequenceOfShape anEdges;
- HYDROData_ShapesTool::ExploreShapeToShapes( aZoneOuterWire, TopAbs_EDGE, anEdges );
- anOutWiresGroup->SetShapes( anEdges );
-
- // Create group for inner edges only if edges is not empty
- if ( !anInnerEdges.IsEmpty() )
- {
- QString anInWiresGroupName = GetName() + "_Inner";
+ QString anInWiresGroupName = GetName() + "_Inner_" + QString::number( anInnerCounter++ );
Handle(HYDROData_ShapesGroup) anInWiresGroup = createGroupObject();
anInWiresGroup->SetName( anInWiresGroupName );