Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2014-11-13
0002 // Created by: Maxim YAKUNIN
0003 // Copyright (c) 2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _ShapeFix_FixSmallSolid_HeaderFile
0017 #define _ShapeFix_FixSmallSolid_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <ShapeFix_Root.hxx>
0024 class TopoDS_Shape;
0025 class ShapeBuild_ReShape;
0026 
0027 
0028 class ShapeFix_FixSmallSolid;
0029 DEFINE_STANDARD_HANDLE(ShapeFix_FixSmallSolid, ShapeFix_Root)
0030 
0031 //! Fixing solids with small size
0032 class ShapeFix_FixSmallSolid : public ShapeFix_Root
0033 {
0034 
0035 public:
0036 
0037   
0038   //! Construct
0039   Standard_EXPORT ShapeFix_FixSmallSolid();
0040   
0041   //! Set working mode for operator:
0042   //! - theMode = 0 use both WidthFactorThreshold and VolumeThreshold parameters
0043   //! - theMode = 1 use only WidthFactorThreshold parameter
0044   //! - theMode = 2 use only VolumeThreshold parameter
0045   Standard_EXPORT void SetFixMode (const Standard_Integer theMode);
0046   
0047   //! Set or clear volume threshold for small solids
0048   Standard_EXPORT void SetVolumeThreshold (const Standard_Real theThreshold = -1.0);
0049   
0050   //! Set or clear width factor threshold for small solids
0051   Standard_EXPORT void SetWidthFactorThreshold (const Standard_Real theThreshold = -1.0);
0052   
0053   //! Remove small solids from the given shape
0054   Standard_EXPORT TopoDS_Shape Remove (const TopoDS_Shape& theShape, const Handle(ShapeBuild_ReShape)& theContext) const;
0055   
0056   //! Merge small solids in the given shape to adjacent non-small ones
0057   Standard_EXPORT TopoDS_Shape Merge (const TopoDS_Shape& theShape, const Handle(ShapeBuild_ReShape)& theContext) const;
0058 
0059 
0060 
0061 
0062   DEFINE_STANDARD_RTTIEXT(ShapeFix_FixSmallSolid,ShapeFix_Root)
0063 
0064 protected:
0065 
0066 
0067 
0068 
0069 private:
0070 
0071   
0072   Standard_EXPORT Standard_Boolean IsThresholdsSet() const;
0073   
0074   Standard_EXPORT Standard_Boolean IsSmall (const TopoDS_Shape& theSolid) const;
0075   
0076   Standard_EXPORT Standard_Boolean IsUsedWidthFactorThreshold() const;
0077   
0078   Standard_EXPORT Standard_Boolean IsUsedVolumeThreshold() const;
0079 
0080   Standard_Integer myFixMode;
0081   Standard_Real myVolumeThreshold;
0082   Standard_Real myWidthFactorThreshold;
0083 
0084 
0085 };
0086 
0087 
0088 
0089 
0090 
0091 
0092 
0093 #endif // _ShapeFix_FixSmallSolid_HeaderFile