42cf5bc1 |
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 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
25 | #include <TopoDS_Edge.hxx> |
26 | #include <TopoDS_Vertex.hxx> |
27 | #include <TopoDS_Face.hxx> |
28 | #include <TopTools_MapOfShape.hxx> |
29 | #include <Standard_Boolean.hxx> |
30 | #include <Standard_Real.hxx> |
31 | #include <TopAbs_Orientation.hxx> |
32 | class Standard_DomainError; |
33 | class Standard_NoSuchObject; |
34 | class Standard_NoMoreObject; |
35 | class TopoDS_Wire; |
36 | class TopoDS_Face; |
37 | class TopoDS_Edge; |
38 | class TopoDS_Vertex; |
39 | |
40 | |
41 | //! The WireExplorer is a tool to explore the edges of |
42 | //! a wire in a connection order. |
43 | //! |
44 | //! i.e. each edge is connected to the previous one by |
45 | //! its origin. |
46 | //! If a wire is not closed returns only a segment of edges which |
94520b24 |
47 | //! length depends on started in exploration edge. |
48 | //! Algorithm suggests that wire is valid and has no any defects, which |
49 | //! can stop edge exploration. Such defects can be loops, wrong orientation of edges |
50 | //! (two edges go in to shared vertex or go out from shared vertex), branching of edges, |
51 | //! the presens of edges with INTERNAL or EXTERNAL orientation. If wire has |
52 | //! such kind of defects WireExplorer can return not all |
53 | //! edges in a wire. it depends on type of defect and position of starting edge. |
42cf5bc1 |
54 | class BRepTools_WireExplorer |
55 | { |
56 | public: |
57 | |
58 | DEFINE_STANDARD_ALLOC |
59 | |
60 | |
61 | //! Constructs an empty explorer (which can be initialized using Init) |
62 | Standard_EXPORT BRepTools_WireExplorer(); |
63 | |
64 | //! IInitializes an exploration of the wire <W>. |
65 | Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W); |
66 | |
67 | //! Initializes an exploration of the wire <W>. |
68 | //! F is used to select the edge connected to the |
69 | //! previous in the parametric representation of <F>. |
70 | Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W, const TopoDS_Face& F); |
71 | |
72 | //! Initializes an exploration of the wire <W>. |
73 | Standard_EXPORT void Init (const TopoDS_Wire& W); |
74 | |
75 | //! Initializes an exploration of the wire <W>. |
76 | //! F is used to select the edge connected to the |
77 | //! previous in the parametric representation of <F>. |
78 | Standard_EXPORT void Init (const TopoDS_Wire& W, const TopoDS_Face& F); |
79 | |
b6cf8ffa |
80 | //! Initializes an exploration of the wire <W>. |
81 | //! F is used to select the edge connected to the |
82 | //! previous in the parametric representation of <F>. |
83 | //! <UMIn>, <UMax>, <VMin>, <VMax> - the UV bounds of the face <F>. |
84 | Standard_EXPORT void Init(const TopoDS_Wire& W, |
85 | const TopoDS_Face& F, |
86 | const Standard_Real UMin, |
87 | const Standard_Real UMax, |
88 | const Standard_Real VMin, |
89 | const Standard_Real VMax); |
90 | |
42cf5bc1 |
91 | //! Returns True if there is a current edge. |
92 | Standard_EXPORT Standard_Boolean More() const; |
93 | |
94 | //! Proceeds to the next edge. |
95 | Standard_EXPORT void Next(); |
96 | |
97 | //! Returns the current edge. |
98 | Standard_EXPORT const TopoDS_Edge& Current() const; |
99 | |
100 | //! Returns an Orientation for the current edge. |
101 | Standard_EXPORT TopAbs_Orientation Orientation() const; |
102 | |
103 | //! Returns the vertex connecting the current edge to |
104 | //! the previous one. |
105 | Standard_EXPORT const TopoDS_Vertex& CurrentVertex() const; |
106 | |
107 | //! Clears the content of the explorer. |
108 | Standard_EXPORT void Clear(); |
109 | |
110 | |
111 | |
112 | |
113 | protected: |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | private: |
120 | |
121 | |
122 | |
123 | TopTools_DataMapOfShapeListOfShape myMap; |
124 | TopoDS_Edge myEdge; |
125 | TopoDS_Vertex myVertex; |
126 | TopoDS_Face myFace; |
127 | TopTools_MapOfShape myDoubles; |
128 | Standard_Boolean myReverse; |
129 | Standard_Real myTolU; |
130 | Standard_Real myTolV; |
131 | |
132 | |
133 | }; |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | #endif // _BRepTools_WireExplorer_HeaderFile |