summaryrefslogtreecommitdiff
path: root/inc/BRepFill_Filling.hxx
blob: 78582d168ca36bb17f20b89ddfd5558d40d02971 (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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// 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 _BRepFill_Filling_HeaderFile
#define _BRepFill_Filling_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _GeomPlate_BuildPlateSurface_HeaderFile
#include <GeomPlate_BuildPlateSurface.hxx>
#endif
#ifndef _BRepFill_SequenceOfEdgeFaceAndOrder_HeaderFile
#include <BRepFill_SequenceOfEdgeFaceAndOrder.hxx>
#endif
#ifndef _BRepFill_SequenceOfFaceAndOrder_HeaderFile
#include <BRepFill_SequenceOfFaceAndOrder.hxx>
#endif
#ifndef _GeomPlate_SequenceOfPointConstraint_HeaderFile
#include <GeomPlate_SequenceOfPointConstraint.hxx>
#endif
#ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_ConstructionError;
class TopoDS_Face;
class TopoDS_Edge;
class gp_Pnt;
class BRepFill_SequenceOfEdgeFaceAndOrder;
class TopTools_MapOfShape;
class TColgp_SequenceOfPnt;


//! N-Side Filling <br>
//!  This algorithm avoids to build a face from: <br>
//!  * a set of edges defining the bounds of the face and some <br>
//!    constraints the surface support has to satisfy <br>
//!  * a set of edges and points defining some constraints <br>
//!    the support surface has to satisfy <br>
//!  * an initial surface to deform for satisfying the constraints <br>
//!  * a set of parameters to control the constraints. <br>
class BRepFill_Filling  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Constructor <br>
  Standard_EXPORT   BRepFill_Filling(const Standard_Integer Degree = 3,const Standard_Integer NbPtsOnCur = 15,const Standard_Integer NbIter = 2,const Standard_Boolean Anisotropie = Standard_False,const Standard_Real Tol2d = 0.00001,const Standard_Real Tol3d = 0.0001,const Standard_Real TolAng = 0.01,const Standard_Real TolCurv = 0.1,const Standard_Integer MaxDeg = 8,const Standard_Integer MaxSegments = 9);
  //! Sets the values of Tolerances used to control the constraint. <br>
//!	Tol2d: <br>
//!	Tol3d:   it is the maximum distance allowed between the support surface <br>
//!	         and the constraints <br>
//!	TolAng:  it is the maximum angle allowed between the normal of the surface <br>
//!	         and the constraints <br>
//!	TolCurv: it is the maximum difference of curvature allowed between <br>
//!	         the surface and the constraint <br>
  Standard_EXPORT     void SetConstrParam(const Standard_Real Tol2d = 0.00001,const Standard_Real Tol3d = 0.0001,const Standard_Real TolAng = 0.01,const Standard_Real TolCurv = 0.1) ;
  //! Sets the parameters used for resolution. <br>
//!	The default values of these parameters have been chosen for a good <br>
//!	ratio quality/performance. <br>
//!	Degree:      it is the order of energy criterion to minimize for computing <br>
//!	             the deformation of the surface. <br>
//!	             The default value is 3 <br>
//!	             The recommanded value is i+2 where i is the maximum order of the <br>
//!	             constraints. <br>
//!	NbPtsOnCur:  it is the average number of points for discretisation <br>
//!	             of the edges. <br>
//!	NbIter:      it is the maximum number of iterations of the process. <br>
//!	             For each iteration the number of discretisation points is <br>
//!	             increased. <br>
//!	Anisotropie: <br>
  Standard_EXPORT     void SetResolParam(const Standard_Integer Degree = 3,const Standard_Integer NbPtsOnCur = 15,const Standard_Integer NbIter = 2,const Standard_Boolean Anisotropie = Standard_False) ;
  //! Sets the parameters used for approximation of the surface <br>
  Standard_EXPORT     void SetApproxParam(const Standard_Integer MaxDeg = 8,const Standard_Integer MaxSegments = 9) ;
  //! Loads the initial Surface <br>
  Standard_EXPORT     void LoadInitSurface(const TopoDS_Face& aFace) ;
  //! Adds a new constraint which also defines an edge of the wire <br>
//!	        of the face <br>
//!	Order: Order of the constraint: <br>
//!	       GeomAbs_C0 : the surface has to pass by 3D representation <br>
//!	                    of the edge <br>
//!	       GeomAbs_G1 : the surface has to pass by 3D representation <br>
//!	                    of the edge and to respect tangency with the first <br>
//!	                    face of the edge <br>
//!	       GeomAbs_G2 : the surface has to pass by 3D representation <br>
//!	                    of the edge and to respect tangency and curvature <br>
//!	                    with the first face of the edge. <br>
  Standard_EXPORT     Standard_Integer Add(const TopoDS_Edge& anEdge,const GeomAbs_Shape Order,const Standard_Boolean IsBound = Standard_True) ;
  //! Adds a new constraint which also defines an edge of the wire <br>
//!	        of the face <br>
//!	Order: Order of the constraint: <br>
//!	       GeomAbs_C0 : the surface has to pass by 3D representation <br>
//!	                    of the edge <br>
//!	       GeomAbs_G1 : the surface has to pass by 3D representation <br>
//!	                    of the edge and to respect tangency with the <br>
//!	                    given face <br>
//!	       GeomAbs_G2 : the surface has to pass by 3D representation <br>
//!	                    of the edge and to respect tangency and curvature <br>
//!	                    with the given face. <br>
  Standard_EXPORT     Standard_Integer Add(const TopoDS_Edge& anEdge,const TopoDS_Face& Support,const GeomAbs_Shape Order,const Standard_Boolean IsBound = Standard_True) ;
  //! Adds a free constraint on a face. The corresponding edge has to <br>
//!	be automatically recomputed. <br>
//!	It is always a bound. <br>
  Standard_EXPORT     Standard_Integer Add(const TopoDS_Face& Support,const GeomAbs_Shape Order) ;
  //! Adds a punctual constraint <br>
  Standard_EXPORT     Standard_Integer Add(const gp_Pnt& Point) ;
  //! Adds a punctual constraint. <br>
  Standard_EXPORT     Standard_Integer Add(const Standard_Real U,const Standard_Real V,const TopoDS_Face& Support,const GeomAbs_Shape Order) ;
  //! Builds the resulting faces <br>
  Standard_EXPORT     void Build() ;
  
  Standard_EXPORT     Standard_Boolean IsDone() const;
  
  Standard_EXPORT     TopoDS_Face Face() const;
  
  Standard_EXPORT     Standard_Real G0Error() const;
  
  Standard_EXPORT     Standard_Real G1Error() const;
  
  Standard_EXPORT     Standard_Real G2Error() const;
  
  Standard_EXPORT     Standard_Real G0Error(const Standard_Integer Index) ;
  
  Standard_EXPORT     Standard_Real G1Error(const Standard_Integer Index) ;
  
  Standard_EXPORT     Standard_Real G2Error(const Standard_Integer Index) ;





protected:





private:

  //! Adds constraints to builder <br>
  Standard_EXPORT     void AddConstraints(const BRepFill_SequenceOfEdgeFaceAndOrder& SeqOfConstraints) ;
  //! Builds wires of maximum length <br>
  Standard_EXPORT     void BuildWires(TopTools_MapOfShape& EdgeMap,TopTools_MapOfShape& WireList) const;
  //! Finds extremities of future edges to fix the holes between wires. <br>
//!          Can properly operate only with convex contour <br>
  Standard_EXPORT     void FindExtremitiesOfHoles(TopTools_MapOfShape& WireMap,TColgp_SequenceOfPnt& PntSeq) const;


GeomPlate_BuildPlateSurface myBuilder;
BRepFill_SequenceOfEdgeFaceAndOrder myBoundary;
BRepFill_SequenceOfEdgeFaceAndOrder myConstraints;
BRepFill_SequenceOfFaceAndOrder myFreeConstraints;
GeomPlate_SequenceOfPointConstraint myPoints;
TopoDS_Face myFace;
TopoDS_Face myInitFace;
Standard_Real myTol2d;
Standard_Real myTol3d;
Standard_Real myTolAng;
Standard_Real myTolCurv;
Standard_Integer myMaxDeg;
Standard_Integer myMaxSegments;
Standard_Integer myDegree;
Standard_Integer myNbPtsOnCur;
Standard_Integer myNbIter;
Standard_Boolean myAnisotropie;
Standard_Boolean myIsInitFaceGiven;
Standard_Boolean myIsDone;


};





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


#endif