42cf5bc1 |
1 | // Created on: 1995-12-12 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1995-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 _BRepCheck_Wire_HeaderFile |
18 | #define _BRepCheck_Wire_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
42cf5bc1 |
23 | #include <BRepCheck_Status.hxx> |
24 | #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> |
25 | #include <BRepCheck_Result.hxx> |
26 | class TopoDS_Wire; |
27 | class TopoDS_Shape; |
28 | class TopoDS_Face; |
29 | class TopoDS_Edge; |
30 | |
31 | |
32 | class BRepCheck_Wire; |
33 | DEFINE_STANDARD_HANDLE(BRepCheck_Wire, BRepCheck_Result) |
34 | |
35 | |
36 | class BRepCheck_Wire : public BRepCheck_Result |
37 | { |
38 | |
39 | public: |
40 | |
41 | |
42 | Standard_EXPORT BRepCheck_Wire(const TopoDS_Wire& W); |
43 | |
44 | //! if <ContextShape> is a face, consequently checks |
45 | //! SelfIntersect(), Closed(), Orientation() and |
46 | //! Closed2d until faulty is found |
79104795 |
47 | Standard_EXPORT void InContext (const TopoDS_Shape& ContextShape) Standard_OVERRIDE; |
42cf5bc1 |
48 | |
49 | //! checks that the wire is not empty and "connex". |
50 | //! Called by constructor |
79104795 |
51 | Standard_EXPORT void Minimum() Standard_OVERRIDE; |
42cf5bc1 |
52 | |
53 | //! Does nothing |
79104795 |
54 | Standard_EXPORT void Blind() Standard_OVERRIDE; |
42cf5bc1 |
55 | |
56 | //! Checks if the oriented edges of the wire give a |
57 | //! closed wire. If the wire is closed, returns |
58 | //! BRepCheck_NoError. Warning : if the first and |
59 | //! last edge are infinite, the wire will be |
60 | //! considered as a closed one. If <Update> is set to |
61 | //! Standard_True, registers the status in the list. |
62 | //! May return (and registers): |
63 | //! **BRepCheck_NotConnected, if wire is not |
64 | //! topologically closed |
65 | //! **BRepCheck_RedundantEdge, if an edge is in wire |
b81b237f |
66 | //! more than 3 times or in case of 2 occurrences if |
42cf5bc1 |
67 | //! not with FORWARD and REVERSED orientation. |
68 | //! **BRepCheck_NoError |
69 | Standard_EXPORT BRepCheck_Status Closed (const Standard_Boolean Update = Standard_False); |
70 | |
71 | //! Checks if edges of the wire give a wire closed in |
72 | //! 2d space. |
73 | //! Returns BRepCheck_NoError, or BRepCheck_NotClosed |
74 | //! If <Update> is set to Standard_True, registers the |
75 | //! status in the list. |
76 | Standard_EXPORT BRepCheck_Status Closed2d (const TopoDS_Face& F, const Standard_Boolean Update = Standard_False); |
77 | |
78 | //! Checks if the oriented edges of the wire are |
79 | //! correctly oriented. An internal call is made to |
80 | //! the method Closed. If no face exists, call the |
81 | //! method with a null face (TopoDS_face()). If |
82 | //! <Update> is set to Standard_True, registers the |
83 | //! status in the list. |
84 | //! May return (and registers): |
85 | //! BRepCheck_InvalidDegeneratedFlag, |
86 | //! BRepCheck_BadOrientationOfSubshape, |
87 | //! BRepCheck_NotClosed, |
88 | //! BRepCheck_NoError |
89 | Standard_EXPORT BRepCheck_Status Orientation (const TopoDS_Face& F, const Standard_Boolean Update = Standard_False); |
90 | |
91 | //! Checks if the wire intersect itself on the face |
92 | //! <F>. <E1> and <E2> are the first intersecting |
93 | //! edges found. <E2> may be a null edge when a |
94 | //! self-intersecting edge is found.If <Update> is set |
95 | //! to Standard_True, registers the status in the |
96 | //! list. |
97 | //! May return (and register): |
98 | //! BRepCheck_EmptyWire, |
99 | //! BRepCheck_SelfIntersectingWire, |
100 | //! BRepCheck_NoCurveOnSurface, |
101 | //! BRepCheck_NoError |
102 | Standard_EXPORT BRepCheck_Status SelfIntersect (const TopoDS_Face& F, TopoDS_Edge& E1, TopoDS_Edge& E2, const Standard_Boolean Update = Standard_False); |
103 | |
104 | //! report SelfIntersect() check would be (is) done |
105 | Standard_EXPORT Standard_Boolean GeometricControls() const; |
106 | |
107 | //! set SelfIntersect() to be checked |
108 | Standard_EXPORT void GeometricControls (const Standard_Boolean B); |
109 | |
110 | //! Sets status of Wire; |
111 | Standard_EXPORT void SetStatus (const BRepCheck_Status theStatus); |
112 | |
113 | |
114 | |
115 | |
92efcf78 |
116 | DEFINE_STANDARD_RTTIEXT(BRepCheck_Wire,BRepCheck_Result) |
42cf5bc1 |
117 | |
118 | protected: |
119 | |
120 | |
121 | |
122 | |
123 | private: |
124 | |
125 | |
126 | Standard_Boolean myCdone; |
127 | BRepCheck_Status myCstat; |
128 | TopTools_IndexedDataMapOfShapeListOfShape myMapVE; |
129 | Standard_Boolean myGctrl; |
130 | |
131 | |
132 | }; |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | #endif // _BRepCheck_Wire_HeaderFile |