Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-01-04
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-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 _BlendFunc_CSCircular_HeaderFile
0018 #define _BlendFunc_CSCircular_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Pnt.hxx>
0022 #include <gp_Pnt2d.hxx>
0023 #include <gp_Vec.hxx>
0024 #include <gp_Vec2d.hxx>
0025 #include <BlendFunc_SectionShape.hxx>
0026 #include <Convert_ParameterisationType.hxx>
0027 #include <Blend_CSFunction.hxx>
0028 #include <math_Vector.hxx>
0029 #include <TColgp_Array1OfPnt.hxx>
0030 #include <TColgp_Array1OfVec.hxx>
0031 #include <TColgp_Array1OfPnt2d.hxx>
0032 #include <TColgp_Array1OfVec2d.hxx>
0033 #include <TColStd_Array1OfReal.hxx>
0034 #include <GeomAbs_Shape.hxx>
0035 #include <TColStd_Array1OfInteger.hxx>
0036 
0037 class Law_Function;
0038 class math_Matrix;
0039 class gp_Circ;
0040 class Blend_Point;
0041 
0042 class BlendFunc_CSCircular  : public Blend_CSFunction
0043 {
0044 public:
0045 
0046   DEFINE_STANDARD_ALLOC
0047 
0048   
0049   //! Creates a function for a circular blending between
0050   //! a curve  <C> and a surface  <S>.  The direction of
0051   //! the planes are given by <CGuide>.  The position of
0052   //! the plane is  determined on  the  curve <C>.   <L>
0053   //! defines  the change of  parameter between  <C> and
0054   //! <CGuide>.  So, the planes are defined as described
0055   //! below :
0056   //! t is the current parameter on the guide line.
0057   //! Pguide = C(L(t)); Nguide = CGuide'(t)/||CGuide'(t)||
0058   Standard_EXPORT BlendFunc_CSCircular(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Curve)& CGuide, const Handle(Law_Function)& L);
0059   
0060   Standard_EXPORT virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
0061   
0062   //! returns the number of equations of the function (3).
0063   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
0064   
0065   //! computes the values <F> of the Functions for the
0066   //! variable <X>.
0067   //! Returns True if the computation was done successfully,
0068   //! False otherwise.
0069   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
0070   
0071   //! returns the values <D> of the derivatives for the
0072   //! variable <X>.
0073   //! Returns True if the computation was done successfully,
0074   //! False otherwise.
0075   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE;
0076   
0077   //! returns the values <F> of the functions and the derivatives
0078   //! <D> for the variable <X>.
0079   //! Returns True if the computation was done successfully,
0080   //! False otherwise.
0081   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE;
0082   
0083   Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE;
0084   
0085   Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0086   
0087   Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE;
0088   
0089   Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE;
0090   
0091   Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE;
0092   
0093   Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE;
0094   
0095   Standard_EXPORT const gp_Pnt& PointOnC() const Standard_OVERRIDE;
0096   
0097   //! Returns U,V coordinates of the point on the surface.
0098   Standard_EXPORT const gp_Pnt2d& Pnt2d() const Standard_OVERRIDE;
0099   
0100   //! Returns parameter of the point on the curve.
0101   Standard_EXPORT Standard_Real ParameterOnC() const Standard_OVERRIDE;
0102   
0103   Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
0104   
0105   Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE;
0106   
0107   Standard_EXPORT const gp_Vec2d& Tangent2d() const Standard_OVERRIDE;
0108   
0109   Standard_EXPORT const gp_Vec& TangentOnC() const Standard_OVERRIDE;
0110   
0111   //! Returns the tangent vector at the section,
0112   //! at the beginning and the end of the section, and
0113   //! returns the normal (of the surface) at
0114   //! these points.
0115   Standard_EXPORT void Tangent (const Standard_Real U, const Standard_Real V, gp_Vec& TgS, gp_Vec& NormS) const Standard_OVERRIDE;
0116   
0117   Standard_EXPORT void Set (const Standard_Real Radius, const Standard_Integer Choix);
0118   
0119   //! Sets  the  type  of   section generation   for the
0120   //! approximations.
0121   Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection);
0122   
0123   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);
0124   
0125   //! Used for the first and last section
0126   //! The method returns Standard_True if the derivatives
0127   //! are computed, otherwise it returns Standard_False.
0128   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;
0129   
0130   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);
0131   
0132   //! Returns  if the section is rationnal
0133   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0134   
0135   //! Returns the length of the maximum section
0136   Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
0137   
0138   //! Compute the minimal value of weight for each poles
0139   //! of all sections.
0140   Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0141   
0142   //! Returns  the number  of  intervals for  continuity
0143   //! <S>. May be one if Continuity(me) >= <S>
0144   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0145   
0146   //! Stores in <T> the  parameters bounding the intervals
0147   //! of continuity <S>.
0148   //!
0149   //! The array must provide  enough room to  accommodate
0150   //! for the parameters. i.e. T.Length() > NbIntervals()
0151   //! raises
0152   //! OutOfRange from Standard
0153   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0154   
0155   Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE;
0156   
0157   //! Returns the tolerance to reach in approximation
0158   //! to respecte
0159   //! BoundTol error at the Boundary
0160   //! AngleTol tangent error at the Boundary
0161   //! SurfTol error inside the surface.
0162   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;
0163   
0164   Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
0165   
0166   Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
0167   
0168   //! Used for the first and last section
0169   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;
0170   
0171   Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0172   
0173   Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0174 
0175 
0176 
0177 
0178 protected:
0179 
0180 
0181 
0182 
0183 
0184 private:
0185 
0186 
0187 
0188   Handle(Adaptor3d_Surface) surf;
0189   Handle(Adaptor3d_Curve) curv;
0190   Handle(Adaptor3d_Curve) guide;
0191   Handle(Law_Function) law;
0192   gp_Pnt pts;
0193   gp_Pnt ptc;
0194   gp_Pnt2d pt2d;
0195   Standard_Real prmc;
0196   Standard_Real dprmc;
0197   Standard_Boolean istangent;
0198   gp_Vec tgs;
0199   gp_Vec2d tg2d;
0200   gp_Vec tgc;
0201   Standard_Real ray;
0202   Standard_Integer choix;
0203   gp_Vec d1gui;
0204   gp_Vec d2gui;
0205   gp_Vec nplan;
0206   Standard_Real normtg;
0207   Standard_Real maxang;
0208   Standard_Real minang;
0209   BlendFunc_SectionShape mySShape;
0210   Convert_ParameterisationType myTConv;
0211 
0212 
0213 };
0214 
0215 
0216 
0217 
0218 
0219 
0220 
0221 #endif // _BlendFunc_CSCircular_HeaderFile