1 // Created on: 1996-11-25
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepBlend_AppSurface_HeaderFile
18 #define _BRepBlend_AppSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Approx_SweepApproximation.hxx>
25 #include <AppBlend_Approx.hxx>
26 #include <Standard_Real.hxx>
27 #include <GeomAbs_Shape.hxx>
28 #include <Standard_Integer.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <TColgp_Array2OfPnt.hxx>
31 #include <TColStd_Array2OfReal.hxx>
32 #include <TColStd_Array1OfReal.hxx>
33 #include <TColStd_Array1OfInteger.hxx>
34 #include <TColgp_Array1OfPnt2d.hxx>
35 #include <Standard_OStream.hxx>
36 class Approx_SweepFunction;
39 //! Used to Approximate the blending surfaces.
40 class BRepBlend_AppSurface : public AppBlend_Approx
47 //! Approximation of the new Surface (and
48 //! eventually the 2d Curves on the support
50 //! Normally the 2d curve are
51 //! approximated with an tolerance given by the
52 //! resolution on support surfaces, but if this
53 //! tolerance is too large Tol2d is used.
54 Standard_EXPORT BRepBlend_AppSurface(const Handle(Approx_SweepFunction)& Funct, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolAngular, const GeomAbs_Shape Continuity = GeomAbs_C0, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 50);
56 Standard_Boolean IsDone() const;
58 Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
60 Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
62 Standard_Integer UDegree() const;
64 Standard_Integer VDegree() const;
66 const TColgp_Array2OfPnt& SurfPoles() const;
68 const TColStd_Array2OfReal& SurfWeights() const;
70 const TColStd_Array1OfReal& SurfUKnots() const;
72 const TColStd_Array1OfReal& SurfVKnots() const;
74 const TColStd_Array1OfInteger& SurfUMults() const;
76 const TColStd_Array1OfInteger& SurfVMults() const;
78 //! returns the maximum error in the surface approximation.
79 Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
81 Standard_Integer NbCurves2d() const;
83 Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
85 Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
87 Standard_Integer Curves2dDegree() const;
89 const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
91 const TColStd_Array1OfReal& Curves2dKnots() const;
93 const TColStd_Array1OfInteger& Curves2dMults() const;
95 Standard_EXPORT void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const;
97 //! returns the maximum error in the <Index> 2d curve approximation.
98 Standard_EXPORT Standard_Real Max2dError (const Standard_Integer Index) const;
100 Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
102 //! display information on approximation.
103 Standard_EXPORT void Dump (Standard_OStream& o) const;
118 Approx_SweepApproximation approx;
124 #include <BRepBlend_AppSurface.lxx>
130 #endif // _BRepBlend_AppSurface_HeaderFile