// Created on: 1993-01-21 // Created by: Remi LEQUETTE // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _BRepTools_WireExplorer_HeaderFile #define _BRepTools_WireExplorer_HeaderFile #include "Standard.hxx" #include "Standard_DefineAlloc.hxx" #include "TopoDS_Shape.hxx" #include "NCollection_List.hxx" #include "TopTools_ShapeMapHasher.hxx" #include "NCollection_DataMap.hxx" #include "TopoDS_Edge.hxx" #include "TopoDS_Vertex.hxx" #include "TopoDS_Face.hxx" #include "NCollection_Map.hxx" #include "TopAbs_Orientation.hxx" class TopoDS_Wire; //! The WireExplorer is a tool to explore the edges of //! a wire in a connection order. //! //! i.e. each edge is connected to the previous one by //! its origin. //! If a wire is not closed returns only a segment of edges which //! length depends on started in exploration edge. //! Algorithm suggests that wire is valid and has no any defects, which //! can stop edge exploration. Such defects can be loops, wrong orientation of edges //! (two edges go in to shared vertex or go out from shared vertex), branching of edges, //! the presens of edges with INTERNAL or EXTERNAL orientation. If wire has //! such kind of defects WireExplorer can return not all //! edges in a wire. it depends on type of defect and position of starting edge. class BRepTools_WireExplorer { public: DEFINE_STANDARD_ALLOC //! Constructs an empty explorer (which can be initialized using Init) Standard_EXPORT BRepTools_WireExplorer(); //! IInitializes an exploration of the wire . Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W); //! Initializes an exploration of the wire . //! F is used to select the edge connected to the //! previous in the parametric representation of . Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W, const TopoDS_Face& F); //! Initializes an exploration of the wire . Standard_EXPORT void Init(const TopoDS_Wire& W); //! Initializes an exploration of the wire . //! F is used to select the edge connected to the //! previous in the parametric representation of . Standard_EXPORT void Init(const TopoDS_Wire& W, const TopoDS_Face& F); //! Initializes an exploration of the wire . //! F is used to select the edge connected to the //! previous in the parametric representation of . //! , , , - the UV bounds of the face . Standard_EXPORT void Init(const TopoDS_Wire& W, const TopoDS_Face& F, const double UMin, const double UMax, const double VMin, const double VMax); //! Returns True if there is a current edge. Standard_EXPORT bool More() const; //! Proceeds to the next edge. Standard_EXPORT void Next(); //! Returns the current edge. Standard_EXPORT const TopoDS_Edge& Current() const; //! Returns an Orientation for the current edge. Standard_EXPORT TopAbs_Orientation Orientation() const; //! Returns the vertex connecting the current edge to //! the previous one. Standard_EXPORT const TopoDS_Vertex& CurrentVertex() const; //! Clears the content of the explorer. Standard_EXPORT void Clear(); private: NCollection_DataMap, TopTools_ShapeMapHasher> myMap; TopoDS_Edge myEdge; TopoDS_Vertex myVertex; TopoDS_Face myFace; NCollection_Map myDoubles; bool myReverse; double myTolU; double myTolV; }; #endif // _BRepTools_WireExplorer_HeaderFile