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