Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-11-20
0002 // Created by: Philippe MANGIN
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 _GeomFill_SweepFunction_HeaderFile
0018 #define _GeomFill_SweepFunction_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Mat.hxx>
0024 #include <gp_Vec.hxx>
0025 #include <Approx_SweepFunction.hxx>
0026 #include <TColgp_Array1OfPnt.hxx>
0027 #include <TColgp_Array1OfPnt2d.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <TColgp_Array1OfVec.hxx>
0030 #include <TColgp_Array1OfVec2d.hxx>
0031 #include <Standard_Integer.hxx>
0032 #include <TColStd_Array1OfInteger.hxx>
0033 #include <GeomAbs_Shape.hxx>
0034 class GeomFill_LocationLaw;
0035 class GeomFill_SectionLaw;
0036 class gp_Pnt;
0037 
0038 
0039 class GeomFill_SweepFunction;
0040 DEFINE_STANDARD_HANDLE(GeomFill_SweepFunction, Approx_SweepFunction)
0041 
0042 //! Function to approximate by SweepApproximation from
0043 //! Approx. To build general sweep Surface.
0044 class GeomFill_SweepFunction : public Approx_SweepFunction
0045 {
0046 
0047 public:
0048 
0049 
0050   Standard_EXPORT GeomFill_SweepFunction(const Handle(GeomFill_SectionLaw)& Section, const Handle(GeomFill_LocationLaw)& Location, const Standard_Real FirstParameter, const Standard_Real FirstParameterOnS, const Standard_Real RatioParameterOnS);
0051   
0052   //! compute the section for v = param
0053   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0054 
0055   //! compute the first derivative in v direction of the
0056   //! section for v = param
0057   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0058 
0059   //! compute the second derivative  in v direction of the
0060   //! section for v = param
0061   Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, 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;
0062   
0063   //! get the number of 2d curves to approximate.
0064   Standard_EXPORT virtual Standard_Integer Nb2dCurves() const Standard_OVERRIDE;
0065   
0066   //! get the format of a section
0067   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const Standard_OVERRIDE;
0068 
0069   //! get the Knots of the section
0070   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
0071 
0072   //! get the Multplicities of the section
0073   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
0074 
0075   //! Returns if the section is rational or not
0076   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
0077 
0078   //! Returns the number of intervals for continuity
0079   //! <S>. May be one if Continuity(me) >= <S>
0080   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0081 
0082   //! Stores in <T> the parameters bounding the intervals
0083   //! of continuity <S>.
0084   //!
0085   //! The array must provide  enough room to  accommodate
0086   //! for the parameters. i.e. T.Length() > NbIntervals()
0087   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0088 
0089   //! Sets the bounds of the parametric interval on
0090   //! the function
0091   //! This determines the derivatives in these values if the
0092   //! function is not Cn.
0093   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0094 
0095   //! Returns the resolutions in the sub-space 2d <Index>
0096   //! This information is usfull to find an good tolerance in
0097   //! 2d approximation.
0098   //! Warning: Used only if Nb2dCurve > 0
0099   Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0100 
0101   //! Returns the tolerance to reach in approximation
0102   //! to respecte
0103   //! BoundTol error at the Boundary
0104   //! AngleTol tangent error at the Boundary (in radian)
0105   //! SurfTol error inside the surface.
0106   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
0107 
0108   //! Is usfull, if (me) have to  be run numerical
0109   //! algorithme to perform D0, D1 or D2
0110   Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d) Standard_OVERRIDE;
0111   
0112   //! Get    the   barycentre of   Surface.   An   very  poor
0113   //! estimation is sufficient. This information is useful
0114   //! to perform well conditioned rational approximation.
0115   //! Warning: Used only if <me> IsRational
0116   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
0117 
0118   //! Returns the   length of the maximum section. This
0119   //! information is useful to perform well conditioned rational
0120   //! approximation.
0121   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
0122   
0123   //! Compute the minimal value of weight for each poles
0124   //! of all  sections.  This information is  useful to
0125   //! perform well conditioned rational approximation.
0126   //! Warning: Used only if <me> IsRational
0127   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0128 
0129 
0130 
0131 
0132   DEFINE_STANDARD_RTTIEXT(GeomFill_SweepFunction,Approx_SweepFunction)
0133 
0134 protected:
0135 
0136 
0137 
0138 
0139 private:
0140 
0141 
0142   Handle(GeomFill_LocationLaw) myLoc;
0143   Handle(GeomFill_SectionLaw) mySec;
0144   Standard_Real myf;
0145   Standard_Real myfOnS;
0146   Standard_Real myRatio;
0147   gp_Mat M;
0148   gp_Mat DM;
0149   gp_Mat D2M;
0150   gp_Vec V;
0151   gp_Vec DV;
0152   gp_Vec D2V;
0153 
0154 
0155 };
0156 
0157 
0158 
0159 
0160 
0161 
0162 
0163 #endif // _GeomFill_SweepFunction_HeaderFile