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_HeaderFile
0018 #define _ShapeFix_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 
0026 #include <ShapeExtend_BasicMsgRegistrator.hxx>
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class TopoDS_Shape;
0030 class ShapeExtend_BasicMsgRegistrator;
0031 class ShapeBuild_ReShape;
0032 
0033 
0034 //! This package provides algorithms for fixing
0035 //! problematic (violating Open CASCADE requirements) shapes.
0036 //! Tools from package ShapeAnalysis are used for detecting the problems. The
0037 //! detecting and fixing is done taking in account various
0038 //! criteria implemented in BRepCheck package.
0039 //! Each class of package ShapeFix deals with one
0040 //! certain type of shapes or with some family of problems.
0041 class ShapeFix 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! Runs SameParameter from BRepLib with these adaptations :
0049   //! <enforce> forces computations, else they are made only on
0050   //! Edges with flag SameParameter false
0051   //! <preci>, if not precised, is taken for each EDge as its own
0052   //! Tolerance
0053   //! Returns True when done, False if an exception has been raised
0054   //! In case of exception anyway, as many edges as possible have
0055   //! been processed. The passed progress indicator allows user
0056   //! to consult the current progress stage and abort algorithm
0057   //! if needed.
0058   Standard_EXPORT static Standard_Boolean SameParameter
0059     (const TopoDS_Shape& shape, const Standard_Boolean enforce,
0060      const Standard_Real preci = 0.0,
0061      const Message_ProgressRange& theProgress = Message_ProgressRange(),
0062      const Handle(ShapeExtend_BasicMsgRegistrator)& theMsgReg = 0);
0063   
0064   //! Runs EncodeRegularity from BRepLib taking into account
0065   //! shared components of assemblies, so that each component
0066   //! is processed only once
0067   Standard_EXPORT static void EncodeRegularity (const TopoDS_Shape& shape, const Standard_Real tolang = 1.0e-10);
0068   
0069   //! Removes edges which are less than given tolerance from shape
0070   //! with help of ShapeFix_Wire::FixSmall()
0071   Standard_EXPORT static TopoDS_Shape RemoveSmallEdges (TopoDS_Shape& shape, const Standard_Real Tolerance, Handle(ShapeBuild_ReShape)& context);
0072   
0073   //! Fix position of the vertices having tolerance more tnan specified one.;
0074   Standard_EXPORT static Standard_Boolean FixVertexPosition (TopoDS_Shape& theshape, const Standard_Real theTolerance, const Handle(ShapeBuild_ReShape)& thecontext);
0075   
0076   //! Calculate size of least edge;
0077   Standard_EXPORT static Standard_Real LeastEdgeSize (TopoDS_Shape& theshape);
0078 
0079 };
0080 
0081 #endif // _ShapeFix_HeaderFile