From 161b28ca5446f93d75500cf57066f274b943e166 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 22 May 2018 11:56:21 +0300 Subject: [PATCH] Task 2.3: Fix compilation error --- src/GeomAPI/GeomAPI_Edge.cpp | 8 +++----- src/GeomAPI/GeomAPI_Edge.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index 8c219972d..242b6809e 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -282,10 +282,9 @@ bool GeomAPI_Edge::isInPlane(std::shared_ptr thePlane) const return inPlane; } -std::list> GeomAPI_Edge::intersectWithPlane( - const std::shared_ptr thePlane) const +void GeomAPI_Edge::intersectWithPlane(const std::shared_ptr thePlane, + std::list>& theResult) const { - std::list aResList; double aFirst, aLast; const TopoDS_Shape& aShape = const_cast(this)->impl(); Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast); @@ -302,11 +301,10 @@ std::list> GeomAPI_Edge::intersectWithPlane( for (int i = 1; i <= aIntersect.NbPoints(); i++) { aPnt = aIntersect.Point(i); std::shared_ptr 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 diff --git a/src/GeomAPI/GeomAPI_Edge.h b/src/GeomAPI/GeomAPI_Edge.h index 2827c2f0d..e165279f2 100644 --- a/src/GeomAPI/GeomAPI_Edge.h +++ b/src/GeomAPI/GeomAPI_Edge.h @@ -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> - intersectWithPlane(const std::shared_ptr thePlane) const; + void intersectWithPlane(const std::shared_ptr thePlane, std::list >& theResult) const; /// Returns edge length. GEOMAPI_EXPORT -- 2.39.2