42cf5bc1 |
1 | // Created on: 1998-08-12 |
2 | // Created by: DATA EXCHANGE TEAM |
3 | // Copyright (c) 1998-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_Shape_HeaderFile |
18 | #define _ShapeFix_Shape_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TopoDS_Shape.hxx> |
24 | #include <TopTools_MapOfShape.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <ShapeFix_Root.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <ShapeExtend_Status.hxx> |
29 | #include <Standard_Real.hxx> |
e8862cf4 |
30 | |
31 | #include <Message_ProgressIndicator.hxx> |
32 | |
42cf5bc1 |
33 | class ShapeFix_Solid; |
34 | class TopoDS_Shape; |
35 | class Message_ProgressIndicator; |
36 | class ShapeFix_Shell; |
37 | class ShapeFix_Face; |
38 | class ShapeFix_Wire; |
39 | class ShapeFix_Edge; |
40 | class ShapeExtend_BasicMsgRegistrator; |
41 | |
42 | |
43 | class ShapeFix_Shape; |
44 | DEFINE_STANDARD_HANDLE(ShapeFix_Shape, ShapeFix_Root) |
45 | |
46 | //! Fixing shape in general |
47 | class ShapeFix_Shape : public ShapeFix_Root |
48 | { |
49 | |
50 | public: |
51 | |
52 | |
53 | //! Empty Constructor |
54 | Standard_EXPORT ShapeFix_Shape(); |
55 | |
56 | //! Initislises by shape. |
57 | Standard_EXPORT ShapeFix_Shape(const TopoDS_Shape& shape); |
58 | |
59 | //! Initislises by shape. |
60 | Standard_EXPORT void Init (const TopoDS_Shape& shape); |
61 | |
62 | //! Iterates on sub- shape and performs fixes |
63 | Standard_EXPORT Standard_Boolean Perform (const Handle(Message_ProgressIndicator)& theProgress = 0); |
64 | |
65 | //! Returns resulting shape |
66 | Standard_EXPORT TopoDS_Shape Shape() const; |
67 | |
68 | //! Returns tool for fixing solids. |
69 | Handle(ShapeFix_Solid) FixSolidTool() const; |
70 | |
71 | //! Returns tool for fixing shells. |
72 | Handle(ShapeFix_Shell) FixShellTool() const; |
73 | |
74 | //! Returns tool for fixing faces. |
75 | Handle(ShapeFix_Face) FixFaceTool() const; |
76 | |
77 | //! Returns tool for fixing wires. |
78 | Handle(ShapeFix_Wire) FixWireTool() const; |
79 | |
80 | //! Returns tool for fixing edges. |
81 | Handle(ShapeFix_Edge) FixEdgeTool() const; |
82 | |
83 | //! Returns the status of the last Fix. |
84 | //! This can be a combination of the following flags: |
85 | //! ShapeExtend_DONE1: some free edges were fixed |
86 | //! ShapeExtend_DONE2: some free wires were fixed |
87 | //! ShapeExtend_DONE3: some free faces were fixed |
88 | //! ShapeExtend_DONE4: some free shells were fixed |
89 | //! ShapeExtend_DONE5: some free solids were fixed |
90 | //! ShapeExtend_DONE6: shapes in compound(s) were fixed |
91 | Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const; |
92 | |
93 | //! Sets message registrator |
94 | Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE; |
95 | |
96 | //! Sets basic precision value (also to FixSolidTool) |
97 | Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) Standard_OVERRIDE; |
98 | |
99 | //! Sets minimal allowed tolerance (also to FixSolidTool) |
100 | Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) Standard_OVERRIDE; |
101 | |
102 | //! Sets maximal allowed tolerance (also to FixSolidTool) |
103 | Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) Standard_OVERRIDE; |
104 | |
105 | //! Returns (modifiable) the mode for applying fixes of |
106 | //! ShapeFix_Solid, by default True. |
107 | Standard_Integer& FixSolidMode(); |
108 | |
109 | //! Returns (modifiable) the mode for applying fixes of |
110 | //! ShapeFix_Shell, by default True. |
111 | Standard_Integer& FixFreeShellMode(); |
112 | |
113 | //! Returns (modifiable) the mode for applying fixes of |
114 | //! ShapeFix_Face, by default True. |
115 | Standard_Integer& FixFreeFaceMode(); |
116 | |
117 | //! Returns (modifiable) the mode for applying fixes of |
118 | //! ShapeFix_Wire, by default True. |
119 | Standard_Integer& FixFreeWireMode(); |
120 | |
121 | //! Returns (modifiable) the mode for applying |
122 | //! ShapeFix::SameParameter after all fixes, by default True. |
123 | Standard_Integer& FixSameParameterMode(); |
124 | |
125 | //! Returns (modifiable) the mode for applying |
126 | //! ShapeFix::FixVertexPosition before all fixes, by default False. |
127 | Standard_Integer& FixVertexPositionMode(); |
128 | |
129 | //! Returns (modifiable) the mode for fixing tolerances of vertices on whole shape |
130 | //! after performing all fixes |
131 | Standard_Integer& FixVertexTolMode(); |
132 | |
133 | |
134 | |
135 | |
92efcf78 |
136 | DEFINE_STANDARD_RTTIEXT(ShapeFix_Shape,ShapeFix_Root) |
42cf5bc1 |
137 | |
138 | protected: |
139 | |
140 | |
141 | //! Fixes same parameterization problem on the passed shape |
142 | //! by updating tolerances of the corresponding topological |
143 | //! entitites. |
144 | Standard_EXPORT void SameParameter (const TopoDS_Shape& shape, const Standard_Boolean enforce, const Handle(Message_ProgressIndicator)& theProgress = 0); |
145 | |
146 | TopoDS_Shape myResult; |
147 | Handle(ShapeFix_Solid) myFixSolid; |
148 | TopTools_MapOfShape myMapFixingShape; |
149 | Standard_Integer myFixSolidMode; |
150 | Standard_Integer myFixShellMode; |
151 | Standard_Integer myFixFaceMode; |
152 | Standard_Integer myFixWireMode; |
153 | Standard_Integer myFixSameParameterMode; |
154 | Standard_Integer myFixVertexPositionMode; |
155 | Standard_Integer myFixVertexTolMode; |
156 | Standard_Integer myStatus; |
157 | |
158 | |
159 | private: |
160 | |
161 | |
162 | |
163 | |
164 | }; |
165 | |
166 | |
167 | #include <ShapeFix_Shape.lxx> |
168 | |
169 | |
170 | |
171 | |
172 | |
173 | #endif // _ShapeFix_Shape_HeaderFile |