42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _GeomInt_WLApprox_HeaderFile |
18 | #define _GeomInt_WLApprox_HeaderFile |
19 | |
c22b52d6 |
20 | #include <Adaptor3d_Surface.hxx> |
f44aa197 |
21 | #include <NCollection_Vector.hxx> |
42cf5bc1 |
22 | #include <GeomInt_TheComputeLineOfWLApprox.hxx> |
23 | #include <GeomInt_TheComputeLineBezierOfWLApprox.hxx> |
24 | #include <Approx_MCurvesToBSpCurve.hxx> |
42cf5bc1 |
25 | #include <Approx_ParametrizationType.hxx> |
c22b52d6 |
26 | |
42cf5bc1 |
27 | class Adaptor3d_HSurfaceTool; |
28 | class IntSurf_Quadric; |
29 | class IntSurf_QuadricTool; |
30 | class IntPatch_WLine; |
31 | class GeomInt_ThePrmPrmSvSurfacesOfWLApprox; |
32 | class GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox; |
33 | class GeomInt_TheImpPrmSvSurfacesOfWLApprox; |
34 | class GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox; |
35 | class GeomInt_TheMultiLineOfWLApprox; |
36 | class GeomInt_TheMultiLineToolOfWLApprox; |
37 | class GeomInt_TheComputeLineOfWLApprox; |
38 | class GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox; |
39 | class GeomInt_MyGradientbisOfTheComputeLineOfWLApprox; |
40 | class GeomInt_TheComputeLineBezierOfWLApprox; |
41 | class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox; |
42 | class AppParCurves_MultiBSpCurve; |
43 | |
68df8478 |
44 | class GeomInt_WLApprox |
f44aa197 |
45 | { |
68df8478 |
46 | private: |
47 | struct Approx_Data |
f44aa197 |
48 | { |
68df8478 |
49 | Approx_Data () : myBezierApprox (Standard_True), |
50 | Xo (0.0), Yo (0.0), Zo (0.0), |
51 | U1o (0.0), V1o (0.0), U2o (0.0), V2o (0.0), |
52 | ApproxXYZ (Standard_True), |
53 | ApproxU1V1 (Standard_True), |
54 | ApproxU2V2 (Standard_True), |
55 | indicemin (0), indicemax (0), |
56 | myNbPntMax (30), parametrization (Approx_ChordLength) |
57 | { |
58 | } |
42cf5bc1 |
59 | |
68df8478 |
60 | Standard_Boolean myBezierApprox; |
61 | Standard_Real Xo, Yo, Zo, U1o, V1o, U2o, V2o; |
62 | Standard_Boolean ApproxXYZ, ApproxU1V1, ApproxU2V2; |
63 | Standard_Integer indicemin, indicemax, myNbPntMax; |
64 | Approx_ParametrizationType parametrization; |
65 | }; |
42cf5bc1 |
66 | |
42cf5bc1 |
67 | public: |
68 | |
69 | DEFINE_STANDARD_ALLOC |
70 | |
71 | |
72 | Standard_EXPORT GeomInt_WLApprox(); |
73 | |
c22b52d6 |
74 | Standard_EXPORT void Perform (const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor3d_Surface)& 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); |
42cf5bc1 |
75 | |
76 | 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); |
77 | |
4e14c88f |
78 | Standard_EXPORT |
79 | void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, |
80 | const Standard_Integer DegMin, |
81 | const Standard_Integer DegMax, |
82 | const Standard_Integer NbIterMax, |
83 | const Standard_Integer NbPntMax = 30, |
84 | const Standard_Boolean ApproxWithTangency = Standard_True, |
85 | const Approx_ParametrizationType |
86 | Parametrization = Approx_ChordLength); |
42cf5bc1 |
87 | Standard_EXPORT void Perform(); |
88 | |
89 | Standard_EXPORT Standard_Real TolReached3d() const; |
90 | |
91 | Standard_EXPORT Standard_Real TolReached2d() const; |
92 | |
93 | Standard_EXPORT Standard_Boolean IsDone() const; |
94 | |
95 | Standard_EXPORT Standard_Integer NbMultiCurves() const; |
96 | |
97 | Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const; |
98 | |
9eee5ab7 |
99 | Standard_EXPORT static void Parameters(const GeomInt_TheMultiLineOfWLApprox& Line, |
100 | const Standard_Integer firstP, |
101 | const Standard_Integer lastP, |
102 | const Approx_ParametrizationType Par, |
103 | math_Vector& TheParameters); |
42cf5bc1 |
104 | |
105 | |
106 | protected: |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | private: |
c22b52d6 |
113 | Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(Adaptor3d_Surface)& 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); |
42cf5bc1 |
114 | |
115 | Standard_EXPORT void UpdateTolReached(); |
116 | |
f44aa197 |
117 | //! Fill data structure for intersection approximation. |
4e14c88f |
118 | Standard_EXPORT void fillData(const Handle(IntPatch_WLine)& theLine); |
f44aa197 |
119 | |
120 | //! Prepare data structure for further computations. |
121 | Standard_EXPORT void prepareDS(const Standard_Boolean theApproxXYZ, |
122 | const Standard_Boolean theApproxU1V1, |
123 | const Standard_Boolean theApproxU2V2, |
124 | const Standard_Integer indicemin, |
125 | const Standard_Integer indicemax); |
126 | |
127 | //! Build knot sequence. |
128 | Standard_EXPORT void buildKnots(const Handle(IntPatch_WLine)& theline, |
129 | const Standard_Address thePtrSVSurf); |
130 | |
131 | //! Build curve. |
132 | Standard_EXPORT void buildCurve(const Handle(IntPatch_WLine)& theline, |
133 | const Standard_Address thePtrSVSurf); |
42cf5bc1 |
134 | |
135 | GeomInt_TheComputeLineOfWLApprox myComputeLine; |
136 | GeomInt_TheComputeLineBezierOfWLApprox myComputeLineBezier; |
137 | Approx_MCurvesToBSpCurve myBezToBSpl; |
42cf5bc1 |
138 | Standard_Boolean myWithTangency; |
139 | Standard_Real myTol3d; |
140 | Standard_Real myTol2d; |
42cf5bc1 |
141 | Standard_Integer myDegMin; |
142 | Standard_Integer myDegMax; |
42cf5bc1 |
143 | Standard_Integer myNbIterMax; |
42cf5bc1 |
144 | Standard_Real myTolReached3d; |
145 | Standard_Real myTolReached2d; |
f44aa197 |
146 | Approx_Data myData; |
f44aa197 |
147 | NCollection_Vector<Standard_Integer> myKnots; |
42cf5bc1 |
148 | |
149 | }; |
150 | |
151 | |
152 | |
153 | |
154 | |
155 | |
156 | |
157 | #endif // _GeomInt_WLApprox_HeaderFile |