42cf5bc1 |
1 | // Created on: 1993-12-02 |
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 _BlendFunc_CSConstRad_HeaderFile |
18 | #define _BlendFunc_CSConstRad_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> |
42 | class Adaptor3d_HSurface; |
43 | class Adaptor3d_HCurve; |
44 | class math_Matrix; |
45 | class gp_Pnt; |
46 | class gp_Pnt2d; |
47 | class gp_Vec; |
48 | class gp_Vec2d; |
49 | class gp_Circ; |
50 | class Blend_Point; |
51 | |
52 | |
53 | |
54 | class BlendFunc_CSConstRad : public Blend_CSFunction |
55 | { |
56 | public: |
57 | |
58 | DEFINE_STANDARD_ALLOC |
59 | |
60 | |
61 | Standard_EXPORT BlendFunc_CSConstRad(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HCurve)& CGuide); |
62 | |
63 | //! returns the number of equations of the function (3). |
79104795 |
64 | Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE; |
42cf5bc1 |
65 | |
66 | //! computes the values <F> of the Functions for the |
67 | //! variable <X>. |
68 | //! Returns True if the computation was done successfully, |
69 | //! False otherwise. |
79104795 |
70 | Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE; |
42cf5bc1 |
71 | |
72 | //! returns the values <D> of the derivatives for the |
73 | //! variable <X>. |
74 | //! Returns True if the computation was done successfully, |
75 | //! False otherwise. |
79104795 |
76 | Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE; |
42cf5bc1 |
77 | |
78 | //! returns the values <F> of the functions and the derivatives |
79 | //! <D> for the variable <X>. |
80 | //! Returns True if the computation was done successfully, |
81 | //! False otherwise. |
79104795 |
82 | Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE; |
42cf5bc1 |
83 | |
79104795 |
84 | Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE; |
42cf5bc1 |
85 | |
79104795 |
86 | Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE; |
42cf5bc1 |
87 | |
79104795 |
88 | Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE; |
42cf5bc1 |
89 | |
79104795 |
90 | Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE; |
42cf5bc1 |
91 | |
79104795 |
92 | Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE; |
42cf5bc1 |
93 | |
79104795 |
94 | Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE; |
42cf5bc1 |
95 | |
79104795 |
96 | Standard_EXPORT const gp_Pnt& PointOnC() const Standard_OVERRIDE; |
42cf5bc1 |
97 | |
98 | //! Returns U,V coordinates of the point on the surface. |
79104795 |
99 | Standard_EXPORT const gp_Pnt2d& Pnt2d() const Standard_OVERRIDE; |
42cf5bc1 |
100 | |
101 | //! Returns parameter of the point on the curve. |
79104795 |
102 | Standard_EXPORT Standard_Real ParameterOnC() const Standard_OVERRIDE; |
42cf5bc1 |
103 | |
79104795 |
104 | Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE; |
42cf5bc1 |
105 | |
79104795 |
106 | Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE; |
42cf5bc1 |
107 | |
79104795 |
108 | Standard_EXPORT const gp_Vec2d& Tangent2d() const Standard_OVERRIDE; |
42cf5bc1 |
109 | |
79104795 |
110 | Standard_EXPORT const gp_Vec& TangentOnC() const Standard_OVERRIDE; |
42cf5bc1 |
111 | |
112 | //! Returns the tangent vector at the section, |
113 | //! at the beginning and the end of the section, and |
114 | //! returns the normal (of the surface) at |
115 | //! these points. |
79104795 |
116 | Standard_EXPORT void Tangent (const Standard_Real U, const Standard_Real V, gp_Vec& TgS, gp_Vec& NormS) const Standard_OVERRIDE; |
42cf5bc1 |
117 | |
118 | Standard_EXPORT void Set (const Standard_Real Radius, const Standard_Integer Choix); |
119 | |
120 | //! Sets the type of section generation for the |
121 | //! approximations. |
122 | Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection); |
123 | |
124 | 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); |
125 | |
126 | //! Used for the first and last section |
127 | //! The method returns Standard_True if the derivatives |
128 | //! are computed, otherwise it returns Standard_False. |
129 | 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; |
130 | |
131 | 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); |
132 | |
133 | //! Returns if the section is rationnal |
79104795 |
134 | Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE; |
42cf5bc1 |
135 | |
136 | //! Returns the length of the maximum section |
79104795 |
137 | Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE; |
42cf5bc1 |
138 | |
139 | //! Compute the minimal value of weight for each poles |
140 | //! of all sections. |
79104795 |
141 | Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE; |
42cf5bc1 |
142 | |
143 | //! Returns the number of intervals for continuity |
144 | //! <S>. May be one if Continuity(me) >= <S> |
79104795 |
145 | Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
42cf5bc1 |
146 | |
147 | //! Stores in <T> the parameters bounding the intervals |
148 | //! of continuity <S>. |
149 | //! The array must provide enough room to accomodate |
150 | //! for the parameters. i.e. T.Length() > NbIntervals() |
151 | //! raises |
152 | //! OutOfRange from Standard |
79104795 |
153 | Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
42cf5bc1 |
154 | |
79104795 |
155 | Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE; |
42cf5bc1 |
156 | |
157 | //! Returns the tolerance to reach in approximation |
158 | //! to respecte |
159 | //! BoundTol error at the Boundary |
160 | //! AngleTol tangent error at the Boundary |
161 | //! SurfTol error inside the surface. |
79104795 |
162 | 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 |
163 | |
79104795 |
164 | Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE; |
42cf5bc1 |
165 | |
79104795 |
166 | Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE; |
42cf5bc1 |
167 | |
168 | //! Used for the first and last section |
79104795 |
169 | 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 |
170 | |
79104795 |
171 | Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE; |
42cf5bc1 |
172 | |
79104795 |
173 | Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE; |
42cf5bc1 |
174 | |
175 | |
176 | |
177 | |
178 | protected: |
179 | |
180 | |
181 | |
182 | |
183 | |
184 | private: |
185 | |
186 | |
187 | |
188 | Handle(Adaptor3d_HSurface) surf; |
189 | Handle(Adaptor3d_HCurve) curv; |
190 | Handle(Adaptor3d_HCurve) guide; |
191 | gp_Pnt pts; |
192 | gp_Pnt ptc; |
193 | gp_Pnt2d pt2d; |
194 | Standard_Real prmc; |
195 | Standard_Boolean istangent; |
196 | gp_Vec tgs; |
197 | gp_Vec2d tg2d; |
198 | gp_Vec tgc; |
199 | Standard_Real ray; |
200 | Standard_Integer choix; |
201 | gp_Pnt ptgui; |
202 | gp_Vec d1gui; |
203 | gp_Vec d2gui; |
204 | gp_Vec nplan; |
205 | Standard_Real normtg; |
206 | Standard_Real theD; |
207 | Standard_Real maxang; |
208 | Standard_Real minang; |
209 | BlendFunc_SectionShape mySShape; |
210 | Convert_ParameterisationType myTConv; |
211 | |
212 | |
213 | }; |
214 | |
215 | |
216 | |
217 | |
218 | |
219 | |
220 | |
221 | #endif // _BlendFunc_CSConstRad_HeaderFile |