Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-06-02
0002 // Created by: Philippe NOUAILLE
0003 // Copyright (c) 1998-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_ChAsym_HeaderFile
0018 #define _BlendFunc_ChAsym_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Vec.hxx>
0022 #include <gp_Pnt.hxx>
0023 #include <math_Matrix.hxx>
0024 #include <gp_Vec2d.hxx>
0025 #include <Blend_Function.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 #include <TColgp_Array1OfPnt.hxx>
0030 #include <TColgp_Array1OfPnt2d.hxx>
0031 #include <TColgp_Array1OfVec.hxx>
0032 #include <TColgp_Array1OfVec2d.hxx>
0033 
0034 class gp_Lin;
0035 class Blend_Point;
0036 
0037 class BlendFunc_ChAsym  : public Blend_Function
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042 
0043   
0044   Standard_EXPORT BlendFunc_ChAsym(const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_Surface)& S2, const Handle(Adaptor3d_Curve)& C);
0045   
0046   //! returns the number of equations of the function.
0047   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
0048   
0049   Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE;
0050   
0051   Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0052   
0053   Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE;
0054   
0055   Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE;
0056   
0057   Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE;
0058   
0059   //! Returns   the    minimal  Distance  between   two
0060   //! extremities of calculated sections.
0061   Standard_EXPORT Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
0062   
0063   //! computes the values <F> of the derivatives for the
0064   //! variable <X> between DegF and DegL.
0065   //! Returns True if the computation was done successfully,
0066   //! False otherwise.
0067   Standard_EXPORT Standard_Boolean ComputeValues (const math_Vector& X, const Standard_Integer DegF, const Standard_Integer DegL);
0068   
0069   //! computes the values <F> of the Functions for the
0070   //! variable <X>.
0071   //! Returns True if the computation was done successfully,
0072   //! False otherwise.
0073   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
0074   
0075   //! returns the values <D> of the derivatives for the
0076   //! variable <X>.
0077   //! Returns True if the computation was done successfully,
0078   //! False otherwise.
0079   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE;
0080   
0081   //! returns the values <F> of the functions and the derivatives
0082   //! <D> for the variable <X>.
0083   //! Returns True if the computation was done successfully,
0084   //! False otherwise.
0085   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE;
0086   
0087   Standard_EXPORT const gp_Pnt& PointOnS1() const Standard_OVERRIDE;
0088   
0089   Standard_EXPORT const gp_Pnt& PointOnS2() const Standard_OVERRIDE;
0090   
0091   Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
0092   
0093   Standard_EXPORT const gp_Vec& TangentOnS1() const Standard_OVERRIDE;
0094   
0095   Standard_EXPORT const gp_Vec2d& Tangent2dOnS1() const Standard_OVERRIDE;
0096   
0097   Standard_EXPORT const gp_Vec& TangentOnS2() const Standard_OVERRIDE;
0098   
0099   Standard_EXPORT const gp_Vec2d& Tangent2dOnS2() const Standard_OVERRIDE;
0100   
0101   Standard_EXPORT virtual Standard_Boolean TwistOnS1() const Standard_OVERRIDE;
0102   
0103   Standard_EXPORT virtual Standard_Boolean TwistOnS2() const Standard_OVERRIDE;
0104   
0105   //! Returns the tangent vector at the section,
0106   //! at the beginning and the end of the section, and
0107   //! returns the normal (of the surfaces) at
0108   //! these points.
0109   Standard_EXPORT void Tangent (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, gp_Vec& TgFirst, gp_Vec& TgLast, gp_Vec& NormFirst, gp_Vec& NormLast) const Standard_OVERRIDE;
0110   
0111   //! Utile pour une visu rapide et approximative de la surface.
0112   Standard_EXPORT void Section (const Standard_Real Param, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, Standard_Real& Pdeb, Standard_Real& Pfin, gp_Lin& C);
0113   
0114   //! Returns  if the section is rationnal
0115   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0116   
0117   //! Returns the length of the maximum section
0118   Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
0119   
0120   //! Compute the minimal value of weight for each poles
0121   //! of all sections.
0122   Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0123   
0124   //! Returns  the number  of  intervals for  continuity
0125   //! <S>. May be one if Continuity(me) >= <S>
0126   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0127   
0128   //! Stores in <T> the  parameters bounding the intervals
0129   //! of continuity <S>.
0130   //!
0131   //! The array must provide  enough room to  accommodate
0132   //! for the parameters. i.e. T.Length() > NbIntervals()
0133   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0134   
0135   Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE;
0136   
0137   //! Returns the tolerance to reach in approximation
0138   //! to respecte
0139   //! BoundTol error at the Boundary
0140   //! AngleTol tangent error at the Boundary
0141   //! SurfTol error inside the surface.
0142   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;
0143   
0144   Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
0145   
0146   Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
0147   
0148   Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0149   
0150   //! Used for the first and last section
0151   Standard_EXPORT virtual 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;
0152   
0153   //! Used for the first and last section
0154   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;
0155   
0156   Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0157   
0158   //! Sets the distances and the angle.
0159   Standard_EXPORT void Set (const Standard_Real Dist1, const Standard_Real Angle, const Standard_Integer Choix);
0160 
0161 
0162 
0163 
0164 protected:
0165 
0166 
0167 
0168 
0169 
0170 private:
0171 
0172 
0173 
0174   Handle(Adaptor3d_Surface) surf1;
0175   Handle(Adaptor3d_Surface) surf2;
0176   Handle(Adaptor3d_Curve) curv;
0177   Handle(Adaptor3d_Curve) tcurv;
0178   Standard_Real param;
0179   Standard_Real dist1;
0180   Standard_Real angle;
0181   Standard_Real tgang;
0182   gp_Vec nplan;
0183   gp_Pnt pt1;
0184   gp_Vec tsurf1;
0185   gp_Pnt pt2;
0186   math_Vector FX;
0187   math_Matrix DX;
0188   Standard_Boolean istangent;
0189   gp_Vec tg1;
0190   gp_Vec2d tg12d;
0191   gp_Vec tg2;
0192   gp_Vec2d tg22d;
0193   Standard_Integer choix;
0194   Standard_Real distmin;
0195 
0196 
0197 };
0198 
0199 
0200 
0201 
0202 
0203 
0204 
0205 #endif // _BlendFunc_ChAsym_HeaderFile