File indexing completed on 2025-01-18 10:03:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _GeomInt_WLApprox_HeaderFile
0018 #define _GeomInt_WLApprox_HeaderFile
0019
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <NCollection_Vector.hxx>
0022 #include <GeomInt_TheComputeLineOfWLApprox.hxx>
0023 #include <GeomInt_TheComputeLineBezierOfWLApprox.hxx>
0024 #include <Approx_MCurvesToBSpCurve.hxx>
0025 #include <Approx_ParametrizationType.hxx>
0026
0027 class Adaptor3d_HSurfaceTool;
0028 class IntSurf_Quadric;
0029 class IntSurf_QuadricTool;
0030 class IntPatch_WLine;
0031 class GeomInt_ThePrmPrmSvSurfacesOfWLApprox;
0032 class GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox;
0033 class GeomInt_TheImpPrmSvSurfacesOfWLApprox;
0034 class GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox;
0035 class GeomInt_TheMultiLineOfWLApprox;
0036 class GeomInt_TheMultiLineToolOfWLApprox;
0037 class GeomInt_TheComputeLineOfWLApprox;
0038 class GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox;
0039 class GeomInt_MyGradientbisOfTheComputeLineOfWLApprox;
0040 class GeomInt_TheComputeLineBezierOfWLApprox;
0041 class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox;
0042 class AppParCurves_MultiBSpCurve;
0043
0044 class GeomInt_WLApprox
0045 {
0046 private:
0047 struct Approx_Data
0048 {
0049 Approx_Data () : myBezierApprox (Standard_True),
0050 Xo (0.0), Yo (0.0), Zo (0.0),
0051 U1o (0.0), V1o (0.0), U2o (0.0), V2o (0.0),
0052 ApproxXYZ (Standard_True),
0053 ApproxU1V1 (Standard_True),
0054 ApproxU2V2 (Standard_True),
0055 indicemin (0), indicemax (0),
0056 myNbPntMax (30), parametrization (Approx_ChordLength)
0057 {
0058 }
0059
0060 Standard_Boolean myBezierApprox;
0061 Standard_Real Xo, Yo, Zo, U1o, V1o, U2o, V2o;
0062 Standard_Boolean ApproxXYZ, ApproxU1V1, ApproxU2V2;
0063 Standard_Integer indicemin, indicemax, myNbPntMax;
0064 Approx_ParametrizationType parametrization;
0065 };
0066
0067 public:
0068
0069 DEFINE_STANDARD_ALLOC
0070
0071
0072 Standard_EXPORT GeomInt_WLApprox();
0073
0074 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);
0075
0076 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);
0077
0078 Standard_EXPORT
0079 void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d,
0080 const Standard_Integer DegMin,
0081 const Standard_Integer DegMax,
0082 const Standard_Integer NbIterMax,
0083 const Standard_Integer NbPntMax = 30,
0084 const Standard_Boolean ApproxWithTangency = Standard_True,
0085 const Approx_ParametrizationType
0086 Parametrization = Approx_ChordLength);
0087 Standard_EXPORT void Perform();
0088
0089 Standard_EXPORT Standard_Real TolReached3d() const;
0090
0091 Standard_EXPORT Standard_Real TolReached2d() const;
0092
0093 Standard_EXPORT Standard_Boolean IsDone() const;
0094
0095 Standard_EXPORT Standard_Integer NbMultiCurves() const;
0096
0097 Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
0098
0099 Standard_EXPORT static void Parameters(const GeomInt_TheMultiLineOfWLApprox& Line,
0100 const Standard_Integer firstP,
0101 const Standard_Integer lastP,
0102 const Approx_ParametrizationType Par,
0103 math_Vector& TheParameters);
0104
0105
0106 protected:
0107
0108
0109
0110
0111
0112 private:
0113 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);
0114
0115 Standard_EXPORT void UpdateTolReached();
0116
0117
0118 Standard_EXPORT void fillData(const Handle(IntPatch_WLine)& theLine);
0119
0120
0121 Standard_EXPORT void prepareDS(const Standard_Boolean theApproxXYZ,
0122 const Standard_Boolean theApproxU1V1,
0123 const Standard_Boolean theApproxU2V2,
0124 const Standard_Integer indicemin,
0125 const Standard_Integer indicemax);
0126
0127
0128 Standard_EXPORT void buildKnots(const Handle(IntPatch_WLine)& theline,
0129 const Standard_Address thePtrSVSurf);
0130
0131
0132 Standard_EXPORT void buildCurve(const Handle(IntPatch_WLine)& theline,
0133 const Standard_Address thePtrSVSurf);
0134
0135 GeomInt_TheComputeLineOfWLApprox myComputeLine;
0136 GeomInt_TheComputeLineBezierOfWLApprox myComputeLineBezier;
0137 Approx_MCurvesToBSpCurve myBezToBSpl;
0138 Standard_Boolean myWithTangency;
0139 Standard_Real myTol3d;
0140 Standard_Real myTol2d;
0141 Standard_Integer myDegMin;
0142 Standard_Integer myDegMax;
0143 Standard_Integer myNbIterMax;
0144 Standard_Real myTolReached3d;
0145 Standard_Real myTolReached2d;
0146 Approx_Data myData;
0147 NCollection_Vector<Standard_Integer> myKnots;
0148
0149 };
0150
0151
0152
0153
0154
0155
0156
0157 #endif