1 // Created on: 1998-06-03
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_Solid_HeaderFile
18 #define _ShapeFix_Solid_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <ShapeFix_Root.hxx>
27 #include <ShapeExtend_Status.hxx>
28 #include <Standard_Real.hxx>
31 class Message_ProgressIndicator;
34 class ShapeExtend_BasicMsgRegistrator;
38 DEFINE_STANDARD_HANDLE(ShapeFix_Solid, ShapeFix_Root)
40 //! Provides method to build a solid from a shells and
41 //! orients them in order to have a valid solid with finite volume
42 class ShapeFix_Solid : public ShapeFix_Root
48 //! Empty constructor;
49 Standard_EXPORT ShapeFix_Solid();
51 //! Initializes by solid.
52 Standard_EXPORT ShapeFix_Solid(const TopoDS_Solid& solid);
54 //! Initializes by solid .
55 Standard_EXPORT virtual void Init (const TopoDS_Solid& solid);
57 //! Iterates on shells and performs fixes
58 //! (calls ShapeFix_Shell for each subshell). The passed
59 //! progress indicator allows user to consult the current
60 //! progress stage and abort algorithm if needed.
61 Standard_EXPORT virtual Standard_Boolean Perform (const Handle(Message_ProgressIndicator)& theProgress = 0);
63 //! Calls MakeSolid and orients the solid to be "not infinite"
64 Standard_EXPORT TopoDS_Solid SolidFromShell (const TopoDS_Shell& shell);
66 //! Returns the status of the last Fix.
67 Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
69 //! Returns resulting solid.
70 Standard_EXPORT TopoDS_Shape Solid() const;
72 //! Returns tool for fixing shells.
73 Handle(ShapeFix_Shell) FixShellTool() const;
75 //! Sets message registrator
76 Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE;
78 //! Sets basic precision value (also to FixShellTool)
79 Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) Standard_OVERRIDE;
81 //! Sets minimal allowed tolerance (also to FixShellTool)
82 Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) Standard_OVERRIDE;
84 //! Sets maximal allowed tolerance (also to FixShellTool)
85 Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) Standard_OVERRIDE;
87 //! Returns (modifiable) the mode for applying fixes of
88 //! ShapeFix_Shell, by default True.
89 Standard_Integer& FixShellMode();
91 //! Returns (modifiable) the mode for creation of solids.
92 //! If mode myCreateOpenSolidMode is equal to true
93 //! solids are created from open shells
94 //! else solids are created from closed shells only.
95 //! ShapeFix_Shell, by default False.
96 Standard_Boolean& CreateOpenSolidMode();
98 //! In case of multiconnexity returns compound of fixed solids
99 //! else returns one solid.
100 Standard_EXPORT TopoDS_Shape Shape();
105 DEFINE_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root)
110 TopoDS_Shape mySolid;
111 Handle(ShapeFix_Shell) myFixShell;
112 Standard_Integer myStatus;
113 Standard_Integer myFixShellMode;
119 Standard_Boolean myCreateOpenSolidMode;
125 #include <ShapeFix_Solid.lxx>
131 #endif // _ShapeFix_Solid_HeaderFile