Salome HOME
Minor changes.
[modules/hydro.git] / src / HYDROData / HYDROData_Obstacle.cxx
index 76480bd1bd93b2e29a16e885173a7de8abd202cd..a1807649fd95f864d1fe72addab69ab62439b0c5 100644 (file)
@@ -2,7 +2,8 @@
 #include "HYDROData_Obstacle.h"
 
 #include "HYDROData_Document.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_Tool.h"
+#include "HYDROData_ShapesGroup.h"
 
 #include <Basics_Utils.hxx>
 
@@ -353,26 +354,16 @@ void HYDROData_Obstacle::createGroupObjects()
   TopoDS_Shape anObstacleShape = GetTopShape();
   if ( !anObstacleShape.IsNull() )
   {
-    HYDROData_SequenceOfEdges aWireEdges;
-
-    TopExp_Explorer anExp( anObstacleShape, TopAbs_EDGE );
-    for ( ; anExp.More(); anExp.Next() )
-    {
-      TopoDS_Edge anEdge = TopoDS::Edge( anExp.Current() );
-      if ( anEdge.IsNull() )
-        continue;
-
-      aWireEdges.Append( anEdge );
-    }
-
+    TopTools_SequenceOfShape aWireEdges;
+    HYDROData_Tool::ExploreShapeToShapes( anObstacleShape, TopAbs_EDGE, aWireEdges );
     if ( !aWireEdges.IsEmpty() )
     {
-      QString aWireGroupName = GetName() + "_External_Wire";
+      QString aWireGroupName = GetName() + "_Outer_Wire";
 
-      Handle(HYDROData_EdgesGroup) anExtWireGroup = createGroupObject();
+      Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject();
       anExtWireGroup->SetName( aWireGroupName );
      
-      anExtWireGroup->SetEdges( aWireEdges );
+      anExtWireGroup->SetShapes( aWireEdges );
     }
   }
 }