]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.3: Fix compilation error
authorvsv <vsv@opencascade.com>
Tue, 22 May 2018 08:56:21 +0000 (11:56 +0300)
committervsv <vsv@opencascade.com>
Tue, 22 May 2018 08:56:21 +0000 (11:56 +0300)
src/GeomAPI/GeomAPI_Edge.cpp
src/GeomAPI/GeomAPI_Edge.h

index 8c219972d3c459f931cd1262f5393debaf2a5505..242b6809e42011df66e3468fcc1a2d41fc19066d 100644 (file)
@@ -282,10 +282,9 @@ bool GeomAPI_Edge::isInPlane(std::shared_ptr<GeomAPI_Pln> thePlane) const
   return inPlane;
 }
 
-std::list<std::shared_ptr<GeomAPI_Pnt>> GeomAPI_Edge::intersectWithPlane(
-  const std::shared_ptr<GeomAPI_Pln> thePlane) const
+void GeomAPI_Edge::intersectWithPlane(const std::shared_ptr<GeomAPI_Pln> thePlane,
+                                      std::list<std::shared_ptr<GeomAPI_Pnt>>& theResult) const
 {
-  std::list<GeomPointPtr> aResList;
   double aFirst, aLast;
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
@@ -302,11 +301,10 @@ std::list<std::shared_ptr<GeomAPI_Pnt>> GeomAPI_Edge::intersectWithPlane(
       for (int i = 1; i <= aIntersect.NbPoints(); i++) {
         aPnt = aIntersect.Point(i);
         std::shared_ptr<GeomAPI_Pnt> aPntPtr(new GeomAPI_Pnt(aPnt.X(), aPnt.Y(), aPnt.Z()));
-        aResList.push_back(aPntPtr);
+        theResult.push_back(aPntPtr);
       }
     }
   }
-  return aResList;
 }
 
 double GeomAPI_Edge::length() const
index 2827c2f0dbd0b96a4530196094cc4526dfbed245..e165279f2488d25d08ede3ad5a2bee4486483a86 100644 (file)
@@ -97,8 +97,7 @@ public:
   /// Returns list of intersection points if the edge has intersections with the given plane
   /// \param thePlane a plane for intersection
   GEOMAPI_EXPORT
-  std::list<std::shared_ptr<GeomAPI_Pnt>>
-    intersectWithPlane(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
+  void intersectWithPlane(const std::shared_ptr<GeomAPI_Pln> thePlane, std::list<std::shared_ptr<GeomAPI_Pnt> >& theResult) const;
 
   /// Returns edge length.
   GEOMAPI_EXPORT