Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:56

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeFix_Solid_HeaderFile
0018 #define _ShapeFix_Solid_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <ShapeFix_Root.hxx>
0026 #include <ShapeExtend_Status.hxx>
0027 class ShapeFix_Shell;
0028 class TopoDS_Solid;
0029 class TopoDS_Shell;
0030 class ShapeExtend_BasicMsgRegistrator;
0031 
0032 // resolve name collisions with X11 headers
0033 #ifdef Status
0034   #undef Status
0035 #endif
0036 
0037 class ShapeFix_Solid;
0038 DEFINE_STANDARD_HANDLE(ShapeFix_Solid, ShapeFix_Root)
0039 
0040 //! Provides method to build a solid from a shells and
0041 //! orients them in order to have a valid solid with finite volume
0042 class ShapeFix_Solid : public ShapeFix_Root
0043 {
0044 
0045 public:
0046 
0047   
0048   //! Empty constructor;
0049   Standard_EXPORT ShapeFix_Solid();
0050   
0051   //! Initializes by solid.
0052   Standard_EXPORT ShapeFix_Solid(const TopoDS_Solid& solid);
0053   
0054   //! Initializes by solid .
0055   Standard_EXPORT virtual void Init (const TopoDS_Solid& solid);
0056   
0057   //! Iterates on shells and performs fixes
0058   //! (calls ShapeFix_Shell for each subshell). The passed
0059   //! progress indicator allows user to consult the current
0060   //! progress stage and abort algorithm if needed.
0061   Standard_EXPORT virtual Standard_Boolean Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
0062   
0063   //! Calls MakeSolid and orients the solid to be "not infinite"
0064   Standard_EXPORT TopoDS_Solid SolidFromShell (const TopoDS_Shell& shell);
0065   
0066   //! Returns the status of the last Fix.
0067   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
0068   
0069   //! Returns resulting solid.
0070   Standard_EXPORT TopoDS_Shape Solid() const;
0071   
0072   //! Returns tool for fixing shells.
0073   Handle(ShapeFix_Shell) FixShellTool() const
0074   {
0075     return myFixShell;
0076   }
0077   
0078   //! Sets message registrator
0079   Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE;
0080   
0081   //! Sets basic precision value (also to FixShellTool)
0082   Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) Standard_OVERRIDE;
0083   
0084   //! Sets minimal allowed tolerance (also to FixShellTool)
0085   Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) Standard_OVERRIDE;
0086   
0087   //! Sets maximal allowed tolerance (also to FixShellTool)
0088   Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) Standard_OVERRIDE;
0089   
0090   //! Returns (modifiable) the mode for applying fixes of
0091   //! ShapeFix_Shell, by default True.
0092   Standard_Integer& FixShellMode()
0093   {
0094     return myFixShellMode;
0095   }
0096   
0097   //! Returns (modifiable) the mode for applying analysis and fixes of
0098   //! orientation of shells in the solid; by default True.
0099   Standard_Integer& FixShellOrientationMode()
0100   {
0101     return myFixShellOrientationMode;
0102   }
0103   
0104   //! Returns (modifiable) the mode for creation of solids.
0105   //! If mode myCreateOpenSolidMode is equal to true
0106   //! solids are created from open shells
0107   //! else solids are created  from closed shells only.
0108   //! ShapeFix_Shell, by default False.
0109   Standard_Boolean& CreateOpenSolidMode()
0110   {
0111     return myCreateOpenSolidMode;
0112   }
0113   
0114   //! In case of multiconnexity returns compound of fixed solids
0115   //! else returns one solid.
0116   Standard_EXPORT TopoDS_Shape Shape();
0117 
0118   DEFINE_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root)
0119 
0120 protected:
0121   TopoDS_Shape mySolid;
0122   Handle(ShapeFix_Shell) myFixShell;
0123   Standard_Integer myStatus;
0124   Standard_Integer myFixShellMode;
0125   Standard_Integer myFixShellOrientationMode;
0126   Standard_Boolean myCreateOpenSolidMode;
0127 };
0128 
0129 #endif // _ShapeFix_Solid_HeaderFile