0025748: Parallel version of progress indicator
[occt.git] / src / ShapeFix / ShapeFix.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _ShapeFix_HeaderFile
18#define _ShapeFix_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Boolean.hxx>
25#include <Standard_Real.hxx>
e8862cf4 26
e8862cf4 27#include <ShapeExtend_BasicMsgRegistrator.hxx>
7e785937 28#include <Message_ProgressRange.hxx>
e8862cf4 29
42cf5bc1 30class TopoDS_Shape;
42cf5bc1 31class ShapeExtend_BasicMsgRegistrator;
32class ShapeBuild_ReShape;
33class ShapeFix_Root;
34class ShapeFix_EdgeProjAux;
35class ShapeFix_Edge;
36class ShapeFix_Wire;
37class ShapeFix_Face;
38class ShapeFix_FixSmallFace;
39class ShapeFix_FixSmallSolid;
40class ShapeFix_WireVertex;
41class ShapeFix_Wireframe;
42class ShapeFix_FreeBounds;
43class ShapeFix_FaceConnect;
44class ShapeFix_Shell;
45class ShapeFix_Solid;
46class ShapeFix_ShapeTolerance;
47class ShapeFix_Shape;
48class ShapeFix_EdgeConnect;
49class ShapeFix_ComposeShell;
50class ShapeFix_SplitCommonVertex;
51class ShapeFix_WireSegment;
52class ShapeFix_IntersectionTool;
53class ShapeFix_SplitTool;
54
55
56//! This package provides algorithms for fixing
57//! problematic (violating Open CASCADE requirements) shapes.
58//! Tools from package ShapeAnalysis are used for detecting the problems. The
59//! detecting and fixing is done taking in account various
60//! criteria implemented in BRepCheck package.
61//! Each class of package ShapeFix deals with one
62//! certain type of shapes or with some family of problems.
63class ShapeFix
64{
65public:
66
67 DEFINE_STANDARD_ALLOC
68
69
70 //! Runs SameParameter from BRepLib with these adaptations :
71 //! <enforce> forces computations, else they are made only on
72 //! Edges with flag SameParameter false
73 //! <preci>, if not precised, is taken for each EDge as its own
74 //! Tolerance
75 //! Returns True when done, False if an exception has been raised
76 //! In case of exception anyway, as many edges as possible have
77 //! been processed. The passed progress indicator allows user
78 //! to consult the current progress stage and abort algorithm
79 //! if needed.
7e785937 80 Standard_EXPORT static Standard_Boolean SameParameter
81 (const TopoDS_Shape& shape, const Standard_Boolean enforce,
82 const Standard_Real preci = 0.0,
83 const Message_ProgressRange& theProgress = Message_ProgressRange(),
84 const Handle(ShapeExtend_BasicMsgRegistrator)& theMsgReg = 0);
42cf5bc1 85
86 //! Runs EncodeRegularity from BRepLib taking into account
87 //! shared components of assemblies, so that each component
88 //! is processed only once
89 Standard_EXPORT static void EncodeRegularity (const TopoDS_Shape& shape, const Standard_Real tolang = 1.0e-10);
90
91 //! Removes edges which are less than given tolerance from shape
92 //! with help of ShapeFix_Wire::FixSmall()
93 Standard_EXPORT static TopoDS_Shape RemoveSmallEdges (TopoDS_Shape& shape, const Standard_Real Tolerance, Handle(ShapeBuild_ReShape)& context);
94
95 //! Fix position of the vertices having tolerance more tnan specified one.;
96 Standard_EXPORT static Standard_Boolean FixVertexPosition (TopoDS_Shape& theshape, const Standard_Real theTolerance, const Handle(ShapeBuild_ReShape)& thecontext);
97
98 //! Calculate size of least edge;
99 Standard_EXPORT static Standard_Real LeastEdgeSize (TopoDS_Shape& theshape);
100
101
102
103
104protected:
105
106
107
108
109
110private:
111
112
113
114
115friend class ShapeFix_Root;
116friend class ShapeFix_EdgeProjAux;
117friend class ShapeFix_Edge;
118friend class ShapeFix_Wire;
119friend class ShapeFix_Face;
120friend class ShapeFix_FixSmallFace;
121friend class ShapeFix_FixSmallSolid;
122friend class ShapeFix_WireVertex;
123friend class ShapeFix_Wireframe;
124friend class ShapeFix_FreeBounds;
125friend class ShapeFix_FaceConnect;
126friend class ShapeFix_Shell;
127friend class ShapeFix_Solid;
128friend class ShapeFix_ShapeTolerance;
129friend class ShapeFix_Shape;
130friend class ShapeFix_EdgeConnect;
131friend class ShapeFix_ComposeShell;
132friend class ShapeFix_SplitCommonVertex;
133friend class ShapeFix_WireSegment;
134friend class ShapeFix_IntersectionTool;
135friend class ShapeFix_SplitTool;
136
137};
138
139
140
141
142
143
144
145#endif // _ShapeFix_HeaderFile