0031939: Coding - correction of spelling errors in comments
[occt.git] / src / BlendFunc / BlendFunc_CSCircular.hxx
CommitLineData
42cf5bc1 1// Created on: 1995-01-04
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1995-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 _BlendFunc_CSCircular_HeaderFile
18#define _BlendFunc_CSCircular_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <gp_Pnt.hxx>
25#include <gp_Pnt2d.hxx>
26#include <Standard_Real.hxx>
27#include <Standard_Boolean.hxx>
28#include <gp_Vec.hxx>
29#include <gp_Vec2d.hxx>
30#include <Standard_Integer.hxx>
31#include <BlendFunc_SectionShape.hxx>
32#include <Convert_ParameterisationType.hxx>
33#include <Blend_CSFunction.hxx>
34#include <math_Vector.hxx>
35#include <TColgp_Array1OfPnt.hxx>
36#include <TColgp_Array1OfVec.hxx>
37#include <TColgp_Array1OfPnt2d.hxx>
38#include <TColgp_Array1OfVec2d.hxx>
39#include <TColStd_Array1OfReal.hxx>
40#include <GeomAbs_Shape.hxx>
41#include <TColStd_Array1OfInteger.hxx>
42class Adaptor3d_HSurface;
43class Adaptor3d_HCurve;
44class Law_Function;
45class math_Matrix;
46class gp_Pnt;
47class gp_Pnt2d;
48class gp_Vec;
49class gp_Vec2d;
50class gp_Circ;
51class Blend_Point;
52
53
54
55class BlendFunc_CSCircular : public Blend_CSFunction
56{
57public:
58
59 DEFINE_STANDARD_ALLOC
60
61
62 //! Creates a function for a circular blending between
63 //! a curve <C> and a surface <S>. The direction of
64 //! the planes are given by <CGuide>. The position of
65 //! the plane is determined on the curve <C>. <L>
66 //! defines the change of parameter between <C> and
67 //! <CGuide>. So, the planes are defined as described
68 //! below :
69 //! t is the current parameter on the guide line.
70 //! Pguide = C(L(t)); Nguide = CGuide'(t)/||CGuide'(t)||
71 Standard_EXPORT BlendFunc_CSCircular(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HCurve)& CGuide, const Handle(Law_Function)& L);
72
73 Standard_EXPORT virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
74
75 //! returns the number of equations of the function (3).
79104795 76 Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
42cf5bc1 77
78 //! computes the values <F> of the Functions for the
79 //! variable <X>.
80 //! Returns True if the computation was done successfully,
81 //! False otherwise.
79104795 82 Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
42cf5bc1 83
84 //! returns the values <D> of the derivatives for the
85 //! variable <X>.
86 //! Returns True if the computation was done successfully,
87 //! False otherwise.
79104795 88 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE;
42cf5bc1 89
90 //! returns the values <F> of the functions and the derivatives
91 //! <D> for the variable <X>.
92 //! Returns True if the computation was done successfully,
93 //! False otherwise.
79104795 94 Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE;
42cf5bc1 95
79104795 96 Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE;
42cf5bc1 97
79104795 98 Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
42cf5bc1 99
79104795 100 Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE;
42cf5bc1 101
79104795 102 Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE;
42cf5bc1 103
79104795 104 Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE;
42cf5bc1 105
79104795 106 Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE;
42cf5bc1 107
79104795 108 Standard_EXPORT const gp_Pnt& PointOnC() const Standard_OVERRIDE;
42cf5bc1 109
110 //! Returns U,V coordinates of the point on the surface.
79104795 111 Standard_EXPORT const gp_Pnt2d& Pnt2d() const Standard_OVERRIDE;
42cf5bc1 112
113 //! Returns parameter of the point on the curve.
79104795 114 Standard_EXPORT Standard_Real ParameterOnC() const Standard_OVERRIDE;
42cf5bc1 115
79104795 116 Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
42cf5bc1 117
79104795 118 Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE;
42cf5bc1 119
79104795 120 Standard_EXPORT const gp_Vec2d& Tangent2d() const Standard_OVERRIDE;
42cf5bc1 121
79104795 122 Standard_EXPORT const gp_Vec& TangentOnC() const Standard_OVERRIDE;
42cf5bc1 123
124 //! Returns the tangent vector at the section,
125 //! at the beginning and the end of the section, and
126 //! returns the normal (of the surface) at
127 //! these points.
79104795 128 Standard_EXPORT void Tangent (const Standard_Real U, const Standard_Real V, gp_Vec& TgS, gp_Vec& NormS) const Standard_OVERRIDE;
42cf5bc1 129
130 Standard_EXPORT void Set (const Standard_Real Radius, const Standard_Integer Choix);
131
132 //! Sets the type of section generation for the
133 //! approximations.
134 Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection);
135
136 Standard_EXPORT void Section (const Standard_Real Param, const Standard_Real U, const Standard_Real V, const Standard_Real W, Standard_Real& Pdeb, Standard_Real& Pfin, gp_Circ& C);
137
138 //! Used for the first and last section
139 //! The method returns Standard_True if the derivatives
140 //! are computed, otherwise it returns Standard_False.
141 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) Standard_OVERRIDE;
142
143 Standard_EXPORT Standard_Boolean GetSection (const Standard_Real Param, const Standard_Real U, const Standard_Real V, const Standard_Real W, TColgp_Array1OfPnt& tabP, TColgp_Array1OfVec& tabV);
144
145 //! Returns if the section is rationnal
79104795 146 Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
42cf5bc1 147
148 //! Returns the length of the maximum section
79104795 149 Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
42cf5bc1 150
151 //! Compute the minimal value of weight for each poles
152 //! of all sections.
79104795 153 Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
42cf5bc1 154
155 //! Returns the number of intervals for continuity
156 //! <S>. May be one if Continuity(me) >= <S>
79104795 157 Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
42cf5bc1 158
159 //! Stores in <T> the parameters bounding the intervals
160 //! of continuity <S>.
161 //!
21c7c457 162 //! The array must provide enough room to accommodate
42cf5bc1 163 //! for the parameters. i.e. T.Length() > NbIntervals()
164 //! raises
165 //! OutOfRange from Standard
79104795 166 Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
42cf5bc1 167
79104795 168 Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE;
42cf5bc1 169
170 //! Returns the tolerance to reach in approximation
171 //! to respecte
172 //! BoundTol error at the Boundary
173 //! AngleTol tangent error at the Boundary
174 //! SurfTol error inside the surface.
79104795 175 Standard_EXPORT void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const Standard_OVERRIDE;
42cf5bc1 176
79104795 177 Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
42cf5bc1 178
79104795 179 Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
42cf5bc1 180
181 //! Used for the first and last section
79104795 182 Standard_EXPORT 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) Standard_OVERRIDE;
42cf5bc1 183
79104795 184 Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
42cf5bc1 185
79104795 186 Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
42cf5bc1 187
188
189
190
191protected:
192
193
194
195
196
197private:
198
199
200
201 Handle(Adaptor3d_HSurface) surf;
202 Handle(Adaptor3d_HCurve) curv;
203 Handle(Adaptor3d_HCurve) guide;
204 Handle(Law_Function) law;
205 gp_Pnt pts;
206 gp_Pnt ptc;
207 gp_Pnt2d pt2d;
208 Standard_Real prmc;
209 Standard_Real dprmc;
210 Standard_Boolean istangent;
211 gp_Vec tgs;
212 gp_Vec2d tg2d;
213 gp_Vec tgc;
214 Standard_Real ray;
215 Standard_Integer choix;
216 gp_Vec d1gui;
217 gp_Vec d2gui;
218 gp_Vec nplan;
219 Standard_Real normtg;
220 Standard_Real maxang;
221 Standard_Real minang;
222 BlendFunc_SectionShape mySShape;
223 Convert_ParameterisationType myTConv;
224
225
226};
227
228
229
230
231
232
233
234#endif // _BlendFunc_CSCircular_HeaderFile