]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Groups creation corrected.
authoradv <adv@opencascade.com>
Thu, 19 Dec 2013 05:57:56 +0000 (05:57 +0000)
committeradv <adv@opencascade.com>
Thu, 19 Dec 2013 05:57:56 +0000 (05:57 +0000)
src/HYDROData/HYDROData_ImmersibleZone.cxx

index ad7a42c37332be19cd99f66555ae18b88f4b4a19..1af6a8a30b47ad417ed2700dc38dc343c94586bd 100644 (file)
@@ -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 );