42cf5bc1 |
1 | // Created on: 1999-09-13 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 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 _ShapeFix_FixSmallFace_HeaderFile |
18 | #define _ShapeFix_FixSmallFace_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TopoDS_Shape.hxx> |
24 | #include <Standard_Integer.hxx> |
25 | #include <ShapeAnalysis_CheckSmallFace.hxx> |
26 | #include <ShapeFix_Root.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <Standard_Real.hxx> |
29 | class TopoDS_Shape; |
30 | class TopoDS_Face; |
31 | class TopoDS_Edge; |
32 | class TopoDS_Compound; |
33 | |
34 | |
35 | class ShapeFix_FixSmallFace; |
36 | DEFINE_STANDARD_HANDLE(ShapeFix_FixSmallFace, ShapeFix_Root) |
37 | |
38 | //! Fixing face with small size |
39 | class ShapeFix_FixSmallFace : public ShapeFix_Root |
40 | { |
41 | |
42 | public: |
43 | |
44 | |
45 | Standard_EXPORT ShapeFix_FixSmallFace(); |
46 | |
47 | Standard_EXPORT void Init (const TopoDS_Shape& S); |
48 | |
49 | |
50 | //! Fixing case of spot face |
51 | Standard_EXPORT void Perform(); |
52 | |
53 | //! Fixing case of spot face, if tol = -1 used local tolerance. |
54 | Standard_EXPORT TopoDS_Shape FixSpotFace(); |
55 | |
56 | //! Compute average vertex and replacing vertices by new one. |
57 | Standard_EXPORT Standard_Boolean ReplaceVerticesInCaseOfSpot (TopoDS_Face& F, const Standard_Real tol) const; |
58 | |
59 | //! Remove spot face from compound |
60 | Standard_EXPORT Standard_Boolean RemoveFacesInCaseOfSpot (const TopoDS_Face& F) const; |
61 | |
62 | //! Fixing case of strip face, if tol = -1 used local tolerance |
63 | Standard_EXPORT TopoDS_Shape FixStripFace (const Standard_Boolean wasdone = Standard_False); |
64 | |
65 | //! Replace veretces and edges. |
66 | Standard_EXPORT Standard_Boolean ReplaceInCaseOfStrip (TopoDS_Face& F, TopoDS_Edge& E1, TopoDS_Edge& E2, const Standard_Real tol) const; |
67 | |
68 | //! Remove strip face from compound. |
69 | Standard_EXPORT Standard_Boolean RemoveFacesInCaseOfStrip (const TopoDS_Face& F) const; |
70 | |
71 | //! Compute average edge for strip face |
72 | Standard_EXPORT TopoDS_Edge ComputeSharedEdgeForStripFace (const TopoDS_Face& F, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Face& F1, const Standard_Real tol) const; |
73 | |
74 | Standard_EXPORT TopoDS_Shape FixSplitFace (const TopoDS_Shape& S); |
75 | |
76 | //! Compute data for face splitting. |
77 | Standard_EXPORT Standard_Boolean SplitOneFace (TopoDS_Face& F, TopoDS_Compound& theSplittedFaces); |
78 | |
79 | Standard_EXPORT TopoDS_Face FixFace (const TopoDS_Face& F); |
80 | |
81 | Standard_EXPORT TopoDS_Shape FixShape(); |
82 | |
83 | Standard_EXPORT TopoDS_Shape Shape(); |
84 | |
85 | Standard_EXPORT Standard_Boolean FixPinFace (TopoDS_Face& F); |
86 | |
87 | |
88 | |
89 | |
92efcf78 |
90 | DEFINE_STANDARD_RTTIEXT(ShapeFix_FixSmallFace,ShapeFix_Root) |
42cf5bc1 |
91 | |
92 | protected: |
93 | |
94 | |
95 | |
96 | |
97 | private: |
98 | |
99 | |
100 | TopoDS_Shape myShape; |
101 | TopoDS_Shape myResult; |
102 | Standard_Integer myStatus; |
103 | ShapeAnalysis_CheckSmallFace myAnalyzer; |
104 | |
105 | |
106 | }; |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | #endif // _ShapeFix_FixSmallFace_HeaderFile |