1 // Created on: 1993-09-28
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1993-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 _GeomFill_AppSurf_HeaderFile
18 #define _GeomFill_AppSurf_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <TColgp_HArray2OfPnt.hxx>
28 #include <TColStd_HArray2OfReal.hxx>
29 #include <TColStd_HArray1OfReal.hxx>
30 #include <TColStd_HArray1OfInteger.hxx>
31 #include <TColgp_SequenceOfArray1OfPnt2d.hxx>
32 #include <Approx_ParametrizationType.hxx>
33 #include <GeomAbs_Shape.hxx>
34 #include <AppBlend_Approx.hxx>
35 #include <TColgp_Array2OfPnt.hxx>
36 #include <TColStd_Array2OfReal.hxx>
37 #include <TColStd_Array1OfReal.hxx>
38 #include <TColStd_Array1OfInteger.hxx>
39 #include <TColgp_Array1OfPnt2d.hxx>
40 class StdFail_NotDone;
41 class Standard_DomainError;
42 class Standard_OutOfRange;
43 class GeomFill_SectionGenerator;
46 //! Approximate a BSplineSurface passing by all the
47 //! curves described in the SectionGenerator
49 class GeomFill_AppSurf : public AppBlend_Approx
56 Standard_EXPORT GeomFill_AppSurf();
58 Standard_EXPORT GeomFill_AppSurf(const Standard_Integer Degmin, const Standard_Integer Degmax, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIt, const Standard_Boolean KnownParameters = Standard_False);
60 Standard_EXPORT void Init (const Standard_Integer Degmin, const Standard_Integer Degmax, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIt, const Standard_Boolean KnownParameters = Standard_False);
62 //! Define the type of parametrization used in the approximation
63 Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType);
65 //! Define the Continuity used in the approximation
66 Standard_EXPORT void SetContinuity (const GeomAbs_Shape C);
68 //! define the Weights associed to the criterium used in
72 Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3);
74 //! returns the type of parametrization used in the approximation
75 Standard_EXPORT Approx_ParametrizationType ParType() const;
77 //! returns the Continuity used in the approximation
78 Standard_EXPORT GeomAbs_Shape Continuity() const;
80 //! returns the Weights (as percent) associed to the criterium used in
82 Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const;
84 Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Boolean SpApprox = Standard_False);
86 Standard_EXPORT void PerformSmoothing (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen);
88 Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Integer NbMaxP);
90 Standard_Boolean IsDone() const;
92 Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
94 Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
96 Standard_Integer UDegree() const;
98 Standard_Integer VDegree() const;
100 const TColgp_Array2OfPnt& SurfPoles() const;
102 const TColStd_Array2OfReal& SurfWeights() const;
104 const TColStd_Array1OfReal& SurfUKnots() const;
106 const TColStd_Array1OfReal& SurfVKnots() const;
108 const TColStd_Array1OfInteger& SurfUMults() const;
110 const TColStd_Array1OfInteger& SurfVMults() const;
112 Standard_Integer NbCurves2d() const;
114 Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
116 Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
118 Standard_Integer Curves2dDegree() const;
120 const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
122 const TColStd_Array1OfReal& Curves2dKnots() const;
124 const TColStd_Array1OfInteger& Curves2dMults() const;
126 void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const;
128 Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
142 Standard_EXPORT void InternalPerform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Boolean SpApprox, const Standard_Boolean UseVariational);
145 Standard_Boolean done;
146 Standard_Integer dmin;
147 Standard_Integer dmax;
150 Standard_Integer nbit;
151 Standard_Integer udeg;
152 Standard_Integer vdeg;
153 Standard_Boolean knownp;
154 Handle(TColgp_HArray2OfPnt) tabPoles;
155 Handle(TColStd_HArray2OfReal) tabWeights;
156 Handle(TColStd_HArray1OfReal) tabUKnots;
157 Handle(TColStd_HArray1OfReal) tabVKnots;
158 Handle(TColStd_HArray1OfInteger) tabUMults;
159 Handle(TColStd_HArray1OfInteger) tabVMults;
160 TColgp_SequenceOfArray1OfPnt2d seqPoles2d;
161 Standard_Real tol3dreached;
162 Standard_Real tol2dreached;
163 Approx_ParametrizationType paramtype;
164 GeomAbs_Shape continuity;
165 Standard_Real critweights[3];
170 #define TheSectionGenerator GeomFill_SectionGenerator
171 #define TheSectionGenerator_hxx <GeomFill_SectionGenerator.hxx>
172 #define Handle_TheLine Handle(GeomFill_Line)
173 #define TheLine GeomFill_Line
174 #define TheLine_hxx <GeomFill_Line.hxx>
175 #define AppBlend_AppSurf GeomFill_AppSurf
176 #define AppBlend_AppSurf_hxx <GeomFill_AppSurf.hxx>
178 #include <AppBlend_AppSurf.lxx>
180 #undef TheSectionGenerator
181 #undef TheSectionGenerator_hxx
182 #undef Handle_TheLine
185 #undef AppBlend_AppSurf
186 #undef AppBlend_AppSurf_hxx
191 #endif // _GeomFill_AppSurf_HeaderFile