File indexing completed on 2025-01-18 10:02:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AppDef_BSplineCompute_HeaderFile
0018 #define _AppDef_BSplineCompute_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <AppParCurves_MultiBSpCurve.hxx>
0025 #include <Approx_ParametrizationType.hxx>
0026 #include <TColStd_HArray1OfReal.hxx>
0027 #include <TColStd_HArray1OfInteger.hxx>
0028 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <Standard_Real.hxx>
0031 #include <AppParCurves_Constraint.hxx>
0032 #include <math_Vector.hxx>
0033 #include <TColStd_Array1OfReal.hxx>
0034 #include <TColStd_Array1OfInteger.hxx>
0035 class AppDef_MultiLine;
0036 class AppDef_MyLineTool;
0037 class AppDef_MyBSplGradientOfBSplineCompute;
0038 class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
0039 class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
0040 class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute;
0041 class AppDef_MyGradientbisOfBSplineCompute;
0042 class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
0043 class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
0044 class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
0045 class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute;
0046 class AppParCurves_MultiBSpCurve;
0047 class AppParCurves_MultiCurve;
0048
0049
0050
0051 class AppDef_BSplineCompute
0052 {
0053 public:
0054
0055 DEFINE_STANDARD_ALLOC
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& 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);
0068
0069
0070
0071
0072
0073
0074
0075 Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& 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);
0076
0077
0078 Standard_EXPORT AppDef_BSplineCompute(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);
0079
0080
0081 Standard_EXPORT AppDef_BSplineCompute(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);
0082
0083
0084
0085 Standard_EXPORT void Interpol (const AppDef_MultiLine& Line);
0086
0087
0088 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);
0089
0090
0091 Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
0092
0093
0094
0095 Standard_EXPORT void SetParameters (const math_Vector& ThePar);
0096
0097
0098
0099
0100 Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots);
0101
0102
0103
0104 Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
0105
0106
0107 Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
0108
0109
0110 Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
0111
0112
0113
0114 Standard_EXPORT void SetContinuity (const Standard_Integer C);
0115
0116
0117 Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
0118
0119
0120
0121
0122
0123 Standard_EXPORT void SetPeriodic(const Standard_Boolean thePeriodic);
0124
0125
0126
0127
0128 Standard_EXPORT Standard_Boolean IsAllApproximated() const;
0129
0130
0131 Standard_EXPORT Standard_Boolean IsToleranceReached() const;
0132
0133
0134 Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const;
0135
0136
0137 Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
0138
0139
0140 Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue();
0141
0142
0143
0144 Standard_EXPORT const TColStd_Array1OfReal& Parameters() const;
0145
0146
0147
0148
0149 protected:
0150
0151
0152
0153
0154
0155 private:
0156
0157
0158
0159 Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, const TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults);
0160
0161
0162 Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
0163
0164
0165 Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
0166
0167 Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const;
0168
0169 Standard_EXPORT Standard_Real SearchLastLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const;
0170
0171 Standard_EXPORT void TangencyVector (const AppDef_MultiLine& Line, const AppParCurves_MultiCurve& C, const Standard_Real U, math_Vector& V) const;
0172
0173 Standard_EXPORT void FirstTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
0174
0175 Standard_EXPORT void LastTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
0176
0177 Standard_EXPORT void FindRealConstraints (const AppDef_MultiLine& Line);
0178
0179
0180 AppParCurves_MultiBSpCurve TheMultiBSpCurve;
0181 Standard_Boolean alldone;
0182 Standard_Boolean tolreached;
0183 Approx_ParametrizationType Par;
0184 Handle(TColStd_HArray1OfReal) myParameters;
0185 Handle(TColStd_HArray1OfReal) myfirstParam;
0186 Handle(TColStd_HArray1OfReal) myknots;
0187 Handle(TColStd_HArray1OfInteger) mymults;
0188 Standard_Boolean myhasknots;
0189 Standard_Boolean myhasmults;
0190 Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
0191 Standard_Integer mydegremin;
0192 Standard_Integer mydegremax;
0193 Standard_Real mytol3d;
0194 Standard_Real mytol2d;
0195 Standard_Real currenttol3d;
0196 Standard_Real currenttol2d;
0197 Standard_Boolean mycut;
0198 Standard_Boolean mysquares;
0199 Standard_Integer myitermax;
0200 AppParCurves_Constraint myfirstC;
0201 AppParCurves_Constraint mylastC;
0202 AppParCurves_Constraint realfirstC;
0203 AppParCurves_Constraint reallastC;
0204 Standard_Integer mycont;
0205 Standard_Real mylambda1;
0206 Standard_Real mylambda2;
0207 Standard_Boolean myPeriodic;
0208
0209
0210 };
0211
0212
0213
0214
0215
0216
0217
0218 #endif