Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-12-14
0002 // Created by: Joelle CHAUVET
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 _GeomFill_NSections_HeaderFile
0018 #define _GeomFill_NSections_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Real.hxx>
0023 #include <TColGeom_SequenceOfCurve.hxx>
0024 #include <GeomFill_SequenceOfTrsf.hxx>
0025 #include <TColStd_SequenceOfReal.hxx>
0026 #include <GeomFill_SectionLaw.hxx>
0027 #include <TColgp_Array1OfPnt.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <TColgp_Array1OfVec.hxx>
0030 #include <Standard_Integer.hxx>
0031 #include <TColStd_Array1OfInteger.hxx>
0032 #include <GeomAbs_Shape.hxx>
0033 class Geom_BSplineSurface;
0034 class gp_Pnt;
0035 class Geom_Curve;
0036 
0037 
0038 class GeomFill_NSections;
0039 DEFINE_STANDARD_HANDLE(GeomFill_NSections, GeomFill_SectionLaw)
0040 
0041 //! Define a Section Law by N Sections
0042 class GeomFill_NSections : public GeomFill_SectionLaw
0043 {
0044 
0045 public:
0046 
0047   
0048   //! Make a SectionLaw with N Curves.
0049   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC);
0050   
0051   //! Make a SectionLaw with N Curves and N associated parameters.
0052   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP);
0053   
0054   //! Make a SectionLaw with N Curves and N associated parameters.
0055   //! UF and UL are the parametric bounds of the NSections
0056   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL);
0057   
0058   //! Make a SectionLaw with N Curves and N associated parameters.
0059   //! UF and UL are the parametric bounds of the NSections
0060   //! VF and VL are the parametric bounds of the path
0061   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL);
0062   
0063   //! Make a SectionLaw with N Curves and N associated parameters.
0064   //! UF and UL are the parametric bounds of the NSections
0065   //! VF and VL are the parametric bounds of the path
0066   //! UF and UL are the parametric bounds of the NSections
0067   //! Surf is a reference surface used by BRepFill_NSections
0068   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const GeomFill_SequenceOfTrsf& Trsfs, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL, const Handle(Geom_BSplineSurface)& Surf);
0069   
0070   //! compute the section for v = param
0071   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0072   
0073   //! compute the first  derivative in v direction  of the
0074   //! section for v =  param
0075   //! Warning : It used only for C1 or C2 approximation
0076   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0077   
0078   //! compute the second derivative  in v direction of the
0079   //! section  for v = param
0080   //! Warning : It used only for C2 approximation
0081   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;
0082   
0083   //! Sets the reference surface
0084   Standard_EXPORT void SetSurface (const Handle(Geom_BSplineSurface)& RefSurf);
0085   
0086   //! Computes the surface
0087   Standard_EXPORT void ComputeSurface();
0088   
0089   //! give if possible an bspline Surface, like iso-v are the
0090   //! section.  If it is  not possible  this methode have  to
0091   //! get an Null Surface.  Is it the default implementation.
0092   Standard_EXPORT virtual Handle(Geom_BSplineSurface) BSplineSurface() const Standard_OVERRIDE;
0093   
0094   //! get the format of an  section
0095   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const Standard_OVERRIDE;
0096   
0097   //! get the Knots of the section
0098   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
0099   
0100   //! get the Multplicities of the section
0101   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
0102   
0103   //! Returns if the sections are rationnal or not
0104   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
0105   
0106   //! Returns if the sections are periodic or not
0107   Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
0108   
0109   //! Returns if the law  isperiodic or not
0110   Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
0111   
0112   //! Returns  the number  of  intervals for  continuity
0113   //! <S>.
0114   //! May be one if Continuity(me) >= <S>
0115   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0116   
0117   //! Stores in <T> the  parameters bounding the intervals
0118   //! of continuity <S>.
0119   //!
0120   //! The array must provide  enough room to  accommodate
0121   //! for the parameters. i.e. T.Length() > NbIntervals()
0122   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0123   
0124   //! Sets the bounds of the parametric interval on
0125   //! the function
0126   //! This determines the derivatives in these values if the
0127   //! function is not Cn.
0128   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0129   
0130   //! Gets the bounds of the parametric interval on
0131   //! the function
0132   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0133   
0134   //! Gets the bounds of the function parametric domain.
0135   //! Warning: This domain it is  not modified by the
0136   //! SetValue method
0137   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0138   
0139   //! Returns the tolerances associated at each poles to
0140   //! reach  in approximation, to satisfy: BoundTol error
0141   //! at the   Boundary  AngleTol tangent error  at  the
0142   //! Boundary  (in radian)  SurfTol   error inside the
0143   //! surface.
0144   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
0145   
0146   //! Get the barycentre of Surface.
0147   //! An   very  poor estimation is sufficient.
0148   //! This information is useful to perform well
0149   //! conditioned rational approximation.
0150   //! Warning: Used only if <me> IsRational
0151   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
0152   
0153   //! Returns the   length of the greater section. This
0154   //! information is useful to G1's control.
0155   //! Warning: With an little value, approximation can be slower.
0156   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
0157   
0158   //! Compute the minimal value of weight for each poles
0159   //! in all  sections.
0160   //! This information is  useful to control error
0161   //! in rational approximation.
0162   //! Warning: Used only if <me> IsRational
0163   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0164   
0165   //! return True If the Law isConstant
0166   Standard_EXPORT virtual Standard_Boolean IsConstant (Standard_Real& Error) const Standard_OVERRIDE;
0167   
0168   //! Return the constant Section if <me>  IsConstant.
0169   Standard_EXPORT virtual Handle(Geom_Curve) ConstantSection() const Standard_OVERRIDE;
0170   
0171   //! Returns True if all section  are circle, with same
0172   //! plane,same center and  linear  radius  evolution
0173   //! Return False by Default.
0174   Standard_EXPORT virtual Standard_Boolean IsConicalLaw (Standard_Real& Error) const Standard_OVERRIDE;
0175   
0176   //! Return the circle section  at parameter <Param>, if
0177   //! <me> a  IsConicalLaw
0178   Standard_EXPORT virtual Handle(Geom_Curve) CirclSection (const Standard_Real Param) const Standard_OVERRIDE;
0179 
0180 
0181 
0182 
0183   DEFINE_STANDARD_RTTIEXT(GeomFill_NSections,GeomFill_SectionLaw)
0184 
0185 protected:
0186 
0187 
0188 
0189 
0190 private:
0191 
0192 
0193   Standard_Real UFirst;
0194   Standard_Real ULast;
0195   Standard_Real VFirst;
0196   Standard_Real VLast;
0197   TColGeom_SequenceOfCurve mySections;
0198   GeomFill_SequenceOfTrsf myTrsfs;
0199   TColStd_SequenceOfReal myParams;
0200   Handle(Geom_BSplineSurface) mySurface;
0201   Handle(Geom_BSplineSurface) myRefSurf;
0202 
0203 
0204 };
0205 
0206 
0207 
0208 
0209 
0210 
0211 
0212 #endif // _GeomFill_NSections_HeaderFile