File indexing completed on 2026-10-02 09:12:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _GeomInt_TheComputeLineOfWLApprox_HeaderFile
0018 #define _GeomInt_TheComputeLineOfWLApprox_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 <NCollection_Array1.hxx>
0027 #include <NCollection_HArray1.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <AppParCurves_ConstraintCouple.hxx>
0030 #include <AppParCurves_Constraint.hxx>
0031 #include <math_Vector.hxx>
0032 class GeomInt_TheMultiLineOfWLApprox;
0033 class GeomInt_TheMultiLineToolOfWLApprox;
0034 class GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox;
0035 class GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox;
0036 class GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox;
0037 class GeomInt_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfWLApprox;
0038 class GeomInt_MyGradientbisOfTheComputeLineOfWLApprox;
0039 class GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox;
0040 class GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox;
0041 class GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox;
0042 class GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox;
0043 class AppParCurves_MultiBSpCurve;
0044 class AppParCurves_MultiCurve;
0045
0046 class GeomInt_TheComputeLineOfWLApprox
0047 {
0048 public:
0049 DEFINE_STANDARD_ALLOC
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(
0061 const GeomInt_TheMultiLineOfWLApprox& Line,
0062 const int degreemin = 4,
0063 const int degreemax = 8,
0064 const double Tolerance3d = 1.0e-3,
0065 const double Tolerance2d = 1.0e-6,
0066 const int NbIterations = 5,
0067 const bool cutting = true,
0068 const Approx_ParametrizationType parametrization = Approx_ChordLength,
0069 const bool Squares = false);
0070
0071
0072
0073
0074
0075
0076
0077 Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line,
0078 const math_Vector& Parameters,
0079 const int degreemin = 4,
0080 const int degreemax = 8,
0081 const double Tolerance3d = 1.0e-03,
0082 const double Tolerance2d = 1.0e-06,
0083 const int NbIterations = 5,
0084 const bool cutting = true,
0085 const bool Squares = false);
0086
0087
0088 Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const math_Vector& Parameters,
0089 const int degreemin = 4,
0090 const int degreemax = 8,
0091 const double Tolerance3d = 1.0e-03,
0092 const double Tolerance2d = 1.0e-06,
0093 const int NbIterations = 5,
0094 const bool cutting = true,
0095 const bool Squares = false);
0096
0097
0098 Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(
0099 const int degreemin = 4,
0100 const int degreemax = 8,
0101 const double Tolerance3d = 1.0e-03,
0102 const double Tolerance2d = 1.0e-06,
0103 const int NbIterations = 5,
0104 const bool cutting = true,
0105 const Approx_ParametrizationType parametrization = Approx_ChordLength,
0106 const bool Squares = false);
0107
0108
0109
0110 Standard_EXPORT void Interpol(const GeomInt_TheMultiLineOfWLApprox& Line);
0111
0112
0113 Standard_EXPORT void Init(const int degreemin = 4,
0114 const int degreemax = 8,
0115 const double Tolerance3d = 1.0e-03,
0116 const double Tolerance2d = 1.0e-06,
0117 const int NbIterations = 5,
0118 const bool cutting = true,
0119 const Approx_ParametrizationType parametrization = Approx_ChordLength,
0120 const bool Squares = false);
0121
0122
0123 Standard_EXPORT void Perform(const GeomInt_TheMultiLineOfWLApprox& Line);
0124
0125
0126
0127 Standard_EXPORT void SetParameters(const math_Vector& ThePar);
0128
0129
0130
0131
0132 Standard_EXPORT void SetKnots(const NCollection_Array1<double>& Knots);
0133
0134
0135
0136 Standard_EXPORT void SetKnotsAndMultiplicities(const NCollection_Array1<double>& Knots,
0137 const NCollection_Array1<int>& Mults);
0138
0139
0140 Standard_EXPORT void SetDegrees(const int degreemin, const int degreemax);
0141
0142
0143 Standard_EXPORT void SetTolerances(const double Tolerance3d, const double Tolerance2d);
0144
0145
0146
0147 Standard_EXPORT void SetContinuity(const int C);
0148
0149
0150 Standard_EXPORT void SetConstraints(const AppParCurves_Constraint firstC,
0151 const AppParCurves_Constraint lastC);
0152
0153
0154
0155
0156
0157 Standard_EXPORT void SetPeriodic(const bool thePeriodic);
0158
0159
0160
0161
0162 Standard_EXPORT bool IsAllApproximated() const;
0163
0164
0165 Standard_EXPORT bool IsToleranceReached() const;
0166
0167
0168 Standard_EXPORT void Error(double& tol3d, double& tol2d) const;
0169
0170
0171 Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
0172
0173
0174 Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue();
0175
0176
0177
0178 Standard_EXPORT const NCollection_Array1<double>& Parameters() const;
0179
0180 private:
0181
0182 Standard_EXPORT bool Compute(const GeomInt_TheMultiLineOfWLApprox& Line,
0183 const int fpt,
0184 const int lpt,
0185 math_Vector& Para,
0186 const NCollection_Array1<double>& Knots,
0187 NCollection_Array1<int>& Mults);
0188
0189
0190 Standard_EXPORT bool ComputeCurve(const GeomInt_TheMultiLineOfWLApprox& Line,
0191 const int firspt,
0192 const int lastpt);
0193
0194
0195 Standard_EXPORT void Parameters(const GeomInt_TheMultiLineOfWLApprox& Line,
0196 const int firstP,
0197 const int LastP,
0198 math_Vector& TheParameters) const;
0199
0200 Standard_EXPORT double SearchFirstLambda(const GeomInt_TheMultiLineOfWLApprox& Line,
0201 const math_Vector& Para,
0202 const NCollection_Array1<double>& Knots,
0203 const math_Vector& V,
0204 const int index) const;
0205
0206 Standard_EXPORT double SearchLastLambda(const GeomInt_TheMultiLineOfWLApprox& Line,
0207 const math_Vector& Para,
0208 const NCollection_Array1<double>& Knots,
0209 const math_Vector& V,
0210 const int index) const;
0211
0212 Standard_EXPORT void TangencyVector(const GeomInt_TheMultiLineOfWLApprox& Line,
0213 const AppParCurves_MultiCurve& C,
0214 const double U,
0215 math_Vector& V) const;
0216
0217 Standard_EXPORT void FirstTangencyVector(const GeomInt_TheMultiLineOfWLApprox& Line,
0218 const int index,
0219 math_Vector& V) const;
0220
0221 Standard_EXPORT void LastTangencyVector(const GeomInt_TheMultiLineOfWLApprox& Line,
0222 const int index,
0223 math_Vector& V) const;
0224
0225 Standard_EXPORT void FindRealConstraints(const GeomInt_TheMultiLineOfWLApprox& Line);
0226
0227 AppParCurves_MultiBSpCurve TheMultiBSpCurve;
0228 bool alldone;
0229 bool tolreached;
0230 Approx_ParametrizationType Par;
0231 occ::handle<NCollection_HArray1<double>> myParameters;
0232 occ::handle<NCollection_HArray1<double>> myfirstParam;
0233 occ::handle<NCollection_HArray1<double>> myknots;
0234 occ::handle<NCollection_HArray1<int>> mymults;
0235 bool myhasknots;
0236 bool myhasmults;
0237 occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
0238 int mydegremin;
0239 int mydegremax;
0240 double mytol3d;
0241 double mytol2d;
0242 double currenttol3d;
0243 double currenttol2d;
0244 bool mycut;
0245 bool mysquares;
0246 int myitermax;
0247 AppParCurves_Constraint myfirstC;
0248 AppParCurves_Constraint mylastC;
0249 AppParCurves_Constraint realfirstC;
0250 AppParCurves_Constraint reallastC;
0251 int mycont;
0252 double mylambda1;
0253 double mylambda2;
0254 bool myPeriodic;
0255 };
0256
0257 #endif