42cf5bc1 |
1 | // Created on: 1994-03-03 |
2 | // Created by: Joelle CHAUVET |
3 | // Copyright (c) 1994-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 _BRepFill_ComputeCLine_HeaderFile |
18 | #define _BRepFill_ComputeCLine_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 <BRepFill_MultiLine.hxx> |
32 | class AppParCurves_MultiCurve; |
33 | |
34 | |
35 | |
36 | class BRepFill_ComputeCLine |
37 | { |
38 | public: |
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 BRepFill_ComputeCLine(const BRepFill_MultiLine& 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 BRepFill_ComputeCLine(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 BRepFill_MultiLine& 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 | |
f998596a |
64 | //! Changes the max number of segments, which is allowed for cutting. |
65 | Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments); |
66 | |
36b9ff75 |
67 | //! returns False if at a moment of the approximation, |
68 | //! the status NoApproximation has been sent by the user |
69 | //! when more points were needed. |
42cf5bc1 |
70 | Standard_EXPORT Standard_Boolean IsAllApproximated() const; |
71 | |
36b9ff75 |
72 | //! returns False if the status NoPointsAdded has been sent. |
42cf5bc1 |
73 | Standard_EXPORT Standard_Boolean IsToleranceReached() const; |
74 | |
36b9ff75 |
75 | //! returns the tolerances 2d and 3d of the <Index> MultiCurve. |
42cf5bc1 |
76 | Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; |
77 | |
36b9ff75 |
78 | //! Returns the number of MultiCurve doing the approximation |
79 | //! of the MultiLine. |
42cf5bc1 |
80 | Standard_EXPORT Standard_Integer NbMultiCurves() const; |
81 | |
36b9ff75 |
82 | //! returns the approximation MultiCurve of range <Index>. |
42cf5bc1 |
83 | Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const; |
84 | |
85 | Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const; |
86 | |
87 | |
88 | |
89 | |
90 | protected: |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | private: |
97 | |
98 | |
36b9ff75 |
99 | //! is internally used by the algorithms. |
42cf5bc1 |
100 | Standard_EXPORT Standard_Boolean Compute (const BRepFill_MultiLine& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d); |
101 | |
102 | |
103 | AppParCurves_SequenceOfMultiCurve myMultiCurves; |
104 | TColStd_SequenceOfReal myfirstparam; |
105 | TColStd_SequenceOfReal mylastparam; |
106 | AppParCurves_MultiCurve TheMultiCurve; |
107 | Standard_Boolean alldone; |
108 | Standard_Boolean tolreached; |
109 | TColStd_SequenceOfReal Tolers3d; |
110 | TColStd_SequenceOfReal Tolers2d; |
111 | Standard_Integer mydegremin; |
112 | Standard_Integer mydegremax; |
113 | Standard_Real mytol3d; |
114 | Standard_Real mytol2d; |
115 | Standard_Real currenttol3d; |
116 | Standard_Real currenttol2d; |
117 | Standard_Boolean mycut; |
118 | AppParCurves_Constraint myfirstC; |
119 | AppParCurves_Constraint mylastC; |
f998596a |
120 | Standard_Integer myMaxSegments; |
42cf5bc1 |
121 | |
122 | }; |
123 | |
124 | |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | #endif // _BRepFill_ComputeCLine_HeaderFile |