0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Blend / Blend_RstRstFunction.hxx
CommitLineData
42cf5bc1 1// Created by: Jacques GOUSSARD Author: Laurent BOURESCHE --
2// Copyright (c) 1997-1999 Matra Datavision
3// Copyright (c) 1999-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _Blend_RstRstFunction_HeaderFile
17#define _Blend_RstRstFunction_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <Blend_AppFunction.hxx>
24#include <Standard_Integer.hxx>
25#include <Standard_Boolean.hxx>
26#include <math_Vector.hxx>
27#include <Standard_Real.hxx>
28#include <Blend_DecrochStatus.hxx>
29#include <TColStd_Array1OfReal.hxx>
30#include <GeomAbs_Shape.hxx>
31#include <TColStd_Array1OfInteger.hxx>
32#include <TColgp_Array1OfPnt.hxx>
33#include <TColgp_Array1OfPnt2d.hxx>
34#include <TColgp_Array1OfVec.hxx>
35#include <TColgp_Array1OfVec2d.hxx>
36class Standard_DomainError;
37class math_Matrix;
38class gp_Pnt;
39class gp_Pnt2d;
40class gp_Vec;
41class gp_Vec2d;
42class Blend_Point;
43
44
45//! Deferred class for a function used to compute a blending
46//! surface between a surface and a pcurve on an other Surface,
47//! using a guide line.
48//! The vector <X> used in Value, Values and Derivatives methods
49//! may be the vector of the parametric coordinates U,V,
50//! W of the extremities of a section on the surface and
51//! the curve.
52class Blend_RstRstFunction : public Blend_AppFunction
53{
54public:
55
56 DEFINE_STANDARD_ALLOC
57
58
59 //! Returns 2 (default value). Can be redefined.
60 Standard_EXPORT virtual Standard_Integer NbVariables() const = 0;
61
62 //! returns the number of equations of the function.
63 Standard_EXPORT virtual Standard_Integer NbEquations() const = 0;
64
65 //! computes the values <F> of the Functions for the
66 //! variable <X>.
67 //! Returns True if the computation was done successfully,
68 //! False otherwise.
69 Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, math_Vector& F) = 0;
70
71 //! returns the values <D> of the derivatives for the
72 //! variable <X>.
73 //! Returns True if the computation was done successfully,
74 //! False otherwise.
75 Standard_EXPORT virtual Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) = 0;
76
77 //! returns the values <F> of the functions and the derivatives
78 //! <D> for the variable <X>.
79 //! Returns True if the computation was done successfully,
80 //! False otherwise.
81 Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) = 0;
82
83 //! Sets the value of the parameter along the guide line.
84 //! This determines the plane in which the solution has
85 //! to be found.
86 Standard_EXPORT virtual void Set (const Standard_Real Param) = 0;
87
88 //! Sets the bounds of the parametric interval on
89 //! the guide line.
90 //! This determines the derivatives in these values if the
91 //! function is not Cn.
92 Standard_EXPORT virtual void Set (const Standard_Real First, const Standard_Real Last) = 0;
93
94 //! Returns in the vector Tolerance the parametric tolerance
95 //! for each variable;
96 //! Tol is the tolerance used in 3d space.
97 Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const = 0;
98
99 //! Returns in the vector InfBound the lowest values allowed
100 //! for each variables.
101 //! Returns in the vector SupBound the greatest values allowed
102 //! for each of the 3 variables.
103 Standard_EXPORT virtual void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const = 0;
104
105 //! Returns Standard_True if Sol is a zero of the function.
106 //! Tol is the tolerance used in 3d space.
107 //! The computation is made at the current value of
108 //! the parameter on the guide line.
109 Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) = 0;
110
111 //! Returns the minimal Distance beetween two
112 //! extremitys of calculed sections.
113 Standard_EXPORT Standard_Real GetMinimalDistance() const;
114
115 //! Returns the point on the first support.
116 Standard_EXPORT const gp_Pnt& Pnt1() const;
117
118 //! Returns the point on the seconde support.
119 Standard_EXPORT const gp_Pnt& Pnt2() const;
120
121 //! Returns the point on the surface.
122 Standard_EXPORT virtual const gp_Pnt& PointOnRst1() const = 0;
123
124 //! Returns the point on the curve.
125 Standard_EXPORT virtual const gp_Pnt& PointOnRst2() const = 0;
126
127 //! Returns U,V coordinates of the point on the surface.
128 Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst1() const = 0;
129
130 //! Returns U,V coordinates of the point on the curve on
131 //! surface.
132 Standard_EXPORT virtual const gp_Pnt2d& Pnt2dOnRst2() const = 0;
133
134 //! Returns parameter of the point on the curve.
135 Standard_EXPORT virtual Standard_Real ParameterOnRst1() const = 0;
136
137 //! Returns parameter of the point on the curve.
138 Standard_EXPORT virtual Standard_Real ParameterOnRst2() const = 0;
139
140 //! Returns True when it is not possible to compute
141 //! the tangent vectors at PointOnS and/or PointOnRst.
142 Standard_EXPORT virtual Standard_Boolean IsTangencyPoint() const = 0;
143
144 //! Returns the tangent vector at PointOnS, in 3d space.
145 Standard_EXPORT virtual const gp_Vec& TangentOnRst1() const = 0;
146
147 //! Returns the tangent vector at PointOnS, in the
148 //! parametric space of the first surface.
149 Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst1() const = 0;
150
151 //! Returns the tangent vector at PointOnC, in 3d space.
152 Standard_EXPORT virtual const gp_Vec& TangentOnRst2() const = 0;
153
154 //! Returns the tangent vector at PointOnRst, in the
155 //! parametric space of the second surface.
156 Standard_EXPORT virtual const gp_Vec2d& Tangent2dOnRst2() const = 0;
157
158 //! Enables to implement a criterion of decrochage
159 //! specific to the function.
160 //! Warning: Can be called without previous call of issolution
161 //! but the values calculated can be senseless.
162 Standard_EXPORT virtual Blend_DecrochStatus Decroch (const math_Vector& Sol, gp_Vec& NRst1, gp_Vec& TgRst1, gp_Vec& NRst2, gp_Vec& TgRst2) const = 0;
163
164 //! Returns if the section is rationnal
165 Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
166
167 //! Returns the length of the maximum section
168 Standard_EXPORT virtual Standard_Real GetSectionSize() const = 0;
169
170 //! Compute the minimal value of weight for each poles
171 //! of all sections.
172 Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const = 0;
173
174 //! Returns the number of intervals for continuity
175 //! <S>. May be one if Continuity(me) >= <S>
176 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
177
178 //! Stores in <T> the parameters bounding the intervals
179 //! of continuity <S>.
180 //!
181 //! The array must provide enough room to accomodate
182 //! for the parameters. i.e. T.Length() > NbIntervals()
183 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
184
185 Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) = 0;
186
187 //! Returns the tolerance to reach in approximation
188 //! to respecte
189 //! BoundTol error at the Boundary
190 //! AngleTol tangent error at the Boundary
191 //! SurfTol error inside the surface.
192 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;
193
194 Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) = 0;
195
196 Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) = 0;
197
198 Standard_EXPORT virtual void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
199
200 //! Used for the first and last section
201 //! The method returns Standard_True if the derivatives
202 //! are computed, otherwise it returns Standard_False.
203 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;
204
205 //! Used for the first and last section
206 //! The method returns Standard_True if the derivatives
207 //! are computed, otherwise it returns Standard_False.
208 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;
209
210
211
212
213protected:
214
215
216
217
218
219private:
220
221
222
223
224
225};
226
227
228
229
230
231
232
233#endif // _Blend_RstRstFunction_HeaderFile