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
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 _ShapeFix_Shape_HeaderFile
18 #define _ShapeFix_Shape_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
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>
31 #include <Message_ProgressIndicator.hxx>
34 class Message_ProgressIndicator;
39 class ShapeExtend_BasicMsgRegistrator;
41 // resolve name collisions with X11 headers
47 DEFINE_STANDARD_HANDLE(ShapeFix_Shape, ShapeFix_Root)
49 //! Fixing shape in general
50 class ShapeFix_Shape : public ShapeFix_Root
57 Standard_EXPORT ShapeFix_Shape();
59 //! Initislises by shape.
60 Standard_EXPORT ShapeFix_Shape(const TopoDS_Shape& shape);
62 //! Initislises by shape.
63 Standard_EXPORT void Init (const TopoDS_Shape& shape);
65 //! Iterates on sub- shape and performs fixes
66 Standard_EXPORT Standard_Boolean Perform (const Handle(Message_ProgressIndicator)& theProgress = 0);
68 //! Returns resulting shape
69 Standard_EXPORT TopoDS_Shape Shape() const;
71 //! Returns tool for fixing solids.
72 Handle(ShapeFix_Solid) FixSolidTool() const;
74 //! Returns tool for fixing shells.
75 Handle(ShapeFix_Shell) FixShellTool() const;
77 //! Returns tool for fixing faces.
78 Handle(ShapeFix_Face) FixFaceTool() const;
80 //! Returns tool for fixing wires.
81 Handle(ShapeFix_Wire) FixWireTool() const;
83 //! Returns tool for fixing edges.
84 Handle(ShapeFix_Edge) FixEdgeTool() const;
86 //! Returns the status of the last Fix.
87 //! This can be a combination of the following flags:
88 //! ShapeExtend_DONE1: some free edges were fixed
89 //! ShapeExtend_DONE2: some free wires were fixed
90 //! ShapeExtend_DONE3: some free faces were fixed
91 //! ShapeExtend_DONE4: some free shells were fixed
92 //! ShapeExtend_DONE5: some free solids were fixed
93 //! ShapeExtend_DONE6: shapes in compound(s) were fixed
94 Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
96 //! Sets message registrator
97 Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE;
99 //! Sets basic precision value (also to FixSolidTool)
100 Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) Standard_OVERRIDE;
102 //! Sets minimal allowed tolerance (also to FixSolidTool)
103 Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) Standard_OVERRIDE;
105 //! Sets maximal allowed tolerance (also to FixSolidTool)
106 Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) Standard_OVERRIDE;
108 //! Returns (modifiable) the mode for applying fixes of
109 //! ShapeFix_Solid, by default True.
110 Standard_Integer& FixSolidMode();
112 //! Returns (modifiable) the mode for applying fixes of
113 //! ShapeFix_Shell, by default True.
114 Standard_Integer& FixFreeShellMode();
116 //! Returns (modifiable) the mode for applying fixes of
117 //! ShapeFix_Face, by default True.
118 Standard_Integer& FixFreeFaceMode();
120 //! Returns (modifiable) the mode for applying fixes of
121 //! ShapeFix_Wire, by default True.
122 Standard_Integer& FixFreeWireMode();
124 //! Returns (modifiable) the mode for applying
125 //! ShapeFix::SameParameter after all fixes, by default True.
126 Standard_Integer& FixSameParameterMode();
128 //! Returns (modifiable) the mode for applying
129 //! ShapeFix::FixVertexPosition before all fixes, by default False.
130 Standard_Integer& FixVertexPositionMode();
132 //! Returns (modifiable) the mode for fixing tolerances of vertices on whole shape
133 //! after performing all fixes
134 Standard_Integer& FixVertexTolMode();
139 DEFINE_STANDARD_RTTIEXT(ShapeFix_Shape,ShapeFix_Root)
144 //! Fixes same parameterization problem on the passed shape
145 //! by updating tolerances of the corresponding topological
147 Standard_EXPORT void SameParameter (const TopoDS_Shape& shape, const Standard_Boolean enforce, const Handle(Message_ProgressIndicator)& theProgress = 0);
149 TopoDS_Shape myResult;
150 Handle(ShapeFix_Solid) myFixSolid;
151 TopTools_MapOfShape myMapFixingShape;
152 Standard_Integer myFixSolidMode;
153 Standard_Integer myFixShellMode;
154 Standard_Integer myFixFaceMode;
155 Standard_Integer myFixWireMode;
156 Standard_Integer myFixSameParameterMode;
157 Standard_Integer myFixVertexPositionMode;
158 Standard_Integer myFixVertexTolMode;
159 Standard_Integer myStatus;
170 #include <ShapeFix_Shape.lxx>
176 #endif // _ShapeFix_Shape_HeaderFile