]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp
Salome HOME
Issue #555 - Make a number of shifted/rotated copies - selected object does not appea...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_EdgeBuilder.cpp
index 0de55a60f36502506bd813eb21528fe3398daf64..fcf8dbb2be7716928915272dcb2fd5182c58687c 100644 (file)
@@ -18,7 +18,8 @@
 #include <gp_Circ.hxx>
 
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
-    std::shared_ptr<GeomAPI_Pnt> theStart, std::shared_ptr<GeomAPI_Pnt> theEnd)
+    std::shared_ptr<GeomAPI_Pnt> theStart, std::shared_ptr<GeomAPI_Pnt> theEnd,
+    const bool theInfinite)
 {
   const gp_Pnt& aStart = theStart->impl<gp_Pnt>();
   const gp_Pnt& anEnd = theEnd->impl<gp_Pnt>();
@@ -30,6 +31,8 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
   BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd);
   std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge);
   TopoDS_Edge anEdge = anEdgeBuilder.Edge();
+  if (theInfinite)
+    anEdge.Infinite(Standard_True);
   aRes->setImpl(new TopoDS_Shape(anEdge));
   return aRes;
 }
@@ -60,6 +63,8 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::cylinderAxis(
   BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd);
   std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge);
   TopoDS_Edge anEdge = anEdgeBuilder.Edge();
+  // an axis is an infinite object
+  anEdge.Infinite(Standard_True);
   aRes->setImpl(new TopoDS_Shape(anEdge));
   return aRes;
 }