X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Wire.cpp;h=e5eb9d41007d647433f976d5d3857a065b3d2499;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=6932444bf75af2be55d57c4d5afe616e47caa31b;hpb=c48f5ad61510889aa8ba86c3b2710a072fb1cc58;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Wire.cpp b/src/GeomAPI/GeomAPI_Wire.cpp index 6932444bf..e5eb9d410 100644 --- a/src/GeomAPI/GeomAPI_Wire.cpp +++ b/src/GeomAPI/GeomAPI_Wire.cpp @@ -1,48 +1,21 @@ -// File: GeomAPI_Wire.cpp -// Created: 06 Oct 2014 -// Author: Sergey BELASH +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -#include -#include +// File: GeomAPI_Wire.cpp +// Created: 28 April 2016 +// Author: Dmitry Bobylev -#include -#include +#include "GeomAPI_Wire.h" -#include -#include -#include #include -#include - -#include +#include -GeomAPI_Wire::GeomAPI_Wire() : GeomAPI_Shape() +//================================================================================================== +GeomAPI_Wire::GeomAPI_Wire() { - TopoDS_Compound aBigWireImpl; - BRep_Builder aBuilder; - aBuilder.MakeCompound(aBigWireImpl); - this->setImpl(new TopoDS_Shape(aBigWireImpl)); -} + TopoDS_Wire* aWire = new TopoDS_Wire(); -void GeomAPI_Wire::addEdge(boost::shared_ptr theEdge) -{ - const TopoDS_Edge& anEdge = theEdge->impl(); - if (anEdge.ShapeType() != TopAbs_EDGE) - return; - TopoDS_Shape& aWire = const_cast(impl()); BRep_Builder aBuilder; - aBuilder.Add(aWire, anEdge); -} + aBuilder.MakeWire(*aWire); -std::list > GeomAPI_Wire::getEdges() -{ - TopoDS_Shape& aShape = const_cast(impl()); - BRepTools_WireExplorer aWireExp(TopoDS::Wire(aShape)); - std::list > aResult; - for (; aWireExp.More(); aWireExp.Next()) { - boost::shared_ptr anEdge(new GeomAPI_Shape); - anEdge->setImpl(new TopoDS_Shape(aWireExp.Current())); - aResult.push_back(anEdge); - } - return aResult; + this->setImpl(aWire); }