1 // Created on: 1997-02-06
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepBlend_RstRstConstRad_HeaderFile
18 #define _BRepBlend_RstRstConstRad_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Adaptor3d_CurveOnSurface.hxx>
26 #include <gp_Pnt2d.hxx>
27 #include <Standard_Real.hxx>
28 #include <Standard_Boolean.hxx>
30 #include <gp_Vec2d.hxx>
31 #include <Standard_Integer.hxx>
32 #include <BlendFunc_SectionShape.hxx>
33 #include <Convert_ParameterisationType.hxx>
34 #include <Blend_RstRstFunction.hxx>
35 #include <math_Vector.hxx>
36 #include <Blend_DecrochStatus.hxx>
37 #include <TColStd_Array1OfReal.hxx>
38 #include <GeomAbs_Shape.hxx>
39 #include <TColStd_Array1OfInteger.hxx>
40 #include <TColgp_Array1OfPnt.hxx>
41 #include <TColgp_Array1OfVec.hxx>
42 #include <TColgp_Array1OfPnt2d.hxx>
43 #include <TColgp_Array1OfVec2d.hxx>
44 class Adaptor3d_HSurface;
45 class Adaptor2d_HCurve2d;
46 class Adaptor3d_HCurve;
56 //! Copy of CSConstRad with a pcurve on surface
58 class BRepBlend_RstRstConstRad : public Blend_RstRstFunction
65 Standard_EXPORT BRepBlend_RstRstConstRad(const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor2d_HCurve2d)& Rst1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(Adaptor2d_HCurve2d)& Rst2, const Handle(Adaptor3d_HCurve)& CGuide);
68 Standard_EXPORT Standard_Integer NbVariables() const;
71 Standard_EXPORT Standard_Integer NbEquations() const;
73 //! computes the values <F> of the Functions for the
75 //! Returns True if the computation was done successfully,
77 Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
79 //! returns the values <D> of the derivatives for the
81 //! Returns True if the computation was done successfully,
83 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
85 //! returns the values <F> of the functions and the derivatives
86 //! <D> for the variable <X>.
87 //! Returns True if the computation was done successfully,
89 Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
91 Standard_EXPORT void Set (const Handle(Adaptor3d_HSurface)& SurfRef1, const Handle(Adaptor2d_HCurve2d)& RstRef1, const Handle(Adaptor3d_HSurface)& SurfRef2, const Handle(Adaptor2d_HCurve2d)& RstRef2);
93 Standard_EXPORT void Set (const Standard_Real Param);
95 //! Sets the bounds of the parametric interval on
97 //! This determines the derivatives in these values if the
98 //! function is not Cn.
99 Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last);
101 Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const;
103 Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const;
105 Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol);
107 //! Returns the minimal Distance beetween two
108 //! extremitys of calculed sections.
109 Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
111 Standard_EXPORT const gp_Pnt& PointOnRst1() const;
113 Standard_EXPORT const gp_Pnt& PointOnRst2() const;
115 //! Returns U,V coordinates of the point on the surface.
116 Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst1() const;
118 //! Returns U,V coordinates of the point on the curve on
120 Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst2() const;
122 //! Returns parameter of the point on the curve.
123 Standard_EXPORT Standard_Real ParameterOnRst1() const;
125 //! Returns parameter of the point on the curve.
126 Standard_EXPORT Standard_Real ParameterOnRst2() const;
128 Standard_EXPORT Standard_Boolean IsTangencyPoint() const;
130 Standard_EXPORT const gp_Vec& TangentOnRst1() const;
132 Standard_EXPORT const gp_Vec2d& Tangent2dOnRst1() const;
134 Standard_EXPORT const gp_Vec& TangentOnRst2() const;
136 Standard_EXPORT const gp_Vec2d& Tangent2dOnRst2() const;
138 //! Permet d ' implementer un critere de decrochage
139 //! specifique a la fonction.
140 Standard_EXPORT Blend_DecrochStatus Decroch (const math_Vector& Sol, gp_Vec& NRst1, gp_Vec& TgRst1, gp_Vec& NRst2, gp_Vec& TgRst2) const;
142 Standard_EXPORT void Set (const Standard_Real Radius, const Standard_Integer Choix);
144 //! Sets the type of section generation for the
146 Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection);
148 //! Give the center of circle define by PtRst1, PtRst2 and
150 Standard_EXPORT Standard_Boolean CenterCircleRst1Rst2 (const gp_Pnt& PtRst1, const gp_Pnt& PtRst2, const gp_Vec& np, gp_Pnt& Center, gp_Vec& VdMed) const;
152 Standard_EXPORT void Section (const Standard_Real Param, const Standard_Real U, const Standard_Real V, Standard_Real& Pdeb, Standard_Real& Pfin, gp_Circ& C);
154 //! Returns if the section is rationnal
155 Standard_EXPORT Standard_Boolean IsRational() const;
157 //! Returns the length of the maximum section
158 Standard_EXPORT Standard_Real GetSectionSize() const;
160 //! Compute the minimal value of weight for each poles
162 Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const;
164 //! Returns the number of intervals for continuity
165 //! <S>. May be one if Continuity(me) >= <S>
166 Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
168 //! Stores in <T> the parameters bounding the intervals
169 //! of continuity <S>.
170 //! The array must provide enough room to accomodate
171 //! for the parameters. i.e. T.Length() > NbIntervals()
172 Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
174 Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d);
176 //! Returns the tolerance to reach in approximation
178 //! BoundTol error at the Boundary
179 //! AngleTol tangent error at the Boundary
180 //! SurfTol error inside the surface.
181 Standard_EXPORT void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const;
183 Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots);
185 Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults);
187 //! Used for the first and last section
188 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);
190 Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths);
192 //! Used for the first and last section
193 //! The method returns Standard_True if the derivatives
194 //! are computed, otherwise it returns Standard_False.
195 Standard_EXPORT 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);
197 Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const;
212 Handle(Adaptor3d_HSurface) surf1;
213 Handle(Adaptor3d_HSurface) surf2;
214 Handle(Adaptor2d_HCurve2d) rst1;
215 Handle(Adaptor2d_HCurve2d) rst2;
216 Adaptor3d_CurveOnSurface cons1;
217 Adaptor3d_CurveOnSurface cons2;
218 Handle(Adaptor3d_HCurve) guide;
219 Handle(Adaptor3d_HCurve) tguide;
224 Standard_Real prmrst1;
225 Standard_Real prmrst2;
226 Standard_Boolean istangent;
232 Standard_Integer choix;
237 Standard_Real normtg;
239 Handle(Adaptor3d_HSurface) surfref1;
240 Handle(Adaptor2d_HCurve2d) rstref1;
241 Handle(Adaptor3d_HSurface) surfref2;
242 Handle(Adaptor2d_HCurve2d) rstref2;
243 Standard_Real maxang;
244 Standard_Real minang;
245 Standard_Real distmin;
246 BlendFunc_SectionShape mySShape;
247 Convert_ParameterisationType myTConv;
258 #endif // _BRepBlend_RstRstConstRad_HeaderFile