summaryrefslogtreecommitdiff
path: root/inc/ShapeFix_Edge.hxx
blob: d64850a03721d8693b6653d3d133730840830087 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// 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_Edge_HeaderFile
#define _ShapeFix_Edge_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_ShapeFix_Edge_HeaderFile
#include <Handle_ShapeFix_Edge.hxx>
#endif

#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_ShapeConstruct_ProjectCurveOnSurface_HeaderFile
#include <Handle_ShapeConstruct_ProjectCurveOnSurface.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_ShapeAnalysis_Surface_HeaderFile
#include <Handle_ShapeAnalysis_Surface.hxx>
#endif
#ifndef _ShapeExtend_Status_HeaderFile
#include <ShapeExtend_Status.hxx>
#endif
class ShapeConstruct_ProjectCurveOnSurface;
class TopoDS_Edge;
class TopoDS_Face;
class Geom_Surface;
class TopLoc_Location;
class ShapeAnalysis_Surface;


//! Fixing invalid edge. <br>
//!          Geometrical and/or topological inconsistency: <br>
//!          - no 3d curve or pcurve, <br>
//!          - mismatching orientation of 3d curve and pcurve, <br>
//!          - incorrect SameParameter flag (curve deviation is greater than <br>
//!            edge tolerance), <br>
//!          - not adjacent curves (3d or pcurve) to the vertices. <br>
class ShapeFix_Edge : public MMgt_TShared {

public:

  //! Empty constructor <br>
  Standard_EXPORT   ShapeFix_Edge();
  //! Returns the projector used for recomputing missing pcurves <br>
//!          Can be used for adjusting parameters of projector <br>
  Standard_EXPORT     Handle_ShapeConstruct_ProjectCurveOnSurface Projector() ;
  
  Standard_EXPORT     Standard_Boolean FixRemovePCurve(const TopoDS_Edge& edge,const TopoDS_Face& face) ;
  //! Removes the pcurve(s) of the edge if it does not match the <br>
//!          vertices <br>
//!          Check is done <br>
//!  Use    : It is to be called when pcurve of an edge can be wrong <br>
//!          (e.g., after import from IGES) <br>
//!  Returns: True, if does not match, removed (status DONE) <br>
//!          False, (status OK) if matches or (status FAIL) if no pcurve, <br>
//!          nothing done <br>
  Standard_EXPORT     Standard_Boolean FixRemovePCurve(const TopoDS_Edge& edge,const Handle(Geom_Surface)& surface,const TopLoc_Location& location) ;
  //! Removes 3d curve of the edge if it does not match the vertices <br>
//!  Returns: True,  if does not match, removed (status DONE) <br>
//!          False, (status OK) if matches or (status FAIL) if no 3d curve, <br>
//!          nothing done <br>
  Standard_EXPORT     Standard_Boolean FixRemoveCurve3d(const TopoDS_Edge& edge) ;
  //! See method below for information <br>
  Standard_EXPORT     Standard_Boolean FixAddPCurve(const TopoDS_Edge& edge,const TopoDS_Face& face,const Standard_Boolean isSeam,const Standard_Real prec = 0.0) ;
  //! See method below for information <br>
  Standard_EXPORT     Standard_Boolean FixAddPCurve(const TopoDS_Edge& edge,const Handle(Geom_Surface)& surface,const TopLoc_Location& location,const Standard_Boolean isSeam,const Standard_Real prec = 0.0) ;
  //! See method below for information <br>
  Standard_EXPORT     Standard_Boolean FixAddPCurve(const TopoDS_Edge& edge,const TopoDS_Face& face,const Standard_Boolean isSeam,const Handle(ShapeAnalysis_Surface)& surfana,const Standard_Real prec = 0.0) ;
  //! Adds pcurve(s) of the edge if missing (by projecting 3d curve) <br>
//!          Parameter isSeam indicates if the edge is a seam. <br>
//!          The parameter <prec> defines the precision for calculations. <br>
//!          If it is 0 (default), the tolerance of the edge is taken. <br>
//!  Remark : This method is rather for internal use since it accepts parameter <br>
//!          <surfana> for optimization of computations <br>
//!  Use    : It is to be called after FixRemovePCurve (if removed) or in any <br>
//!          case when edge can have no pcurve <br>
//!  Returns: True if pcurve was added, else False <br>
//!  Status : <br>
//!          OK   : Pcurve exists <br>
//!          FAIL1: No 3d curve <br>
//!          FAIL2: fail during projecting <br>
//!          DONE1: Pcurve was added <br>
//!          DONE2: specific case of pcurve going through degenerated point on <br>
//!                 sphere encountered during projection (see class <br>
//!                 ShapeConstruct_ProjectCurveOnSurface for more info) <br>
  Standard_EXPORT     Standard_Boolean FixAddPCurve(const TopoDS_Edge& edge,const Handle(Geom_Surface)& surface,const TopLoc_Location& location,const Standard_Boolean isSeam,const Handle(ShapeAnalysis_Surface)& surfana,const Standard_Real prec = 0.0) ;
  //! Tries to build 3d curve of the edge if missing <br>
//!  Use    : It is to be called after FixRemoveCurve3d (if removed) or in any <br>
//!          case when edge can have no 3d curve <br>
//!  Returns: True if 3d curve was added, else False <br>
//!  Status : <br>
//!          OK   : 3d curve exists <br>
//!          FAIL1: BRepLib::BuildCurve3d() has failed <br>
//!          DONE1: 3d curve was added <br>
  Standard_EXPORT     Standard_Boolean FixAddCurve3d(const TopoDS_Edge& edge) ;
  
  Standard_EXPORT     Standard_Boolean FixVertexTolerance(const TopoDS_Edge& edge,const TopoDS_Face& face) ;
  //! Increases the tolerances of the edge vertices to comprise <br>
//!          the ends of 3d curve and pcurve on the given face <br>
//!          (first method) or all pcurves stored in an edge (second one) <br>
//!  Returns: True, if tolerances have been increased, otherwise False <br>
//!  Status: <br>
//!          OK   : the original tolerances have not been changed <br>
//!          DONE1: the tolerance of first vertex has been increased <br>
//!          DONE2: the tolerance of last  vertex has been increased <br>
  Standard_EXPORT     Standard_Boolean FixVertexTolerance(const TopoDS_Edge& edge) ;
  
  Standard_EXPORT     Standard_Boolean FixReversed2d(const TopoDS_Edge& edge,const TopoDS_Face& face) ;
  //! Fixes edge if pcurve is directed opposite to 3d curve <br>
//!          Check is done by call to the function <br>
//!          ShapeAnalysis_Edge::CheckCurve3dWithPCurve() <br>
//!  Warning: For seam edge this method will check and fix the pcurve in only <br>
//!          one direction. Hence, it should be called twice for seam edge: <br>
//!          once with edge orientation FORWARD and once with REVERSED. <br>
//!  Returns: False if nothing done, True if reversed (status DONE) <br>
//!  Status:  OK    - pcurve OK, nothing done <br>
//!          FAIL1 - no pcurve <br>
//!          FAIL2 - no 3d curve <br>
//!          DONE1 - pcurve was reversed <br>
  Standard_EXPORT     Standard_Boolean FixReversed2d(const TopoDS_Edge& edge,const Handle(Geom_Surface)& surface,const TopLoc_Location& location) ;
  //! Tries to make edge SameParameter and sets corresponding <br>
//!          tolerance and SameParameter flag. <br>
//!          First, it makes edge same range if SameRange flag is not set. <br>
  Standard_EXPORT     Standard_Boolean FixSameParameter(const TopoDS_Edge& edge,const Standard_Real tolerance = 0.0) ;
  //! Returns the status (in the form of True/False) of last Fix <br>
  Standard_EXPORT     Standard_Boolean Status(const ShapeExtend_Status status) const;




  DEFINE_STANDARD_RTTI(ShapeFix_Edge)

protected:


Standard_Integer myStatus;
Handle_ShapeConstruct_ProjectCurveOnSurface myProjector;


private: 




};





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


#endif