42cf5bc1 |
1 | // Created on: 1997-06-25 |
2 | // Created by: Philippe MANGIN |
3 | // Copyright (c) 1997-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_SweepFunction_HeaderFile |
18 | #define _Approx_SweepFunction_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <MMgt_TShared.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <TColgp_Array1OfPnt.hxx> |
27 | #include <TColgp_Array1OfPnt2d.hxx> |
28 | #include <TColStd_Array1OfReal.hxx> |
29 | #include <TColgp_Array1OfVec.hxx> |
30 | #include <TColgp_Array1OfVec2d.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <TColStd_Array1OfInteger.hxx> |
33 | #include <GeomAbs_Shape.hxx> |
34 | class Standard_NotImplemented; |
35 | class Standard_OutOfRange; |
36 | class gp_Pnt; |
37 | |
38 | |
39 | class Approx_SweepFunction; |
40 | DEFINE_STANDARD_HANDLE(Approx_SweepFunction, MMgt_TShared) |
41 | |
42 | //! defined the function used by SweepApproximation to |
43 | //! perform sweeping application. |
44 | class Approx_SweepFunction : public MMgt_TShared |
45 | { |
46 | |
47 | public: |
48 | |
49 | |
50 | //! compute the section for v = param |
51 | Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0; |
52 | |
53 | //! compute the first derivative in v direction of the |
54 | //! section for v = param |
55 | //! Warning : It used only for C1 or C2 aproximation |
56 | Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths); |
57 | |
58 | //! compute the second derivative in v direction of the |
59 | //! section for v = param |
60 | //! Warning : It used only for C2 aproximation |
61 | Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths); |
62 | |
63 | //! get the number of 2d curves to approximate. |
64 | Standard_EXPORT virtual Standard_Integer Nb2dCurves() const = 0; |
65 | |
66 | //! get the format of an section |
67 | Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const = 0; |
68 | |
69 | //! get the Knots of the section |
70 | Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const = 0; |
71 | |
72 | //! get the Multplicities of the section |
73 | Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const = 0; |
74 | |
75 | //! Returns if the sections are rationnal or not |
76 | Standard_EXPORT virtual Standard_Boolean IsRational() const = 0; |
77 | |
78 | //! Returns the number of intervals for continuity |
79 | //! <S>. |
80 | //! May be one if Continuity(me) >= <S> |
81 | Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0; |
82 | |
83 | //! Stores in <T> the parameters bounding the intervals |
84 | //! of continuity <S>. |
85 | //! |
86 | //! The array must provide enough room to accomodate |
87 | //! for the parameters. i.e. T.Length() > NbIntervals() |
88 | Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0; |
89 | |
90 | //! Sets the bounds of the parametric interval on |
91 | //! the fonction |
92 | //! This determines the derivatives in these values if the |
93 | //! function is not Cn. |
94 | Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0; |
95 | |
96 | //! Returns the resolutions in the sub-space 2d <Index> |
97 | //! This information is usfull to find an good tolerance in |
98 | //! 2d approximation. |
99 | Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const; |
100 | |
101 | //! Returns the tolerance to reach in approximation |
102 | //! to satisfy. |
103 | //! BoundTol error at the Boundary |
104 | //! AngleTol tangent error at the Boundary (in radian) |
105 | //! SurfTol error inside the surface. |
106 | Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const = 0; |
107 | |
108 | //! Is usefull, if (me) have to run numerical |
109 | //! algorithm to perform D0, D1 or D2 |
110 | Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d) = 0; |
111 | |
112 | //! Get the barycentre of Surface. |
113 | //! An very poor estimation is sufficent. |
114 | //! This information is usefull to perform well |
115 | //! conditioned rational approximation. |
116 | //! Warning: Used only if <me> IsRational |
117 | Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const; |
118 | |
119 | //! Returns the length of the greater section. This |
120 | //! information is usefull to G1's control. |
121 | //! Warning: With an little value, approximation can be slower. |
122 | Standard_EXPORT virtual Standard_Real MaximalSection() const; |
123 | |
124 | //! Compute the minimal value of weight for each poles |
125 | //! in all sections. |
126 | //! This information is usefull to control error |
127 | //! in rational approximation. |
128 | //! Warning: Used only if <me> IsRational |
129 | Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const; |
130 | |
131 | |
132 | |
133 | |
92efcf78 |
134 | DEFINE_STANDARD_RTTIEXT(Approx_SweepFunction,MMgt_TShared) |
42cf5bc1 |
135 | |
136 | protected: |
137 | |
138 | |
139 | |
140 | |
141 | private: |
142 | |
143 | |
144 | |
145 | |
146 | }; |
147 | |
148 | |
149 | |
150 | |
151 | |
152 | |
153 | |
154 | #endif // _Approx_SweepFunction_HeaderFile |