summaryrefslogtreecommitdiff
path: root/inc/ShapeFix_Wireframe.hxx
blob: f244214dbeca302104d363f1d732646a389a8c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _ShapeFix_Wireframe_HeaderFile
#define _ShapeFix_Wireframe_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_ShapeFix_Wireframe_HeaderFile
#include <Handle_ShapeFix_Wireframe.hxx>
#endif

#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _ShapeFix_Root_HeaderFile
#include <ShapeFix_Root.hxx>
#endif
#ifndef _ShapeExtend_Status_HeaderFile
#include <ShapeExtend_Status.hxx>
#endif
class TopoDS_Shape;
class TopTools_MapOfShape;
class TopTools_DataMapOfShapeListOfShape;


//! Provides methods for fixing wireframe of shape <br>
class ShapeFix_Wireframe : public ShapeFix_Root {

public:

  
  Standard_EXPORT   ShapeFix_Wireframe();
  
  Standard_EXPORT   ShapeFix_Wireframe(const TopoDS_Shape& shape);
  //! Clears all statuses <br>
  Standard_EXPORT   virtual  void ClearStatuses() ;
  //! Loads a shape, resets statuses <br>
  Standard_EXPORT     void Load(const TopoDS_Shape& shape) ;
  //! Fixes gaps between ends of curves of adjacent edges <br>
//!           (both 3d and pcurves) in wires <br>
//!           If precision is 0.0, uses Precision::Confusion(). <br>
  Standard_EXPORT     Standard_Boolean FixWireGaps() ;
  //! Fixes small edges in shape by merging adjacent edges <br>
//!           If precision is 0.0, uses Precision::Confusion(). <br>
  Standard_EXPORT     Standard_Boolean FixSmallEdges() ;
  //! Auxiliary tool for FixSmallEdges which checks for small edges and fills the maps. <br>
//!          Returns True if at least one small edge has been found. <br>
  Standard_EXPORT     Standard_Boolean CheckSmallEdges(TopTools_MapOfShape& theSmallEdges,TopTools_DataMapOfShapeListOfShape& theEdgeToFaces,TopTools_DataMapOfShapeListOfShape& theFaceWithSmall,TopTools_MapOfShape& theMultyEdges) ;
  //! Auxiliary tool for FixSmallEdges which merges small edges. <br>
//!          If theModeDrop is equal to Standard_True then small edges, <br>
//!          which cannot be connected with adjacent edges are dropped. <br>
//!          Otherwise they are kept. <br>
//!          theLimitAngle specifies maximum allowed tangency <br>
//!          discontinuity between adjacent edges. <br>
//!          If theLimitAngle is equal to -1, this angle is not taken into account. <br>
  Standard_EXPORT     Standard_Boolean MergeSmallEdges(TopTools_MapOfShape& theSmallEdges,TopTools_DataMapOfShapeListOfShape& theEdgeToFaces,TopTools_DataMapOfShapeListOfShape& theFaceWithSmall,TopTools_MapOfShape& theMultyEdges,const Standard_Boolean theModeDrop = Standard_False,const Standard_Real theLimitAngle = -1) ;
  //! Decodes the status of the last FixWireGaps. <br>
//!           OK - No gaps were found <br>
//!           DONE1 - Some gaps in 3D were fixed <br>
//!           DONE2 - Some gaps in 2D were fixed <br>
//!           FAIL1 - Failed to fix some gaps in 3D <br>
//!           FAIL2 - Failed to fix some gaps in 2D <br>
        Standard_Boolean StatusWireGaps(const ShapeExtend_Status status) const;
  //! Decodes the status of the last FixSmallEdges. <br>
//!           OK - No small edges were found <br>
//!           DONE1 - Some small edges were fixed <br>
//!           FAIL1 - Failed to fix some small edges <br>
        Standard_Boolean StatusSmallEdges(const ShapeExtend_Status status) const;
  
        TopoDS_Shape Shape() ;
  //! Returns mode managing removing small edges. <br>
        Standard_Boolean& ModeDropSmallEdges() ;
  //!Set limit angle for merging edges. <br>
        void SetLimitAngle(const Standard_Real theLimitAngle) ;
  //!Get limit angle for merging edges. <br>
        Standard_Real LimitAngle() const;




  DEFINE_STANDARD_RTTI(ShapeFix_Wireframe)

protected:


TopoDS_Shape myShape;


private: 


Standard_Boolean myModeDrop;
Standard_Real myLimitAngle;
Standard_Integer myStatusWireGaps;
Standard_Integer myStatusSmallEdges;


};


#include <ShapeFix_Wireframe.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif