File indexing completed on 2025-01-18 10:02:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Approx_FitAndDivide_HeaderFile
0018 #define _Approx_FitAndDivide_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022
0023 #include <AppParCurves_SequenceOfMultiCurve.hxx>
0024 #include <TColStd_SequenceOfReal.hxx>
0025 #include <AppParCurves_MultiCurve.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <AppParCurves_Constraint.hxx>
0028 #include <AppCont_Function.hxx>
0029 class AppParCurves_MultiCurve;
0030
0031
0032
0033 class Approx_FitAndDivide
0034 {
0035 public:
0036
0037 DEFINE_STANDARD_ALLOC
0038
0039
0040
0041
0042
0043
0044 Standard_EXPORT Approx_FitAndDivide(const AppCont_Function& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
0045
0046
0047 Standard_EXPORT Approx_FitAndDivide(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
0048
0049
0050 Standard_EXPORT void Perform (const AppCont_Function& Line);
0051
0052
0053 Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
0054
0055
0056 Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
0057
0058
0059 Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
0060
0061
0062 Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments);
0063
0064
0065
0066
0067
0068 Standard_EXPORT void SetInvOrder(const Standard_Boolean theInvOrder);
0069
0070
0071
0072
0073
0074 Standard_EXPORT void SetHangChecking(const Standard_Boolean theHangChecking);
0075
0076
0077
0078
0079 Standard_EXPORT Standard_Boolean IsAllApproximated() const;
0080
0081
0082 Standard_EXPORT Standard_Boolean IsToleranceReached() const;
0083
0084
0085 Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
0086
0087
0088
0089 Standard_EXPORT Standard_Integer NbMultiCurves() const;
0090
0091
0092 Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const;
0093
0094 Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const;
0095
0096
0097
0098
0099 protected:
0100
0101
0102
0103
0104
0105 private:
0106
0107
0108
0109 Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
0110
0111
0112 AppParCurves_SequenceOfMultiCurve myMultiCurves;
0113 TColStd_SequenceOfReal myfirstparam;
0114 TColStd_SequenceOfReal mylastparam;
0115 AppParCurves_MultiCurve TheMultiCurve;
0116 Standard_Boolean alldone;
0117 Standard_Boolean tolreached;
0118 TColStd_SequenceOfReal Tolers3d;
0119 TColStd_SequenceOfReal Tolers2d;
0120 Standard_Integer mydegremin;
0121 Standard_Integer mydegremax;
0122 Standard_Real mytol3d;
0123 Standard_Real mytol2d;
0124 Standard_Real currenttol3d;
0125 Standard_Real currenttol2d;
0126 Standard_Boolean mycut;
0127 AppParCurves_Constraint myfirstC;
0128 AppParCurves_Constraint mylastC;
0129 Standard_Integer myMaxSegments;
0130 Standard_Boolean myInvOrder;
0131 Standard_Boolean myHangChecking;
0132
0133
0134 };
0135
0136
0137
0138
0139
0140
0141
0142 #endif