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_HeaderFile
18 #define _ShapeFix_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Real.hxx>
27 #include <ShapeExtend_BasicMsgRegistrator.hxx>
28 #include <Message_ProgressRange.hxx>
31 class ShapeExtend_BasicMsgRegistrator;
32 class ShapeBuild_ReShape;
35 //! This package provides algorithms for fixing
36 //! problematic (violating Open CASCADE requirements) shapes.
37 //! Tools from package ShapeAnalysis are used for detecting the problems. The
38 //! detecting and fixing is done taking in account various
39 //! criteria implemented in BRepCheck package.
40 //! Each class of package ShapeFix deals with one
41 //! certain type of shapes or with some family of problems.
49 //! Runs SameParameter from BRepLib with these adaptations :
50 //! <enforce> forces computations, else they are made only on
51 //! Edges with flag SameParameter false
52 //! <preci>, if not precised, is taken for each EDge as its own
54 //! Returns True when done, False if an exception has been raised
55 //! In case of exception anyway, as many edges as possible have
56 //! been processed. The passed progress indicator allows user
57 //! to consult the current progress stage and abort algorithm
59 Standard_EXPORT static Standard_Boolean SameParameter
60 (const TopoDS_Shape& shape, const Standard_Boolean enforce,
61 const Standard_Real preci = 0.0,
62 const Message_ProgressRange& theProgress = Message_ProgressRange(),
63 const Handle(ShapeExtend_BasicMsgRegistrator)& theMsgReg = 0);
65 //! Runs EncodeRegularity from BRepLib taking into account
66 //! shared components of assemblies, so that each component
67 //! is processed only once
68 Standard_EXPORT static void EncodeRegularity (const TopoDS_Shape& shape, const Standard_Real tolang = 1.0e-10);
70 //! Removes edges which are less than given tolerance from shape
71 //! with help of ShapeFix_Wire::FixSmall()
72 Standard_EXPORT static TopoDS_Shape RemoveSmallEdges (TopoDS_Shape& shape, const Standard_Real Tolerance, Handle(ShapeBuild_ReShape)& context);
74 //! Fix position of the vertices having tolerance more tnan specified one.;
75 Standard_EXPORT static Standard_Boolean FixVertexPosition (TopoDS_Shape& theshape, const Standard_Real theTolerance, const Handle(ShapeBuild_ReShape)& thecontext);
77 //! Calculate size of least edge;
78 Standard_EXPORT static Standard_Real LeastEdgeSize (TopoDS_Shape& theshape);
82 #endif // _ShapeFix_HeaderFile