1 // Copyright (C) 2014-2024 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <GeomAPI_WireExplorer.h>
22 #include <GeomAPI_Edge.h>
23 #include <GeomAPI_Vertex.h>
24 #include <GeomAPI_Wire.h>
26 #include <BRepTools_WireExplorer.hxx>
28 #define MY_EXPLORER implPtr<BRepTools_WireExplorer>()
30 GeomAPI_WireExplorer::GeomAPI_WireExplorer()
31 : GeomAPI_Interface(new BRepTools_WireExplorer())
35 GeomAPI_WireExplorer::GeomAPI_WireExplorer(const GeomWirePtr& theWire)
36 : GeomAPI_Interface(new BRepTools_WireExplorer(theWire->impl<TopoDS_Wire>()))
40 void GeomAPI_WireExplorer::init(const GeomWirePtr& theWire)
42 MY_EXPLORER->Init(theWire->impl<TopoDS_Wire>());
45 bool GeomAPI_WireExplorer::more() const
47 return MY_EXPLORER->More() == Standard_True;
50 void GeomAPI_WireExplorer::next()
55 std::shared_ptr<GeomAPI_Edge> GeomAPI_WireExplorer::current()
57 const TopoDS_Edge& aShape = MY_EXPLORER->Current();
58 std::shared_ptr<GeomAPI_Edge> aGeomShape(new GeomAPI_Edge());
59 aGeomShape->setImpl(new TopoDS_Edge(aShape));
63 std::shared_ptr<GeomAPI_Vertex> GeomAPI_WireExplorer::currentVertex()
65 const TopoDS_Vertex& aShape = MY_EXPLORER->CurrentVertex();
66 std::shared_ptr<GeomAPI_Vertex> aGeomShape(new GeomAPI_Vertex());
67 aGeomShape->setImpl(new TopoDS_Vertex(aShape));
71 void GeomAPI_WireExplorer::clear()