Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-12-05
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_UniformSection_HeaderFile
0018 #define _GeomFill_UniformSection_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <GeomFill_SectionLaw.hxx>
0024 #include <TColgp_Array1OfPnt.hxx>
0025 #include <TColStd_Array1OfReal.hxx>
0026 #include <TColgp_Array1OfVec.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 #include <GeomAbs_Shape.hxx>
0030 class Geom_Curve;
0031 class Geom_BSplineCurve;
0032 class Geom_BSplineSurface;
0033 class gp_Pnt;
0034 
0035 
0036 class GeomFill_UniformSection;
0037 DEFINE_STANDARD_HANDLE(GeomFill_UniformSection, GeomFill_SectionLaw)
0038 
0039 //! Define an Constant Section Law
0040 class GeomFill_UniformSection : public GeomFill_SectionLaw
0041 {
0042 
0043 public:
0044 
0045   
0046   //! Make an constant Law with C.
0047   //! [First, Last] define law definition domain
0048   Standard_EXPORT GeomFill_UniformSection(const Handle(Geom_Curve)& C, const Standard_Real FirstParameter = 0.0, const Standard_Real LastParameter = 1.0);
0049   
0050   //! compute the section for v = param
0051   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0052   
0053   //! compute the first  derivative in v direction  of the
0054   //! section for v =  param
0055   //! Warning : It used only for C1 or C2 approximation
0056   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0057   
0058   //! compute the second derivative  in v direction of the
0059   //! section  for v = param
0060   //! Warning : It used only for C2 approximation
0061   Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
0062   
0063   //! give if possible an bspline Surface, like iso-v are the
0064   //! section.  If it is  not possible  this methode have  to
0065   //! get an Null Surface.  Is it the default implementation.
0066   Standard_EXPORT virtual Handle(Geom_BSplineSurface) BSplineSurface() const Standard_OVERRIDE;
0067   
0068   //! get the format of an  section
0069   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const Standard_OVERRIDE;
0070   
0071   //! get the Knots of the section
0072   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
0073   
0074   //! get the Multplicities of the section
0075   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
0076   
0077   //! Returns if the sections are rationnal or not
0078   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
0079   
0080   //! Returns if the sections are periodic or not
0081   Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
0082   
0083   //! Returns if the law  isperiodic or not
0084   Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
0085   
0086   //! Returns  the number  of  intervals for  continuity
0087   //! <S>.
0088   //! May be one if Continuity(me) >= <S>
0089   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0090   
0091   //! Stores in <T> the  parameters bounding the intervals
0092   //! of continuity <S>.
0093   //!
0094   //! The array must provide  enough room to  accommodate
0095   //! for the parameters. i.e. T.Length() > NbIntervals()
0096   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0097   
0098   //! Sets the bounds of the parametric interval on
0099   //! the function
0100   //! This determines the derivatives in these values if the
0101   //! function is not Cn.
0102   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0103   
0104   //! Gets the bounds of the parametric interval on
0105   //! the function
0106   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0107   
0108   //! Gets the bounds of the function parametric domain.
0109   //! Warning: This domain it is  not modified by the
0110   //! SetValue method
0111   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0112   
0113   //! Returns the tolerances associated at each poles to
0114   //! reach  in approximation, to satisfy: BoundTol error
0115   //! at the   Boundary  AngleTol tangent error  at  the
0116   //! Boundary  (in radian)  SurfTol   error inside the
0117   //! surface.
0118   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
0119   
0120   //! Get the barycentre of Surface.
0121   //! An   very  poor estimation is sufficient.
0122   //! This information is useful to perform well
0123   //! conditioned rational approximation.
0124   //! Warning: Used only if <me> IsRational
0125   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
0126   
0127   //! Returns the   length of the greater section. This
0128   //! information is useful to G1's control.
0129   //! Warning: With an little value, approximation can be slower.
0130   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
0131   
0132   //! Compute the minimal value of weight for each poles
0133   //! in all  sections.
0134   //! This information is  useful to control error
0135   //! in rational approximation.
0136   //! Warning: Used only if <me> IsRational
0137   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0138   
0139   //! return True
0140   Standard_EXPORT virtual Standard_Boolean IsConstant (Standard_Real& Error) const Standard_OVERRIDE;
0141   
0142   //! Return the constant Section if <me>  IsConstant.
0143   Standard_EXPORT virtual Handle(Geom_Curve) ConstantSection() const Standard_OVERRIDE;
0144 
0145 
0146 
0147 
0148   DEFINE_STANDARD_RTTIEXT(GeomFill_UniformSection,GeomFill_SectionLaw)
0149 
0150 protected:
0151 
0152 
0153 
0154 
0155 private:
0156 
0157 
0158   Standard_Real First;
0159   Standard_Real Last;
0160   Handle(Geom_Curve) mySection;
0161   Handle(Geom_BSplineCurve) myCurve;
0162 
0163 
0164 };
0165 
0166 
0167 
0168 
0169 
0170 
0171 
0172 #endif // _GeomFill_UniformSection_HeaderFile