Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:14:31

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