0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepBlend / BRepBlend_AppSurface.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepBlend_AppSurface_HeaderFile
18 #define _BRepBlend_AppSurface_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
40
41
42 //! Used to Approximate the blending surfaces.
43 class BRepBlend_AppSurface  : public AppBlend_Approx
44 {
45 public:
46
47   DEFINE_STANDARD_ALLOC
48
49   
50   //! Approximation     of   the   new  Surface  (and
51   //! eventually the  2d    Curves   on the   support
52   //! surfaces).
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(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);
58   
59     Standard_Boolean IsDone() const;
60   
61   Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
62   
63   Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
64   
65     Standard_Integer UDegree() const;
66   
67     Standard_Integer VDegree() const;
68   
69     const TColgp_Array2OfPnt& SurfPoles() const;
70   
71     const TColStd_Array2OfReal& SurfWeights() const;
72   
73     const TColStd_Array1OfReal& SurfUKnots() const;
74   
75     const TColStd_Array1OfReal& SurfVKnots() const;
76   
77     const TColStd_Array1OfInteger& SurfUMults() const;
78   
79     const TColStd_Array1OfInteger& SurfVMults() const;
80   
81   //! returns the maximum error in the suface approximation.
82   Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
83   
84     Standard_Integer NbCurves2d() const;
85   
86   Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
87   
88   Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
89   
90     Standard_Integer Curves2dDegree() const;
91   
92     const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
93   
94     const TColStd_Array1OfReal& Curves2dKnots() const;
95   
96     const TColStd_Array1OfInteger& Curves2dMults() const;
97   
98   Standard_EXPORT void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const;
99   
100   //! returns the maximum error in the <Index> 2d curve approximation.
101   Standard_EXPORT Standard_Real Max2dError (const Standard_Integer Index) const;
102   
103   Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
104   
105   //! diplay information on approximation.
106   Standard_EXPORT void Dump (Standard_OStream& o) const;
107
108
109
110
111 protected:
112
113
114
115
116
117 private:
118
119
120
121   Approx_SweepApproximation approx;
122
123
124 };
125
126
127 #include <BRepBlend_AppSurface.lxx>
128
129
130
131
132
133 #endif // _BRepBlend_AppSurface_HeaderFile