Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-24 08:28:19

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