Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:08

0001 // Created on: 1997-02-06
0002 // Created by: Laurent BOURESCHE
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepBlend_SurfRstConstRad_HeaderFile
0018 #define _BRepBlend_SurfRstConstRad_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <Adaptor3d_CurveOnSurface.hxx>
0022 #include <gp_Pnt.hxx>
0023 #include <gp_Pnt2d.hxx>
0024 #include <gp_Vec.hxx>
0025 #include <gp_Vec2d.hxx>
0026 #include <BlendFunc_SectionShape.hxx>
0027 #include <Convert_ParameterisationType.hxx>
0028 #include <Blend_SurfRstFunction.hxx>
0029 #include <math_Vector.hxx>
0030 #include <TColStd_Array1OfReal.hxx>
0031 #include <GeomAbs_Shape.hxx>
0032 #include <TColStd_Array1OfInteger.hxx>
0033 #include <TColgp_Array1OfPnt.hxx>
0034 #include <TColgp_Array1OfVec.hxx>
0035 #include <TColgp_Array1OfPnt2d.hxx>
0036 #include <TColgp_Array1OfVec2d.hxx>
0037 
0038 class math_Matrix;
0039 class gp_Circ;
0040 class Blend_Point;
0041 
0042 
0043 //! Copy of CSConstRad with pcurve on surface
0044 //! as support.
0045 class BRepBlend_SurfRstConstRad  : public Blend_SurfRstFunction
0046 {
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   Standard_EXPORT BRepBlend_SurfRstConstRad(const Handle(Adaptor3d_Surface)& Surf, const Handle(Adaptor3d_Surface)& SurfRst, const Handle(Adaptor2d_Curve2d)& Rst, const Handle(Adaptor3d_Curve)& CGuide);
0053   
0054   //! Returns 3.
0055   Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
0056   
0057   //! Returns 3.
0058   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
0059   
0060   //! computes the values <F> of the Functions for the
0061   //! variable <X>.
0062   //! Returns True if the computation was done successfully,
0063   //! False otherwise.
0064   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
0065   
0066   //! returns the values <D> of the derivatives for the
0067   //! variable <X>.
0068   //! Returns True if the computation was done successfully,
0069   //! False otherwise.
0070   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE;
0071   
0072   //! returns the values <F> of the functions and the derivatives
0073   //! <D> for the variable <X>.
0074   //! Returns True if the computation was done successfully,
0075   //! False otherwise.
0076   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE;
0077   
0078   Standard_EXPORT void Set (const Handle(Adaptor3d_Surface)& SurfRef, const Handle(Adaptor2d_Curve2d)& RstRef);
0079   
0080   Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE;
0081   
0082   //! Sets the bounds of the parametric interval on
0083   //! the guide line.
0084   //! This determines the derivatives in these values if the
0085   //! function is not Cn.
0086   Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0087   
0088   Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE;
0089   
0090   Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE;
0091   
0092   Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE;
0093   
0094   //! Returns   the    minimal  Distance  between   two
0095   //! extremities of calculated sections.
0096   Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
0097   
0098   Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE;
0099   
0100   Standard_EXPORT const gp_Pnt& PointOnRst() const Standard_OVERRIDE;
0101   
0102   //! Returns U,V coordinates of the point on the surface.
0103   Standard_EXPORT const gp_Pnt2d& Pnt2dOnS() const Standard_OVERRIDE;
0104   
0105   //! Returns  U,V coordinates of the point  on the curve on
0106   //! surface.
0107   Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst() const Standard_OVERRIDE;
0108   
0109   //! Returns parameter of the point on the curve.
0110   Standard_EXPORT Standard_Real ParameterOnRst() const Standard_OVERRIDE;
0111   
0112   Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
0113   
0114   Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE;
0115   
0116   Standard_EXPORT const gp_Vec2d& Tangent2dOnS() const Standard_OVERRIDE;
0117   
0118   Standard_EXPORT const gp_Vec& TangentOnRst() const Standard_OVERRIDE;
0119   
0120   Standard_EXPORT const gp_Vec2d& Tangent2dOnRst() const Standard_OVERRIDE;
0121   
0122   //! Enables  implementation  of  a criterion of  decrochage
0123   //! specific to  the function.
0124   //! Warning: Can  be  called  without  previous  call  of  issolution
0125   //! but the values  calculated can  be  senseless.
0126   Standard_EXPORT Standard_Boolean Decroch (const math_Vector& Sol, gp_Vec& NS, gp_Vec& TgS) const Standard_OVERRIDE;
0127   
0128   Standard_EXPORT void Set (const Standard_Real Radius, const Standard_Integer Choix);
0129   
0130   //! Sets  the  type  of   section generation   for the
0131   //! approximations.
0132   Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection);
0133   
0134   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);
0135   
0136   //! Returns  if the section is rationnal
0137   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0138   
0139   //! Returns the length of the maximum section
0140   Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
0141   
0142   //! Compute the minimal value of weight for each poles
0143   //! of all sections.
0144   Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0145   
0146   //! Returns  the number  of  intervals for  continuity
0147   //! <S>. May be one if Continuity(me) >= <S>
0148   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0149   
0150   //! Stores in <T> the  parameters bounding the intervals
0151   //! of continuity <S>.
0152   //! The array must provide  enough room to  accommodate
0153   //! for the parameters. i.e. T.Length() > NbIntervals()
0154   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0155   
0156   Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE;
0157   
0158   //! Returns the tolerance to reach in approximation
0159   //! to respecte
0160   //! BoundTol error at the Boundary
0161   //! AngleTol tangent error at the Boundary
0162   //! SurfTol error inside the surface.
0163   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;
0164   
0165   Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
0166   
0167   Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
0168   
0169   //! Used for the first and last section
0170   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;
0171   
0172   //! Used for the first and last section
0173   //! The method returns Standard_True if the derivatives
0174   //! are computed, otherwise it returns Standard_False.
0175   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) Standard_OVERRIDE;
0176   
0177   Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0178   
0179   Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0180 
0181 
0182 
0183 
0184 protected:
0185 
0186 
0187 
0188 
0189 
0190 private:
0191 
0192 
0193 
0194   Handle(Adaptor3d_Surface) surf;
0195   Handle(Adaptor3d_Surface) surfrst;
0196   Handle(Adaptor2d_Curve2d) rst;
0197   Adaptor3d_CurveOnSurface cons;
0198   Handle(Adaptor3d_Curve) guide;
0199   Handle(Adaptor3d_Curve) tguide;
0200   gp_Pnt pts;
0201   gp_Pnt ptrst;
0202   gp_Pnt2d pt2ds;
0203   gp_Pnt2d pt2drst;
0204   Standard_Real prmrst;
0205   Standard_Boolean istangent;
0206   gp_Vec tgs;
0207   gp_Vec2d tg2ds;
0208   gp_Vec tgrst;
0209   gp_Vec2d tg2drst;
0210   Standard_Real ray;
0211   Standard_Integer choix;
0212   gp_Pnt ptgui;
0213   gp_Vec d1gui;
0214   gp_Vec d2gui;
0215   gp_Vec nplan;
0216   Standard_Real normtg;
0217   Standard_Real theD;
0218   Handle(Adaptor3d_Surface) surfref;
0219   Handle(Adaptor2d_Curve2d) rstref;
0220   Standard_Real maxang;
0221   Standard_Real minang;
0222   Standard_Real distmin;
0223   BlendFunc_SectionShape mySShape;
0224   Convert_ParameterisationType myTConv;
0225 
0226 
0227 };
0228 
0229 
0230 
0231 
0232 
0233 
0234 
0235 #endif // _BRepBlend_SurfRstConstRad_HeaderFile