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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepCheck_Wire_HeaderFile
18 #define _BRepCheck_Wire_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <BRepCheck_Status.hxx>
24 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
25 #include <BRepCheck_Result.hxx>
33 DEFINE_STANDARD_HANDLE(BRepCheck_Wire, BRepCheck_Result)
36 class BRepCheck_Wire : public BRepCheck_Result
42 Standard_EXPORT BRepCheck_Wire(const TopoDS_Wire& W);
44 //! if <ContextShape> is a face, consequently checks
45 //! SelfIntersect(), Closed(), Orientation() and
46 //! Closed2d until faulty is found
47 Standard_EXPORT void InContext (const TopoDS_Shape& ContextShape) Standard_OVERRIDE;
49 //! checks that the wire is not empty and "connex".
50 //! Called by constructor
51 Standard_EXPORT void Minimum() Standard_OVERRIDE;
54 Standard_EXPORT void Blind() Standard_OVERRIDE;
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
66 //! more than 3 times or in case of 2 occurrences if
67 //! not with FORWARD and REVERSED orientation.
68 //! **BRepCheck_NoError
69 Standard_EXPORT BRepCheck_Status Closed (const Standard_Boolean Update = Standard_False);
71 //! Checks if edges of the wire give a wire closed in
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);
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,
89 Standard_EXPORT BRepCheck_Status Orientation (const TopoDS_Face& F, const Standard_Boolean Update = Standard_False);
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
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);
104 //! report SelfIntersect() check would be (is) done
105 Standard_EXPORT Standard_Boolean GeometricControls() const;
107 //! set SelfIntersect() to be checked
108 Standard_EXPORT void GeometricControls (const Standard_Boolean B);
110 //! Sets status of Wire;
111 Standard_EXPORT void SetStatus (const BRepCheck_Status theStatus);
116 DEFINE_STANDARD_RTTIEXT(BRepCheck_Wire,BRepCheck_Result)
126 Standard_Boolean myCdone;
127 BRepCheck_Status myCstat;
128 TopTools_IndexedDataMapOfShapeListOfShape myMapVE;
129 Standard_Boolean myGctrl;
140 #endif // _BRepCheck_Wire_HeaderFile