From: adv Date: Thu, 19 Dec 2013 05:57:56 +0000 (+0000) Subject: Groups creation corrected. X-Git-Tag: BR_hydro_v_0_6~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0884a372a7f540ca88bfcab1b4033806b6bc9eef;p=modules%2Fhydro.git Groups creation corrected. --- diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index ad7a42c3..1af6a8a3 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -197,8 +197,17 @@ void HYDROData_ImmersibleZone::createGroupObjects() 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() ) { @@ -206,25 +215,12 @@ void HYDROData_ImmersibleZone::createGroupObjects() 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 );