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_TheComputeLineBezierOfWLApprox_HeaderFile
0018 #define _GeomInt_TheComputeLineBezierOfWLApprox_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <AppParCurves_SequenceOfMultiCurve.hxx>
0025 #include <AppParCurves_MultiCurve.hxx>
0026 #include <AppParCurves_MultiBSpCurve.hxx>
0027 #include <Approx_ParametrizationType.hxx>
0028 #include <TColStd_HArray1OfReal.hxx>
0029 #include <Approx_SequenceOfHArray1OfReal.hxx>
0030 #include <TColStd_SequenceOfReal.hxx>
0031 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
0032 #include <Standard_Integer.hxx>
0033 #include <AppParCurves_Constraint.hxx>
0034 #include <math_Vector.hxx>
0035 #include <TColStd_Array1OfReal.hxx>
0036 class GeomInt_TheMultiLineOfWLApprox;
0037 class GeomInt_TheMultiLineToolOfWLApprox;
0038 class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox;
0039 class GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox;
0040 class GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox;
0041 class GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox;
0042 class GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox;
0043 class AppParCurves_MultiCurve;
0044 class AppParCurves_MultiBSpCurve;
0045
0046
0047
0048 class GeomInt_TheComputeLineBezierOfWLApprox
0049 {
0050 public:
0051
0052 DEFINE_STANDARD_ALLOC
0053
0054
0055
0056
0057
0058
0059
0060
0061 Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
0062
0063
0064
0065
0066
0067
0068
0069 Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
0070
0071
0072 Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
0073
0074
0075 Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
0076
0077
0078 Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
0079
0080
0081 Standard_EXPORT void Perform (const GeomInt_TheMultiLineOfWLApprox& Line);
0082
0083
0084 Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
0085
0086
0087 Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
0088
0089
0090 Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
0091
0092
0093
0094
0095 Standard_EXPORT Standard_Boolean IsAllApproximated() const;
0096
0097
0098 Standard_EXPORT Standard_Boolean IsToleranceReached() const;
0099
0100
0101 Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
0102
0103
0104
0105 Standard_EXPORT Standard_Integer NbMultiCurves() const;
0106
0107
0108 Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
0109
0110
0111 Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
0112
0113
0114 Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
0115
0116
0117 Standard_EXPORT Approx_ParametrizationType Parametrization () const;
0118
0119
0120
0121 Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
0122
0123
0124
0125
0126 protected:
0127
0128
0129
0130
0131
0132 private:
0133
0134
0135
0136 Standard_EXPORT Standard_Boolean Compute (const GeomInt_TheMultiLineOfWLApprox& Line,
0137 const Standard_Integer fpt,
0138 const Standard_Integer lpt,
0139 math_Vector& Para,
0140 Standard_Real& TheTol3d,
0141 Standard_Real& TheTol2d,
0142 Standard_Integer& indbad);
0143
0144
0145 Standard_EXPORT Standard_Boolean ComputeCurve (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
0146
0147
0148 Standard_EXPORT void Parameters (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
0149
0150 Standard_EXPORT Standard_Real SearchFirstLambda (const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0151
0152 Standard_EXPORT Standard_Real SearchLastLambda (const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0153
0154 Standard_EXPORT void FirstTangencyVector (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer index, math_Vector& V) const;
0155
0156 Standard_EXPORT void LastTangencyVector (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer index, math_Vector& V) const;
0157
0158
0159 AppParCurves_SequenceOfMultiCurve myMultiCurves;
0160 AppParCurves_MultiCurve TheMultiCurve;
0161 AppParCurves_MultiBSpCurve myspline;
0162 Standard_Boolean alldone;
0163 Standard_Boolean tolreached;
0164 Approx_ParametrizationType Par;
0165 Handle(TColStd_HArray1OfReal) myParameters;
0166 Handle(TColStd_HArray1OfReal) myfirstParam;
0167 Approx_SequenceOfHArray1OfReal myPar;
0168 TColStd_SequenceOfReal Tolers3d;
0169 TColStd_SequenceOfReal Tolers2d;
0170 Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
0171 Standard_Integer mydegremin;
0172 Standard_Integer mydegremax;
0173 Standard_Real mytol3d;
0174 Standard_Real mytol2d;
0175 Standard_Real currenttol3d;
0176 Standard_Real currenttol2d;
0177 Standard_Boolean mycut;
0178 Standard_Boolean mysquares;
0179 Standard_Integer myitermax;
0180 AppParCurves_Constraint myfirstC;
0181 AppParCurves_Constraint mylastC;
0182 Standard_Integer myMultiLineNb;
0183 Standard_Boolean myIsClear;
0184
0185
0186 };
0187
0188
0189
0190
0191
0192
0193
0194 #endif