42cf5bc1 |
1 | // Created on: 1993-09-13 |
2 | // Created by: Jacques GOUSSARD |
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 _Blend_AppFunction_HeaderFile |
18 | #define _Blend_AppFunction_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <math_FunctionSetWithDerivatives.hxx> |
42cf5bc1 |
25 | #include <Standard_Boolean.hxx> |
26 | #include <math_Vector.hxx> |
42cf5bc1 |
27 | #include <TColStd_Array1OfReal.hxx> |
28 | #include <GeomAbs_Shape.hxx> |
29 | #include <TColStd_Array1OfInteger.hxx> |
30 | #include <TColgp_Array1OfPnt.hxx> |
31 | #include <TColgp_Array1OfVec.hxx> |
32 | #include <TColgp_Array1OfPnt2d.hxx> |
33 | #include <TColgp_Array1OfVec2d.hxx> |
42cf5bc1 |
34 | class math_Matrix; |
35 | class gp_Pnt; |
36 | class Blend_Point; |
37 | |
38 | |
39 | //! Deferred class for a function used to compute a blending |
40 | //! surface between two surfaces, using a guide line. |
41 | //! The vector <X> used in Value, Values and Derivatives methods |
42 | //! has to be the vector of the parametric coordinates U1,V1, |
43 | //! U2,V2, of the extremities of a section on the first and |
44 | //! second surface. |
45 | class Blend_AppFunction : public math_FunctionSetWithDerivatives |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | //! returns the number of variables of the function. |
53 | Standard_EXPORT virtual Standard_Integer NbVariables() const = 0; |
54 | |
55 | //! returns the number of equations of the function. |
56 | Standard_EXPORT virtual Standard_Integer NbEquations() const = 0; |
57 | |
58 | //! computes the values <F> of the Functions for the |
59 | //! variable <X>. |
60 | //! Returns True if the computation was done successfully, |
61 | //! False otherwise. |
62 | Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, math_Vector& F) = 0; |
63 | |
64 | //! returns the values <D> of the derivatives for the |
65 | //! variable <X>. |
66 | //! Returns True if the computation was done successfully, |
67 | //! False otherwise. |
68 | Standard_EXPORT virtual Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) = 0; |
69 | |
70 | //! returns the values <F> of the functions and the derivatives |
71 | //! <D> for the variable <X>. |
72 | //! Returns True if the computation was done successfully, |
73 | //! False otherwise. |
1d54b807 |
74 | Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, |
75 | math_Vector& F, |
76 | math_Matrix& D) = 0; |
42cf5bc1 |
77 | |
78 | //! Sets the value of the parameter along the guide line. |
79 | //! This determines the plane in which the solution has |
80 | //! to be found. |
81 | Standard_EXPORT virtual void Set (const Standard_Real Param) = 0; |
82 | |
83 | //! Sets the bounds of the parametric interval on |
84 | //! the guide line. |
85 | //! This determines the derivatives in these values if the |
86 | //! function is not Cn. |
87 | Standard_EXPORT virtual void Set (const Standard_Real First, const Standard_Real Last) = 0; |
88 | |
89 | //! Returns in the vector Tolerance the parametric tolerance |
90 | //! for each of the 4 variables; |
91 | //! Tol is the tolerance used in 3d space. |
1d54b807 |
92 | Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, |
93 | const Standard_Real Tol) const = 0; |
42cf5bc1 |
94 | |
95 | //! Returns in the vector InfBound the lowest values allowed |
96 | //! for each of the 4 variables. |
97 | //! Returns in the vector SupBound the greatest values allowed |
98 | //! for each of the 4 variables. |
99 | Standard_EXPORT virtual void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const = 0; |
100 | |
101 | //! Returns Standard_True if Sol is a zero of the function. |
102 | //! Tol is the tolerance used in 3d space. |
103 | //! The computation is made at the current value of |
104 | //! the parameter on the guide line. |
1d54b807 |
105 | Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, |
106 | const Standard_Real Tol) = 0; |
42cf5bc1 |
107 | |
21c7c457 |
108 | //! Returns the minimal Distance between two |
109 | //! extremities of calculated sections. |
42cf5bc1 |
110 | Standard_EXPORT virtual Standard_Real GetMinimalDistance() const = 0; |
111 | |
112 | //! Returns the point on the first support. |
113 | Standard_EXPORT virtual const gp_Pnt& Pnt1() const = 0; |
114 | |
115 | //! Returns the point on the first support. |
116 | Standard_EXPORT virtual const gp_Pnt& Pnt2() const = 0; |
117 | |
118 | //! Returns if the section is rationnal |
119 | Standard_EXPORT virtual Standard_Boolean IsRational() const = 0; |
120 | |
121 | //! Returns the length of the maximum section |
122 | Standard_EXPORT virtual Standard_Real GetSectionSize() const = 0; |
123 | |
124 | //! Compute the minimal value of weight for each poles |
125 | //! of all sections. |
126 | Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const = 0; |
127 | |
128 | //! Returns the number of intervals for continuity |
129 | //! <S>. May be one if Continuity(me) >= <S> |
130 | Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0; |
131 | |
132 | //! Stores in <T> the parameters bounding the intervals |
133 | //! of continuity <S>. |
134 | //! |
21c7c457 |
135 | //! The array must provide enough room to accommodate |
42cf5bc1 |
136 | //! for the parameters. i.e. T.Length() > NbIntervals() |
137 | //! raises |
138 | //! OutOfRange from Standard |
1d54b807 |
139 | Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, |
140 | const GeomAbs_Shape S) const = 0; |
42cf5bc1 |
141 | |
1d54b807 |
142 | Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, |
143 | Standard_Integer& NbKnots, |
144 | Standard_Integer& Degree, |
145 | Standard_Integer& NbPoles2d) = 0; |
42cf5bc1 |
146 | |
147 | //! Returns the tolerance to reach in approximation |
148 | //! to respecte |
149 | //! BoundTol error at the Boundary |
150 | //! AngleTol tangent error at the Boundary |
151 | //! SurfTol error inside the surface. |
1d54b807 |
152 | Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, |
153 | const Standard_Real SurfTol, |
154 | const Standard_Real AngleTol, |
155 | math_Vector& Tol3d, |
156 | math_Vector& Tol1D) const = 0; |
42cf5bc1 |
157 | |
158 | Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) = 0; |
159 | |
160 | Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) = 0; |
161 | |
162 | //! Used for the first and last section |
163 | //! The method returns Standard_True if the derivatives |
164 | //! are computed, otherwise it returns Standard_False. |
1d54b807 |
165 | Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, |
166 | TColgp_Array1OfPnt& Poles, |
167 | TColgp_Array1OfVec& DPoles, |
168 | TColgp_Array1OfPnt2d& Poles2d, |
169 | TColgp_Array1OfVec2d& DPoles2d, |
170 | TColStd_Array1OfReal& Weigths, |
171 | TColStd_Array1OfReal& DWeigths) = 0; |
172 | |
173 | Standard_EXPORT virtual void Section (const Blend_Point& P, |
174 | TColgp_Array1OfPnt& Poles, |
175 | TColgp_Array1OfPnt2d& Poles2d, |
176 | TColStd_Array1OfReal& Weigths) = 0; |
42cf5bc1 |
177 | |
178 | //! Used for the first and last section |
179 | //! The method returns Standard_True if the derivatives |
180 | //! are computed, otherwise it returns Standard_False. |
1d54b807 |
181 | Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, |
182 | TColgp_Array1OfPnt& Poles, |
183 | TColgp_Array1OfVec& DPoles, |
184 | TColgp_Array1OfVec& D2Poles, |
185 | TColgp_Array1OfPnt2d& Poles2d, |
186 | TColgp_Array1OfVec2d& DPoles2d, |
187 | TColgp_Array1OfVec2d& D2Poles2d, |
188 | TColStd_Array1OfReal& Weigths, |
189 | TColStd_Array1OfReal& DWeigths, |
190 | TColStd_Array1OfReal& D2Weigths) = 0; |
191 | |
192 | Standard_EXPORT virtual void Resolution (const Standard_Integer IC2d, |
193 | const Standard_Real Tol, |
194 | Standard_Real& TolU, |
195 | Standard_Real& TolV) const = 0; |
42cf5bc1 |
196 | |
197 | //! Returns the parameter of the point P. Used to |
198 | //! impose the parameters in the approximation. |
199 | Standard_EXPORT Standard_Real Parameter (const Blend_Point& P) const; |
200 | |
201 | |
202 | |
203 | |
204 | protected: |
205 | |
206 | |
207 | |
208 | |
209 | |
210 | private: |
211 | |
212 | |
213 | |
214 | |
215 | |
216 | }; |
217 | |
218 | |
219 | |
220 | |
221 | |
222 | |
223 | |
224 | #endif // _Blend_AppFunction_HeaderFile |