42cf5bc1 |
1 | // Created on: 1992-11-19 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1992-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 _BRepClass_FaceExplorer_HeaderFile |
18 | #define _BRepClass_FaceExplorer_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopoDS_Face.hxx> |
25 | #include <TopExp_Explorer.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <TopAbs_Orientation.hxx> |
30 | class TopoDS_Face; |
31 | class gp_Pnt2d; |
32 | class gp_Lin2d; |
33 | class BRepClass_Edge; |
34 | |
35 | |
36 | //! Provide an exploration of a BRep Face for the |
37 | //! classification. Return UV edges. |
38 | class BRepClass_FaceExplorer |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
44 | |
45 | Standard_EXPORT BRepClass_FaceExplorer(const TopoDS_Face& F); |
a148c938 |
46 | |
47 | //! Checks the point and change its coords if it is located too far |
48 | //! from the bounding box of the face. New Coordinates of the point |
49 | //! will be on the line between the point and the center of the |
50 | //! bounding box. Returns True if point was not changed. |
51 | Standard_EXPORT Standard_Boolean CheckPoint (gp_Pnt2d& thePoint); |
42cf5bc1 |
52 | |
53 | //! Should return True if the point is outside a |
54 | //! bounding volume of the face. |
55 | Standard_EXPORT Standard_Boolean Reject (const gp_Pnt2d& P) const; |
56 | |
57 | //! Returns in <L>, <Par> a segment having at least |
58 | //! one intersection with the face boundary to |
59 | //! compute intersections. |
60 | Standard_EXPORT Standard_Boolean Segment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par); |
61 | |
62 | //! Returns in <L>, <Par> a segment having at least |
63 | //! one intersection with the face boundary to |
64 | //! compute intersections. Each call gives another segment. |
65 | Standard_EXPORT Standard_Boolean OtherSegment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par); |
66 | |
67 | //! Starts an exploration of the wires. |
68 | Standard_EXPORT void InitWires(); |
69 | |
70 | //! Returns True if there is a current wire. |
71 | Standard_Boolean MoreWires() const; |
72 | |
73 | //! Sets the explorer to the next wire. |
74 | void NextWire(); |
75 | |
76 | //! Returns True if the wire bounding volume does not |
77 | //! intersect the segment. |
78 | Standard_EXPORT Standard_Boolean RejectWire (const gp_Lin2d& L, const Standard_Real Par) const; |
79 | |
80 | //! Starts an exploration of the edges of the current |
81 | //! wire. |
82 | Standard_EXPORT void InitEdges(); |
83 | |
84 | //! Returns True if there is a current edge. |
85 | Standard_Boolean MoreEdges() const; |
86 | |
87 | //! Sets the explorer to the next edge. |
88 | void NextEdge(); |
89 | |
90 | //! Returns True if the edge bounding volume does not |
91 | //! intersect the segment. |
92 | Standard_EXPORT Standard_Boolean RejectEdge (const gp_Lin2d& L, const Standard_Real Par) const; |
93 | |
94 | //! Current edge in current wire and its orientation. |
95 | Standard_EXPORT void CurrentEdge (BRepClass_Edge& E, TopAbs_Orientation& Or) const; |
96 | |
97 | |
98 | |
99 | |
100 | protected: |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | private: |
107 | |
108 | |
109 | |
110 | TopoDS_Face myFace; |
111 | TopExp_Explorer myWExplorer; |
112 | TopExp_Explorer myEExplorer; |
113 | Standard_Integer myCurEdgeInd; |
114 | Standard_Real myCurEdgePar; |
115 | |
116 | |
117 | }; |
118 | |
119 | |
120 | #include <BRepClass_FaceExplorer.lxx> |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | #endif // _BRepClass_FaceExplorer_HeaderFile |