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 StdFail_NotDone;
37 class Standard_DomainError;
38 class Standard_OutOfRange;
39 class Approx_SweepFunction;
42 //! Used to Approximate the blending surfaces.
43 class BRepBlend_AppSurface : public AppBlend_Approx
50 //! Approximation of the new Surface (and
51 //! eventually the 2d Curves on the support
53 //! Normaly the 2d curve are
54 //! approximated with an tolerance given by the
55 //! resolution on support surfaces, but if this
56 //! tolerance is too large Tol2d is used.
57 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);
59 Standard_Boolean IsDone() const;
61 Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
63 Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
65 Standard_Integer UDegree() const;
67 Standard_Integer VDegree() const;
69 const TColgp_Array2OfPnt& SurfPoles() const;
71 const TColStd_Array2OfReal& SurfWeights() const;
73 const TColStd_Array1OfReal& SurfUKnots() const;
75 const TColStd_Array1OfReal& SurfVKnots() const;
77 const TColStd_Array1OfInteger& SurfUMults() const;
79 const TColStd_Array1OfInteger& SurfVMults() const;
81 //! returns the maximum error in the suface approximation.
82 Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
84 Standard_Integer NbCurves2d() const;
86 Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
88 Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
90 Standard_Integer Curves2dDegree() const;
92 const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
94 const TColStd_Array1OfReal& Curves2dKnots() const;
96 const TColStd_Array1OfInteger& Curves2dMults() const;
98 Standard_EXPORT void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const;
100 //! returns the maximum error in the <Index> 2d curve approximation.
101 Standard_EXPORT Standard_Real Max2dError (const Standard_Integer Index) const;
103 Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
105 //! diplay information on approximation.
106 Standard_EXPORT void Dump (Standard_OStream& o) const;
121 Approx_SweepApproximation approx;
127 #include <BRepBlend_AppSurface.lxx>
133 #endif // _BRepBlend_AppSurface_HeaderFile