1 // Created on: 1995-01-27
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GeomInt_WLApprox_HeaderFile
18 #define _GeomInt_WLApprox_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <NCollection_Vector.hxx>
25 #include <GeomInt_TheComputeLineOfWLApprox.hxx>
26 #include <GeomInt_TheComputeLineBezierOfWLApprox.hxx>
27 #include <Approx_MCurvesToBSpCurve.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Integer.hxx>
31 #include <Approx_ParametrizationType.hxx>
32 class Standard_OutOfRange;
33 class StdFail_NotDone;
34 class Adaptor3d_HSurface;
35 class Adaptor3d_HSurfaceTool;
36 class IntSurf_Quadric;
37 class IntSurf_QuadricTool;
39 class GeomInt_ThePrmPrmSvSurfacesOfWLApprox;
40 class GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox;
41 class GeomInt_TheImpPrmSvSurfacesOfWLApprox;
42 class GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox;
43 class GeomInt_TheMultiLineOfWLApprox;
44 class GeomInt_TheMultiLineToolOfWLApprox;
45 class GeomInt_TheComputeLineOfWLApprox;
46 class GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox;
47 class GeomInt_MyGradientbisOfTheComputeLineOfWLApprox;
48 class GeomInt_TheComputeLineBezierOfWLApprox;
49 class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox;
50 class AppParCurves_MultiBSpCurve;
52 class GeomInt_WLApprox
57 Approx_Data () : myBezierApprox (Standard_True),
58 Xo (0.0), Yo (0.0), Zo (0.0),
59 U1o (0.0), V1o (0.0), U2o (0.0), V2o (0.0),
60 ApproxXYZ (Standard_True),
61 ApproxU1V1 (Standard_True),
62 ApproxU2V2 (Standard_True),
63 indicemin (0), indicemax (0),
64 myNbPntMax (30), parametrization (Approx_ChordLength)
68 Standard_Boolean myBezierApprox;
69 Standard_Real Xo, Yo, Zo, U1o, V1o, U2o, V2o;
70 Standard_Boolean ApproxXYZ, ApproxU1V1, ApproxU2V2;
71 Standard_Integer indicemin, indicemax, myNbPntMax;
72 Approx_ParametrizationType parametrization;
80 Standard_EXPORT GeomInt_WLApprox();
82 Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
84 Standard_EXPORT void Perform (const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
87 void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d,
88 const Standard_Integer DegMin,
89 const Standard_Integer DegMax,
90 const Standard_Integer NbIterMax,
91 const Standard_Integer NbPntMax = 30,
92 const Standard_Boolean ApproxWithTangency = Standard_True,
93 const Approx_ParametrizationType
94 Parametrization = Approx_ChordLength);
95 Standard_EXPORT void Perform();
97 Standard_EXPORT Standard_Real TolReached3d() const;
99 Standard_EXPORT Standard_Real TolReached2d() const;
101 Standard_EXPORT Standard_Boolean IsDone() const;
103 Standard_EXPORT Standard_Integer NbMultiCurves() const;
105 Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
117 Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
119 Standard_EXPORT void UpdateTolReached();
121 //! Fill data structure for intersection approximation.
122 Standard_EXPORT void fillData(const Handle(IntPatch_WLine)& theLine);
124 //! Prepare data structure for further computations.
125 Standard_EXPORT void prepareDS(const Standard_Boolean theApproxXYZ,
126 const Standard_Boolean theApproxU1V1,
127 const Standard_Boolean theApproxU2V2,
128 const Standard_Integer indicemin,
129 const Standard_Integer indicemax);
131 //! Build knot sequence.
132 Standard_EXPORT void buildKnots(const Handle(IntPatch_WLine)& theline,
133 const Standard_Address thePtrSVSurf);
136 Standard_EXPORT void buildCurve(const Handle(IntPatch_WLine)& theline,
137 const Standard_Address thePtrSVSurf);
139 GeomInt_TheComputeLineOfWLApprox myComputeLine;
140 GeomInt_TheComputeLineBezierOfWLApprox myComputeLineBezier;
141 Approx_MCurvesToBSpCurve myBezToBSpl;
142 Standard_Boolean myWithTangency;
143 Standard_Real myTol3d;
144 Standard_Real myTol2d;
145 Standard_Integer myDegMin;
146 Standard_Integer myDegMax;
147 Standard_Integer myNbIterMax;
148 Standard_Real myTolReached3d;
149 Standard_Real myTolReached2d;
151 NCollection_Vector<Standard_Integer> myKnots;
161 #endif // _GeomInt_WLApprox_HeaderFile