0026595: Lost some comments in OCCT-code after cdl elimination
[occt.git] / src / Approx / Approx_FitAndDivide.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-01-26
2// Created by: Laurent PAINNOT
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Approx_FitAndDivide_HeaderFile
18#define _Approx_FitAndDivide_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <AppParCurves_SequenceOfMultiCurve.hxx>
25#include <TColStd_SequenceOfReal.hxx>
26#include <AppParCurves_MultiCurve.hxx>
27#include <Standard_Boolean.hxx>
28#include <Standard_Integer.hxx>
29#include <Standard_Real.hxx>
30#include <AppParCurves_Constraint.hxx>
31#include <AppCont_Function.hxx>
32class AppParCurves_MultiCurve;
33
34
35
36class Approx_FitAndDivide
37{
38public:
39
40 DEFINE_STANDARD_ALLOC
41
42
36b9ff75 43 //! The MultiLine <Line> will be approximated until tolerances
44 //! will be reached.
45 //! The approximation will be done from degreemin to degreemax
46 //! with a cutting if the corresponding boolean is True.
42cf5bc1 47 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);
48
36b9ff75 49 //! Initializes the fields of the algorithm.
42cf5bc1 50 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);
51
36b9ff75 52 //! runs the algorithm after having initialized the fields.
42cf5bc1 53 Standard_EXPORT void Perform (const AppCont_Function& Line);
54
36b9ff75 55 //! changes the degrees of the approximation.
42cf5bc1 56 Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
57
36b9ff75 58 //! Changes the tolerances of the approximation.
42cf5bc1 59 Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
60
36b9ff75 61 //! Changes the constraints of the approximation.
42cf5bc1 62 Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
63
36b9ff75 64 //! returns False if at a moment of the approximation,
65 //! the status NoApproximation has been sent by the user
66 //! when more points were needed.
42cf5bc1 67 Standard_EXPORT Standard_Boolean IsAllApproximated() const;
68
36b9ff75 69 //! returns False if the status NoPointsAdded has been sent.
42cf5bc1 70 Standard_EXPORT Standard_Boolean IsToleranceReached() const;
71
36b9ff75 72 //! returns the tolerances 2d and 3d of the <Index> MultiCurve.
42cf5bc1 73 Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
74
36b9ff75 75 //! Returns the number of MultiCurve doing the approximation
76 //! of the MultiLine.
42cf5bc1 77 Standard_EXPORT Standard_Integer NbMultiCurves() const;
78
36b9ff75 79 //! returns the approximation MultiCurve of range <Index>.
42cf5bc1 80 Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const;
81
82 Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const;
83
84
85
86
87protected:
88
89
90
91
92
93private:
94
95
36b9ff75 96 //! is internally used by the algorithms.
42cf5bc1 97 Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
98
99
100 AppParCurves_SequenceOfMultiCurve myMultiCurves;
101 TColStd_SequenceOfReal myfirstparam;
102 TColStd_SequenceOfReal mylastparam;
103 AppParCurves_MultiCurve TheMultiCurve;
104 Standard_Boolean alldone;
105 Standard_Boolean tolreached;
106 TColStd_SequenceOfReal Tolers3d;
107 TColStd_SequenceOfReal Tolers2d;
108 Standard_Integer mydegremin;
109 Standard_Integer mydegremax;
110 Standard_Real mytol3d;
111 Standard_Real mytol2d;
112 Standard_Real currenttol3d;
113 Standard_Real currenttol2d;
114 Standard_Boolean mycut;
115 AppParCurves_Constraint myfirstC;
116 AppParCurves_Constraint mylastC;
117
118
119};
120
121
122
123
124
125
126
127#endif // _Approx_FitAndDivide_HeaderFile