Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:15:30

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