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_Compute_HeaderFile
0018 #define _AppDef_Compute_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 AppDef_MultiLine;
0037 class AppDef_MyLineTool;
0038 class AppDef_MyGradientOfCompute;
0039 class AppDef_ParLeastSquareOfMyGradientOfCompute;
0040 class AppDef_ResConstraintOfMyGradientOfCompute;
0041 class AppDef_ParFunctionOfMyGradientOfCompute;
0042 class AppDef_Gradient_BFGSOfMyGradientOfCompute;
0043 class AppParCurves_MultiCurve;
0044 class AppParCurves_MultiBSpCurve;
0045
0046
0047
0048 class AppDef_Compute
0049 {
0050 public:
0051
0052 DEFINE_STANDARD_ALLOC
0053
0054
0055
0056
0057
0058
0059
0060
0061 Standard_EXPORT AppDef_Compute(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);
0062
0063
0064
0065
0066
0067
0068
0069 Standard_EXPORT AppDef_Compute(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);
0070
0071
0072 Standard_EXPORT AppDef_Compute(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 AppDef_Compute(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 AppDef_MultiLine& 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 protected:
0126
0127
0128
0129
0130
0131 private:
0132
0133
0134
0135 Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line,
0136 const Standard_Integer fpt,
0137 const Standard_Integer lpt,
0138 math_Vector& Para,
0139 Standard_Real& TheTol3d,
0140 Standard_Real& TheTol2d,
0141 Standard_Integer& indbad);
0142
0143
0144 Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
0145
0146
0147 Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
0148
0149 Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0150
0151 Standard_EXPORT Standard_Real SearchLastLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
0152
0153 Standard_EXPORT void FirstTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
0154
0155 Standard_EXPORT void LastTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
0156
0157
0158 AppParCurves_SequenceOfMultiCurve myMultiCurves;
0159 AppParCurves_MultiCurve TheMultiCurve;
0160 AppParCurves_MultiBSpCurve myspline;
0161 Standard_Boolean alldone;
0162 Standard_Boolean tolreached;
0163 Approx_ParametrizationType Par;
0164 Handle(TColStd_HArray1OfReal) myParameters;
0165 Handle(TColStd_HArray1OfReal) myfirstParam;
0166 Approx_SequenceOfHArray1OfReal myPar;
0167 TColStd_SequenceOfReal Tolers3d;
0168 TColStd_SequenceOfReal Tolers2d;
0169 Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
0170 Standard_Integer mydegremin;
0171 Standard_Integer mydegremax;
0172 Standard_Real mytol3d;
0173 Standard_Real mytol2d;
0174 Standard_Real currenttol3d;
0175 Standard_Real currenttol2d;
0176 Standard_Boolean mycut;
0177 Standard_Boolean mysquares;
0178 Standard_Integer myitermax;
0179 AppParCurves_Constraint myfirstC;
0180 AppParCurves_Constraint mylastC;
0181 Standard_Integer myMultiLineNb;
0182 Standard_Boolean myIsClear;
0183
0184
0185 };
0186
0187
0188
0189
0190
0191
0192
0193 #endif