Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:57:07

0001 // Created on: 1996-11-25
0002 // Created by: Philippe MANGIN
0003 // Copyright (c) 1996-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 _BRepBlend_AppSurface_HeaderFile
0018 #define _BRepBlend_AppSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Approx_SweepApproximation.hxx>
0025 #include <AppBlend_Approx.hxx>
0026 #include <GeomAbs_Shape.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <gp_Pnt.hxx>
0029 #include <NCollection_Array2.hxx>
0030 #include <NCollection_Array1.hxx>
0031 #include <gp_Pnt2d.hxx>
0032 #include <Standard_OStream.hxx>
0033 class Approx_SweepFunction;
0034 
0035 //! Used to Approximate the blending surfaces.
0036 class BRepBlend_AppSurface : public AppBlend_Approx
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Approximation of the new Surface (and
0042   //! eventually the 2d Curves on the support
0043   //! surfaces).
0044   //! Normally the 2d curve are
0045   //! approximated with a tolerance given by the
0046   //! resolution on support surfaces, but if this
0047   //! tolerance is too large Tol2d is used.
0048   Standard_EXPORT BRepBlend_AppSurface(const occ::handle<Approx_SweepFunction>& Funct,
0049                                        const double                             First,
0050                                        const double                             Last,
0051                                        const double                             Tol3d,
0052                                        const double                             Tol2d,
0053                                        const double                             TolAngular,
0054                                        const GeomAbs_Shape Continuity = GeomAbs_C0,
0055                                        const int           Degmax     = 11,
0056                                        const int           Segmax     = 50);
0057 
0058   bool IsDone() const override;
0059 
0060   Standard_EXPORT void SurfShape(int& UDegree,
0061                                  int& VDegree,
0062                                  int& NbUPoles,
0063                                  int& NbVPoles,
0064                                  int& NbUKnots,
0065                                  int& NbVKnots) const override;
0066 
0067   Standard_EXPORT void Surface(NCollection_Array2<gp_Pnt>& TPoles,
0068                                NCollection_Array2<double>& TWeights,
0069                                NCollection_Array1<double>& TUKnots,
0070                                NCollection_Array1<double>& TVKnots,
0071                                NCollection_Array1<int>&    TUMults,
0072                                NCollection_Array1<int>&    TVMults) const override;
0073 
0074   int UDegree() const override;
0075 
0076   int VDegree() const override;
0077 
0078   const NCollection_Array2<gp_Pnt>& SurfPoles() const override;
0079 
0080   const NCollection_Array2<double>& SurfWeights() const override;
0081 
0082   const NCollection_Array1<double>& SurfUKnots() const override;
0083 
0084   const NCollection_Array1<double>& SurfVKnots() const override;
0085 
0086   const NCollection_Array1<int>& SurfUMults() const override;
0087 
0088   const NCollection_Array1<int>& SurfVMults() const override;
0089 
0090   //! returns the maximum error in the surface approximation.
0091   Standard_EXPORT double MaxErrorOnSurf() const;
0092 
0093   int NbCurves2d() const override;
0094 
0095   Standard_EXPORT void Curves2dShape(int& Degree, int& NbPoles, int& NbKnots) const override;
0096 
0097   Standard_EXPORT void Curve2d(const int                     Index,
0098                                NCollection_Array1<gp_Pnt2d>& TPoles,
0099                                NCollection_Array1<double>&   TKnots,
0100                                NCollection_Array1<int>&      TMults) const override;
0101 
0102   int Curves2dDegree() const override;
0103 
0104   const NCollection_Array1<gp_Pnt2d>& Curve2dPoles(const int Index) const override;
0105 
0106   const NCollection_Array1<double>& Curves2dKnots() const override;
0107 
0108   const NCollection_Array1<int>& Curves2dMults() const override;
0109 
0110   Standard_EXPORT void TolReached(double& Tol3d, double& Tol2d) const override;
0111 
0112   //! returns the maximum error in the <Index> 2d curve approximation.
0113   Standard_EXPORT double Max2dError(const int Index) const;
0114 
0115   Standard_EXPORT double TolCurveOnSurf(const int Index) const override;
0116 
0117   //! display information on approximation.
0118   Standard_EXPORT void Dump(Standard_OStream& o) const;
0119 
0120 private:
0121   Approx_SweepApproximation approx;
0122 };
0123 
0124 #include <BRepBlend_AppSurface.lxx>
0125 
0126 #endif // _BRepBlend_AppSurface_HeaderFile