Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/ShapeFix_FixSmallSolid.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 //! Fixing solids with small size
0028 class ShapeFix_FixSmallSolid : public ShapeFix_Root
0029 {
0030 
0031 public:
0032   //! Construct
0033   Standard_EXPORT ShapeFix_FixSmallSolid();
0034 
0035   //! Set working mode for operator:
0036   //! - theMode = 0 use both WidthFactorThreshold and VolumeThreshold parameters
0037   //! - theMode = 1 use only WidthFactorThreshold parameter
0038   //! - theMode = 2 use only VolumeThreshold parameter
0039   Standard_EXPORT void SetFixMode(const int theMode);
0040 
0041   //! Set or clear volume threshold for small solids
0042   Standard_EXPORT void SetVolumeThreshold(const double theThreshold = -1.0);
0043 
0044   //! Set or clear width factor threshold for small solids
0045   Standard_EXPORT void SetWidthFactorThreshold(const double theThreshold = -1.0);
0046 
0047   //! Remove small solids from the given shape
0048   Standard_EXPORT TopoDS_Shape Remove(const TopoDS_Shape&                    theShape,
0049                                       const occ::handle<ShapeBuild_ReShape>& theContext) const;
0050 
0051   //! Merge small solids in the given shape to adjacent non-small ones
0052   Standard_EXPORT TopoDS_Shape Merge(const TopoDS_Shape&                    theShape,
0053                                      const occ::handle<ShapeBuild_ReShape>& theContext) const;
0054 
0055   DEFINE_STANDARD_RTTIEXT(ShapeFix_FixSmallSolid, ShapeFix_Root)
0056 
0057 private:
0058   Standard_EXPORT bool IsThresholdsSet() const;
0059 
0060   Standard_EXPORT bool IsSmall(const TopoDS_Shape& theSolid) const;
0061 
0062   Standard_EXPORT bool IsUsedWidthFactorThreshold() const;
0063 
0064   Standard_EXPORT bool IsUsedVolumeThreshold() const;
0065 
0066   int    myFixMode;
0067   double myVolumeThreshold;
0068   double myWidthFactorThreshold;
0069 };
0070 
0071 #endif // _ShapeFix_FixSmallSolid_HeaderFile