0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRepTools / BRepTools_WireExplorer.hxx
1 // Created on: 1993-01-21
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepTools_WireExplorer_HeaderFile
18 #define _BRepTools_WireExplorer_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <TopTools_DataMapOfShapeListOfShape.hxx>
24 #include <TopoDS_Edge.hxx>
25 #include <TopoDS_Vertex.hxx>
26 #include <TopoDS_Face.hxx>
27 #include <TopTools_MapOfShape.hxx>
28 #include <TopAbs_Orientation.hxx>
29 class TopoDS_Wire;
30
31
32 //! The WireExplorer is a tool to explore the edges of
33 //! a wire in a connection order.
34 //!
35 //! i.e. each edge is connected to the previous one by
36 //! its origin.
37 //! If a wire is not closed returns only a segment of edges which
38 //! length depends on started in exploration edge. 
39 //! Algorithm suggests that wire is valid and has no any defects, which 
40 //! can stop edge exploration. Such defects can be loops, wrong orientation of edges
41 //! (two edges go in to shared vertex or go out from shared vertex), branching of edges, 
42 //! the presens of edges with INTERNAL or EXTERNAL orientation. If wire has
43 //! such kind of defects WireExplorer can return not all
44 //! edges in a wire. it depends on type of defect and position of starting edge.
45 class BRepTools_WireExplorer 
46 {
47 public:
48
49   DEFINE_STANDARD_ALLOC
50
51   
52   //! Constructs an empty explorer (which can be initialized using Init)
53   Standard_EXPORT BRepTools_WireExplorer();
54   
55   //! IInitializes an exploration  of the wire <W>.
56   Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W);
57   
58   //! Initializes an exploration  of the wire <W>.
59   //! F is used to select the edge connected to the
60   //! previous in the parametric representation of <F>.
61   Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W, const TopoDS_Face& F);
62   
63   //! Initializes an exploration of the wire <W>.
64   Standard_EXPORT void Init (const TopoDS_Wire& W);
65   
66   //! Initializes an exploration of the wire <W>.
67   //! F is used to select the edge connected to the
68   //! previous in the parametric representation of <F>.
69   Standard_EXPORT void Init (const TopoDS_Wire& W, const TopoDS_Face& F);
70   
71   //! Initializes an exploration of the wire <W>.
72   //! F is used to select the edge connected to the
73   //! previous in the parametric representation of <F>.
74   //! <UMIn>, <UMax>, <VMin>, <VMax> - the UV bounds of the face <F>.
75   Standard_EXPORT void Init(const TopoDS_Wire& W,
76                             const TopoDS_Face& F,
77                             const Standard_Real UMin,
78                             const Standard_Real UMax,
79                             const Standard_Real VMin,
80                             const Standard_Real VMax);
81
82   //! Returns True if there  is a current  edge.
83   Standard_EXPORT Standard_Boolean More() const;
84   
85   //! Proceeds to the next edge.
86   Standard_EXPORT void Next();
87   
88   //! Returns the current edge.
89   Standard_EXPORT const TopoDS_Edge& Current() const;
90   
91   //! Returns an Orientation for the current edge.
92   Standard_EXPORT TopAbs_Orientation Orientation() const;
93   
94   //! Returns the vertex connecting the current  edge to
95   //! the previous one.
96   Standard_EXPORT const TopoDS_Vertex& CurrentVertex() const;
97   
98   //! Clears the content of the explorer.
99   Standard_EXPORT void Clear();
100
101
102
103
104 protected:
105
106
107
108
109
110 private:
111
112
113
114   TopTools_DataMapOfShapeListOfShape myMap;
115   TopoDS_Edge myEdge;
116   TopoDS_Vertex myVertex;
117   TopoDS_Face myFace;
118   TopTools_MapOfShape myDoubles;
119   Standard_Boolean myReverse;
120   Standard_Real myTolU;
121   Standard_Real myTolV;
122
123
124 };
125
126
127
128
129
130
131
132 #endif // _BRepTools_WireExplorer_HeaderFile