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