File indexing completed on 2025-01-18 10:03:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepApprox_TheComputeLineBezierOfApprox_HeaderFile
0018 #define _BRepApprox_TheComputeLineBezierOfApprox_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 BRepApprox_TheMultiLineOfApprox;
0037 class BRepApprox_TheMultiLineToolOfApprox;
0038 class BRepApprox_MyGradientOfTheComputeLineBezierOfApprox;
0039 class BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox;
0040 class BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox;
0041 class BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox;
0042 class BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox;
0043 class AppParCurves_MultiCurve;
0044 class AppParCurves_MultiBSpCurve;
0045
0046
0047
0048 class BRepApprox_TheComputeLineBezierOfApprox
0049 {
0050 public:
0051
0052 DEFINE_STANDARD_ALLOC
0053
0054
0055
0056
0057
0058
0059
0060
0061 Standard_EXPORT BRepApprox_TheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& 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 BRepApprox_TheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& 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 BRepApprox_TheComputeLineBezierOfApprox(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 BRepApprox_TheComputeLineBezierOfApprox(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 BRepApprox_TheMultiLineOfApprox& 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 protected:
0124
0125
0126
0127
0128
0129 private:
0130
0131
0132
0133 Standard_EXPORT Standard_Boolean Compute (const BRepApprox_TheMultiLineOfApprox& Line,
0134 const Standard_Integer fpt,
0135 const Standard_Integer lpt,
0136 math_Vector& Para,
0137 Standard_Real& TheTol3d,
0138 Standard_Real& TheTol2d,
0139 Standard_Integer& indbad);
0140
0141
0142 Standard_EXPORT Standard_Boolean ComputeCurve (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
0143
0144
0145 Standard_EXPORT void Parameters (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
0146
0147 Standard_EXPORT Standard_Real SearchFirstLambda (const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0148
0149 Standard_EXPORT Standard_Real SearchLastLambda (const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0150
0151 Standard_EXPORT void FirstTangencyVector (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer index, math_Vector& V) const;
0152
0153 Standard_EXPORT void LastTangencyVector (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer index, math_Vector& V) const;
0154
0155
0156 AppParCurves_SequenceOfMultiCurve myMultiCurves;
0157 AppParCurves_MultiCurve TheMultiCurve;
0158 AppParCurves_MultiBSpCurve myspline;
0159 Standard_Boolean alldone;
0160 Standard_Boolean tolreached;
0161 Approx_ParametrizationType Par;
0162 Handle(TColStd_HArray1OfReal) myParameters;
0163 Handle(TColStd_HArray1OfReal) myfirstParam;
0164 Approx_SequenceOfHArray1OfReal myPar;
0165 TColStd_SequenceOfReal Tolers3d;
0166 TColStd_SequenceOfReal Tolers2d;
0167 Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
0168 Standard_Integer mydegremin;
0169 Standard_Integer mydegremax;
0170 Standard_Real mytol3d;
0171 Standard_Real mytol2d;
0172 Standard_Real currenttol3d;
0173 Standard_Real currenttol2d;
0174 Standard_Boolean mycut;
0175 Standard_Boolean mysquares;
0176 Standard_Integer myitermax;
0177 AppParCurves_Constraint myfirstC;
0178 AppParCurves_Constraint mylastC;
0179 Standard_Integer myMultiLineNb;
0180 Standard_Boolean myIsClear;
0181
0182
0183 };
0184
0185
0186
0187
0188
0189
0190
0191 #endif