Salome HOME
0020719: EDF 1232 GEOM : Pipe construction dialog box, impossible to select a group...
authordmv <dmv@opencascade.com>
Thu, 29 Apr 2010 13:15:58 +0000 (13:15 +0000)
committerdmv <dmv@opencascade.com>
Thu, 29 Apr 2010 13:15:58 +0000 (13:15 +0000)
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.cxx

index 061f80edf08d445190badd1848abe0a33bb9e634..87a0e5e164bcc44614a79d56a716e362efb9daa3 100644 (file)
@@ -1946,18 +1946,34 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     }
 
     // Get path contour
-    if (aShapePath.ShapeType() == TopAbs_WIRE) {
+    bool isOk = false;
+    if ( aShapePath.ShapeType() == TopAbs_COMPOUND ) {
+      TopTools_SequenceOfShape anEdges;
+      TopExp_Explorer anExp;
+      BRep_Builder B;
+      TopoDS_Wire W;
+      B.MakeWire(W);
+      for ( anExp.Init( aShapePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+        B.Add( W, anExp.Current() );
+        isOk = true;
+      }
+      if ( isOk )
+        aWirePath = W;
+    }
+    else if (aShapePath.ShapeType() == TopAbs_WIRE) {
       aWirePath = TopoDS::Wire(aShapePath);
+      isOk = true;
     }
     else {
       if (aShapePath.ShapeType() == TopAbs_EDGE) {
         TopoDS_Edge anEdge = TopoDS::Edge(aShapePath);
         aWirePath = BRepBuilderAPI_MakeWire(anEdge);
+        isOk = true;
       }
-      else {
-        if(aCI) delete aCI;
-        Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
-      }
+    }
+    if ( !isOk ) {
+      if(aCI) delete aCI;
+      Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
     }
   }
 
index 5acbdd195da6c91f92d4310d054ff2844bcf180c..91ac4ab995a7d6a8f20938edb691c755212aa34f 100644 (file)
@@ -190,6 +190,7 @@ void GenerationGUI_PipeDlg::SelectionTypeButtonClicked()
     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
   } else {
     TColStd_MapOfInteger aMap;
+    aMap.Add(GEOM_COMPOUND);
     aMap.Add(GEOM_WIRE);
     aMap.Add(GEOM_LINE);
     globalSelection(aMap);
@@ -370,6 +371,7 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
     } else {
       TColStd_MapOfInteger aMap;
+      aMap.Add(GEOM_COMPOUND);
       aMap.Add(GEOM_WIRE);
       aMap.Add(GEOM_LINE);
       globalSelection(aMap);