summaryrefslogtreecommitdiff
path: root/inc/GeomFill_Pipe.hxx
blob: 264614ec4f92bdddc5bbaab666d3f67f6016563e (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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
// 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 _GeomFill_Pipe_HeaderFile
#define _GeomFill_Pipe_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 _Handle_Adaptor3d_HCurve_HeaderFile
#include <Handle_Adaptor3d_HCurve.hxx>
#endif
#ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx>
#endif
#ifndef _Handle_GeomFill_LocationLaw_HeaderFile
#include <Handle_GeomFill_LocationLaw.hxx>
#endif
#ifndef _Handle_GeomFill_SectionLaw_HeaderFile
#include <Handle_GeomFill_SectionLaw.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_Geom_Curve_HeaderFile
#include <Handle_Geom_Curve.hxx>
#endif
#ifndef _GeomFill_Trihedron_HeaderFile
#include <GeomFill_Trihedron.hxx>
#endif
#ifndef _Handle_Geom2d_Curve_HeaderFile
#include <Handle_Geom2d_Curve.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
class Adaptor3d_HCurve;
class Geom_Surface;
class GeomFill_LocationLaw;
class GeomFill_SectionLaw;
class Standard_ConstructionError;
class Geom_Curve;
class Geom2d_Curve;
class gp_Dir;
class TColGeom_SequenceOfCurve;


//! Describes functions to construct pipes. A pipe is built by <br>
//! sweeping a curve (the section) along another curve (the path). <br>
//! The Pipe class provides the following types of construction: <br>
//! -   pipes with a circular section of constant radius, <br>
//! -   pipes with a constant section, <br>
//! -   pipes with a section evolving between two given curves. <br>
//!   All standard specific cases are detected in order to build, <br>
//! where required, a plane, cylinder, cone, sphere, torus, <br>
//! surface of linear extrusion or surface of revolution. <br>
//! Generally speaking, the result is a BSpline surface (NURBS). <br>
//! A Pipe object provides a framework for: <br>
//! -   defining the pipe to be built, <br>
//! -   implementing the construction algorithm, and <br>
//! -   consulting the resulting surface. <br>
//!          There are several methods to instantiate a Pipe: <br>
//!          1) give a path and  a radius : the section is <br>
//!          a circle.  This location  is the first  point <br>
//!          of the path,  and this direction is the first <br>
//!          derivate (calculate at  the  first point ) of <br>
//!          the path. <br>
//! <br>
//!          2) give a path and a section. <br>
//!             Differtent options are available <br>
//!          2.a) Use the classical Frenet trihedron <br>
//!            - or the CorrectedFrenet trihedron <br>
//!              (To avoid twisted surface) <br>
//!            - or a constant trihedron to have all the sections <br>
//!              in a same plane <br>
//!          2.b) Define a ConstantBinormal Direction to keep the <br>
//!            same angle beetween the Direction and the sections <br>
//!            along the sweep surface. <br>
//!          2.c) Define the path by a surface and a 2dcurve, <br>
//!            the surface is used to define the trihedron's normal. <br>
//!            It is usefull to keep a constant angle beetween <br>
//!            input surface and the pipe.                           -- <br>
//!          3) give a  path and two sections. The section <br>
//!          evoluate from First to Last Section. <br>
//! <br>
//!          3) give a  path and N sections. The section <br>
//!          evoluate from First to Last Section. <br>
//! <br>
//!          In general case the result is a NURBS. But we <br>
//!          can  generate plane,  cylindrical, spherical, <br>
//!          conical, toroidal surface in some particular case. <br>
//! <br>
//!          The natural parametrization of the result is: <br>
//! <br>
//!             U-Direction along the section. <br>
//!             V-Direction along the path. <br>
//! <br>
//!          But, in some particular case, the surface must <br>
//!          be construct otherwise. <br>
//!          The method "EchangeUV" return false in such cases. <br>
//! <br>
class GeomFill_Pipe  {
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); 
  }

  
//! Constructs an empty algorithm for building pipes. Use <br>
//! the function Init to initialize it. <br>
  Standard_EXPORT   GeomFill_Pipe();
  
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Standard_Real Radius);
  //!  Create  a  pipe  with  a  constant  section <br>
//!  (<FirstSection>)  and a path (<Path>) <br>
//! Option can be  - GeomFill_IsCorrectedFrenet <br>
//!                - GeomFill_IsFrenet <br>
//!                - GeomFill_IsConstant <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const GeomFill_Trihedron Option = GeomFill_IsCorrectedFrenet);
  //!  Create  a  pipe  with  a  constant  section <br>
//!  (<FirstSection>)  and a path defined by <Path> and <Support> <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom2d_Curve)& Path,const Handle(Geom_Surface)& Support,const Handle(Geom_Curve)& FirstSect);
  //!  Create  a  pipe with  a  constant section <br>
//!    (<FirstSection>) and a   path <Path>  and a fixed <br>
//!    binormal direction <Dir> <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const gp_Dir& Dir);
  //! Create a pipe with an evolving section <br>
//!          The section evoluate from First to Last Section <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const Handle(Geom_Curve)& LastSect);
  //! Create a pipe with N  sections <br>
//!          The section evoluate from First to Last Section <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const TColGeom_SequenceOfCurve& NSections);
  //! Create  a pipe  with  a constant  radius with  2 <br>
//!          guide-line. <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& Curve1,const Handle(Geom_Curve)& Curve2,const Standard_Real Radius);
  //! Create  a pipe  with  a constant  radius with  2 <br>
//!          guide-line. <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Adaptor3d_HCurve)& Path,const Handle(Adaptor3d_HCurve)& Curve1,const Handle(Adaptor3d_HCurve)& Curve2,const Standard_Real Radius);
  //! Create a pipe with a constant section and  with 1 <br>
//!          guide-line. <br>
//!     Use the function Perform to build the surface. <br>
//! All standard specific cases are detected in order to <br>
//! construct, according to the respective geometric <br>
//! nature of Path and the sections, a planar, cylindrical, <br>
//! conical, spherical or toroidal surface, a surface of <br>
//! linear extrusion or a surface of revolution. <br>
//! In the general case, the result is a BSpline surface <br>
//! (NURBS) built by approximation of a series of sections where: <br>
//! -   the number of sections N is chosen automatically <br>
//!   by the algorithm according to the respective <br>
//!   geometries of Path and the sections. N is greater than or equal to 2; <br>
//! -   N points Pi (with i in the range [ 1,N ]) are <br>
//!   defined at regular intervals along the curve Path <br>
//!   from its first point to its end point. At each point Pi, <br>
//!   a coordinate system Ti is computed with Pi as <br>
//!   origin, and with the tangential and normal vectors <br>
//!   to Path defining two of its coordinate axes. <br>
//! In the case of a pipe with a constant circular section, <br>
//! the first section is a circle of radius Radius centered <br>
//! on the origin of Path and whose "Z Axis" is aligned <br>
//! along the vector tangential to the origin of Path. In the <br>
//! case of a pipe with a constant section, the first section <br>
//! is the curve FirstSect. In these two cases, the ith <br>
//! section (for values of i greater than 1) is obtained by <br>
//! applying to a copy of this first section the geometric <br>
//! transformation which transforms coordinate system <br>
//! T1 into coordinate system Ti. <br>
//! In the case of an evolving section, N-2 intermediate <br>
//! curves Si are first computed (if N is greater than 2, <br>
//! and with i in the range [ 2,N-1 ]) whose geometry <br>
//! evolves regularly from the curve S1=FirstSect to the <br>
//! curve SN=LastSect. The first section is FirstSect, <br>
//! and the ith section (for values of i greater than 1) is <br>
//! obtained by applying to the curve Si the geometric <br>
//! transformation which transforms coordinate system <br>
//! T1 into coordinate system Ti. <br>
  Standard_EXPORT   GeomFill_Pipe(const Handle(Geom_Curve)& Path,const Handle(Adaptor3d_HCurve)& Guide,const Handle(Geom_Curve)& FirstSect,const Standard_Boolean ByACR,const Standard_Boolean rotat);
  
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const Standard_Real Radius) ;
  
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const GeomFill_Trihedron Option = GeomFill_IsCorrectedFrenet) ;
  
  Standard_EXPORT     void Init(const Handle(Geom2d_Curve)& Path,const Handle(Geom_Surface)& Support,const Handle(Geom_Curve)& FirstSect) ;
  
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const gp_Dir& Dir) ;
  
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const Handle(Geom_Curve)& FirstSect,const Handle(Geom_Curve)& LastSect) ;
  
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const TColGeom_SequenceOfCurve& NSections) ;
  //! Create  a pipe  with  a constant  radius with  2 <br>
//!          guide-line. <br>
  Standard_EXPORT     void Init(const Handle(Adaptor3d_HCurve)& Path,const Handle(Adaptor3d_HCurve)& Curve1,const Handle(Adaptor3d_HCurve)& Curve2,const Standard_Real Radius) ;
  
//! Initializes this pipe algorithm to build the following surface: <br>
//! -   a pipe with a constant circular section of radius <br>
//!   Radius along the path Path, or <br>
//! -   a pipe with constant section FirstSect along the path Path, or <br>
//! -   a pipe where the section evolves from FirstSect to <br>
//!   LastSect along the path Path. <br>
//! Use the function Perform to build the surface. <br>
//! Note: a description of the resulting surface is given under Constructors. <br>
  Standard_EXPORT     void Init(const Handle(Geom_Curve)& Path,const Handle(Adaptor3d_HCurve)& Guide,const Handle(Geom_Curve)& FirstSect,const Standard_Boolean ByACR,const Standard_Boolean rotat) ;
  //! Builds the pipe defined at the time of initialization of this <br>
//! algorithm. A description of the resulting surface is given under Constructors. <br>
//! If WithParameters (defaulted to false) is set to true, the <br>
//! approximation algorithm (used only in the general case <br>
//! of construction of a BSpline surface) builds the surface <br>
//! with a u parameter corresponding to the one of the path. <br>
//! Exceptions <br>
//! Standard_ConstructionError if a surface cannot be constructed from the data. <br>
//!  Warning: It is the old Perform method, the next methode is recommended. <br>
  Standard_EXPORT     void Perform(const Standard_Boolean WithParameters = Standard_False,const Standard_Boolean myPolynomial = Standard_False) ;
  //! detects the  particular cases.  And compute the surface. <br>
//!    if  none   particular  case  is  detected we make an approximation <br>
//!    with respect of the Tolerance <Tol>, the continuty <Conti>, the <br>
//!    maximum degree <MaxDegree>, the maximum number of span <NbMaxSegment> <br>
//!    and the spine parametrization. <br>//! If we can't create a surface with the data <br>
  Standard_EXPORT     void Perform(const Standard_Real Tol,const Standard_Boolean Polynomial,const GeomAbs_Shape Conti = GeomAbs_C1,const Standard_Integer MaxDegree = 11,const Standard_Integer NbMaxSegment = 30) ;
  //! Returns the surface built by this algorithm. <br>
//! Warning <br>
//! Do not use this function before the surface is built (in this <br>
//! case the function will return a null handle). <br>
       const Handle_Geom_Surface& Surface() const;
  //! The u parametric direction of the surface constructed by <br>
//! this algorithm usually corresponds to the evolution <br>
//! along the path and the v parametric direction <br>
//! corresponds to the evolution along the section(s). <br>
//! However, this rule is not respected when constructing <br>
//! certain specific Geom surfaces (typically cylindrical <br>
//! surfaces, surfaces of revolution, etc.) for which the <br>
//! parameterization is inversed. <br>
//! The ExchangeUV function checks for this, and returns <br>
//! true in all these specific cases. <br>
//! Warning <br>
//! Do not use this function before the surface is built. <br>
  Standard_EXPORT     Standard_Boolean ExchangeUV() const;
  //! Sets a flag  to  try to   create as many   planes, <br>
//!          cylinder,...    as  possible.  Default  value   is <br>
//!          <Standard_False>. <br>
        void GenerateParticularCase(const Standard_Boolean B) ;
  //! Returns the flag. <br>
        Standard_Boolean GenerateParticularCase() const;
  //! Returns the approximation's error.  if the Surface <br>
//!          is plane, cylinder ... this error can be 0. <br>
        Standard_Real ErrorOnSurf() const;





protected:





private:

  
  Standard_EXPORT     void Init() ;
  //! The result  (<mySurface>)  is an approximation.  Using <br>
//!          <SweepSectionGenerator>  to      do    that.        If <br>
//!          <WithParameters>    is   set  to <Standard_True>,  the <br>
//!          apprxoximation will be   done in respect to  the spine <br>
//!          parametrization. <br>
  Standard_EXPORT     void ApproxSurf(const Standard_Boolean WithParameters) ;
  
  Standard_EXPORT     Standard_Boolean KPartT4() ;


Standard_Real myRadius;
Standard_Real myError;
Handle_Adaptor3d_HCurve myAdpPath;
Handle_Adaptor3d_HCurve myAdpFirstSect;
Handle_Adaptor3d_HCurve myAdpLastSect;
Handle_Geom_Surface mySurface;
Handle_GeomFill_LocationLaw myLoc;
Handle_GeomFill_SectionLaw mySec;
Standard_Integer myType;
Standard_Boolean myExchUV;
Standard_Boolean myKPart;
Standard_Boolean myPolynomial;


};


#include <GeomFill_Pipe.lxx>



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


#endif