summaryrefslogtreecommitdiff
path: root/inc/BiTgte_Blend.hxx
blob: 7e578f26c51d0f96d543bd6bde3c2bbd48a10b95 (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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
// 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 _BiTgte_Blend_HeaderFile
#define _BiTgte_Blend_HeaderFile

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

#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#endif
#ifndef _BRepFill_DataMapOfShapeDataMapOfShapeListOfShape_HeaderFile
#include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#endif
#ifndef _TopTools_MapOfShape_HeaderFile
#include <TopTools_MapOfShape.hxx>
#endif
#ifndef _BRepOffset_Analyse_HeaderFile
#include <BRepOffset_Analyse.hxx>
#endif
#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _BRepOffset_DataMapOfShapeOffset_HeaderFile
#include <BRepOffset_DataMapOfShapeOffset.hxx>
#endif
#ifndef _BRepAlgo_Image_HeaderFile
#include <BRepAlgo_Image.hxx>
#endif
#ifndef _Handle_BRepAlgo_AsDes_HeaderFile
#include <Handle_BRepAlgo_AsDes.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfInteger_HeaderFile
#include <Handle_TColStd_HArray1OfInteger.hxx>
#endif
#ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx>
#endif
#ifndef _BiTgte_ContactType_HeaderFile
#include <BiTgte_ContactType.hxx>
#endif
#ifndef _Handle_Geom_Curve_HeaderFile
#include <Handle_Geom_Curve.hxx>
#endif
#ifndef _Handle_Geom2d_Curve_HeaderFile
#include <Handle_Geom2d_Curve.hxx>
#endif
class BRepAlgo_AsDes;
class TColStd_HArray1OfInteger;
class StdFail_NotDone;
class Standard_OutOfRange;
class TopoDS_Shape;
class TopoDS_Face;
class TopoDS_Edge;
class Geom_Surface;
class TopTools_ListOfShape;
class Geom_Curve;
class Geom2d_Curve;
class BiTgte_DataMapOfShapeBox;
class BRepOffset_Offset;
class BRepOffset_Inter3d;



class BiTgte_Blend  {
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); 
  }

  
  Standard_EXPORT   BiTgte_Blend();
  //! <S>: Shape to be rounded <br>
//!          <Radius>: radius of the fillet <br>
//!          <Tol>: Tol3d used in approximations <br>
//!          <NUBS>: if true,  generate only NUBS surfaces, <br>
//!                  if false, generate analytical surfaces if possible <br>
//! <br>
  Standard_EXPORT   BiTgte_Blend(const TopoDS_Shape& S,const Standard_Real Radius,const Standard_Real Tol,const Standard_Boolean NUBS);
  
  Standard_EXPORT     void Init(const TopoDS_Shape& S,const Standard_Real Radius,const Standard_Real Tol,const Standard_Boolean NUBS) ;
  //! Clear all the Fields. <br>
  Standard_EXPORT     void Clear() ;
  //!  Set two faces   of <myShape> on which the  Sphere <br>
//!                    must roll. <br>
  Standard_EXPORT     void SetFaces(const TopoDS_Face& F1,const TopoDS_Face& F2) ;
  //! Set an edge of <myShape> to be rounded. <br>
  Standard_EXPORT     void SetEdge(const TopoDS_Edge& Edge) ;
  //! Set a face on which the fillet must stop. <br>
  Standard_EXPORT     void SetStoppingFace(const TopoDS_Face& Face) ;
  //! Compute the generated surfaces. <br>
//!          If <BuildShape> is true, compute the resulting Shape. <br>
//!          If false, only the blending surfaces are computed. <br>
  Standard_EXPORT     void Perform(const Standard_Boolean BuildShape = Standard_True) ;
  
  Standard_EXPORT     Standard_Boolean IsDone() const;
  //! returns the result <br>
  Standard_EXPORT    const TopoDS_Shape& Shape() const;
  //! returns the Number of generated surfaces. <br>
  Standard_EXPORT     Standard_Integer NbSurfaces() const;
  //! returns the surface of range Index <br>
  Standard_EXPORT     Handle_Geom_Surface Surface(const Standard_Integer Index) const;
  //! returns the surface of range Index <br>
  Standard_EXPORT    const TopoDS_Face& Face(const Standard_Integer Index) const;
  //! set in <LC> all the center lines <br>
  Standard_EXPORT     void CenterLines(TopTools_ListOfShape& LC) const;
  //! returns  the surface generated  by the centerline. <br>
//!          <CenterLine> may be <br>
//!             - an edge  : generate a pipe. <br>
//!             - a vertex : generate a sphere. <br>
//!  Warning: returns a Null Handle if <CenterLine> generates <br>
//!          no surface. <br>
  Standard_EXPORT     Handle_Geom_Surface Surface(const TopoDS_Shape& CenterLine) const;
  //! returns  the face generated  by the centerline. <br>
//!          <CenterLine> may be <br>
//!             - an edge  : generate a pipe. <br>
//!             - a vertex : generate a sphere. <br>
//!  Warning: returns a Null Shape if <CenterLine> generates <br>
//!          no surface. <br>
  Standard_EXPORT    const TopoDS_Face& Face(const TopoDS_Shape& CenterLine) const;
  //! returns the type of contact <br>
  Standard_EXPORT     BiTgte_ContactType ContactType(const Standard_Integer Index) const;
  //! gives the first support shape relative to <br>
//!          SurfaceFillet(Index); <br>
  Standard_EXPORT    const TopoDS_Shape& SupportShape1(const Standard_Integer Index) const;
  //! gives the second support shape relative to <br>
//!          SurfaceFillet(Index); <br>
  Standard_EXPORT    const TopoDS_Shape& SupportShape2(const Standard_Integer Index) const;
  //! gives the 3d curve of SurfaceFillet(Index) <br>
//!          on SupportShape1(Index) <br>
  Standard_EXPORT     Handle_Geom_Curve CurveOnShape1(const Standard_Integer Index) const;
  //! gives the 3d curve of SurfaceFillet(Index) <br>
//!          on SupportShape2(Index) <br>
  Standard_EXPORT     Handle_Geom_Curve CurveOnShape2(const Standard_Integer Index) const;
  //! gives the PCurve associated to CurvOnShape1(Index) <br>
//!          on the support face <br>
//!  Warning: returns a Null Handle if SupportShape1 is not a Face <br>
  Standard_EXPORT     Handle_Geom2d_Curve PCurveOnFace1(const Standard_Integer Index) const;
  //! gives the PCurve associated to CurveOnShape1(Index) <br>
//!          on the Fillet <br>
  Standard_EXPORT     Handle_Geom2d_Curve PCurve1OnFillet(const Standard_Integer Index) const;
  //! gives the PCurve  associated to CurveOnShape2(Index) <br>
//!          on the  support face <br>
//!  Warning: returns a Null Handle if SupportShape2 is not a Face <br>
  Standard_EXPORT     Handle_Geom2d_Curve PCurveOnFace2(const Standard_Integer Index) const;
  //! gives the PCurve associated to CurveOnShape2(Index) <br>
//!          on the fillet <br>
  Standard_EXPORT     Handle_Geom2d_Curve PCurve2OnFillet(const Standard_Integer Index) const;
  
  Standard_EXPORT     Standard_Integer NbBranches() ;
  //!  Set in <From>,<To>   the indices of the faces  of <br>
//!  the branche <Index>. <br>
//! <br>
//!  i.e: Branche<Index> = Face(From) + Face(From+1) + ..+ Face(To) <br>
  Standard_EXPORT     void IndicesOfBranche(const Standard_Integer Index,Standard_Integer& From,Standard_Integer& To) const;
  //! Computes the center lines <br>
  Standard_EXPORT     void ComputeCenters() ;





protected:





private:

  //! Perform the generated surfaces. <br>
  Standard_EXPORT     void ComputeSurfaces() ;
  //! Build the resulting shape <br>
//!          All the faces must be computed <br>
  Standard_EXPORT     void ComputeShape() ;
  //! Computes the intersections with <Face> and all the <br>
//!           OffsetFaces stored  in <myMapSF>.  Returns <True> <br>
//!          if an intersections ends on a boundary of a Face. <br>
  Standard_EXPORT     Standard_Boolean Intersect(const TopoDS_Shape& Init,const TopoDS_Face& Face,const BiTgte_DataMapOfShapeBox& MapSBox,const BRepOffset_Offset& OF1,BRepOffset_Inter3d& Inter) ;


Standard_Real myRadius;
Standard_Real myTol;
Standard_Boolean myNubs;
TopoDS_Shape myShape;
TopoDS_Shape myResult;
Standard_Boolean myBuildShape;
TopTools_IndexedDataMapOfShapeListOfShape myAncestors;
BRepFill_DataMapOfShapeDataMapOfShapeListOfShape myCreated;
TopTools_DataMapOfShapeListOfShape myCutEdges;
TopTools_MapOfShape myFaces;
TopTools_MapOfShape myEdges;
TopTools_MapOfShape myStopFaces;
BRepOffset_Analyse myAnalyse;
TopTools_IndexedMapOfShape myCenters;
BRepOffset_DataMapOfShapeOffset myMapSF;
BRepAlgo_Image myInitOffsetFace;
BRepAlgo_Image myImage;
BRepAlgo_Image myImageOffset;
Handle_BRepAlgo_AsDes myAsDes;
Standard_Integer myNbBranches;
Handle_TColStd_HArray1OfInteger myIndices;
Standard_Boolean myDone;


};





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


#endif