0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / GeomFill / GeomFill_AppSweep.hxx
CommitLineData
42cf5bc1 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
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 _GeomFill_AppSweep_HeaderFile
18#define _GeomFill_AppSweep_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
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>
40class StdFail_NotDone;
41class Standard_DomainError;
42class Standard_OutOfRange;
43class GeomFill_SweepSectionGenerator;
44class GeomFill_Line;
45
46
c60ae7f6 47//! Approximate a sweep surface passing by all the
48//! curves described in the SweepSectionGenerator.
42cf5bc1 49
50class GeomFill_AppSweep : public AppBlend_Approx
51{
52public:
53
54 DEFINE_STANDARD_ALLOC
55
56
57 Standard_EXPORT GeomFill_AppSweep();
58
59 Standard_EXPORT GeomFill_AppSweep(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
61 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
36b9ff75 63 //! Define the type of parametrization used in the approximation
42cf5bc1 64 Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType);
65
36b9ff75 66 //! Define the Continuity used in the approximation
42cf5bc1 67 Standard_EXPORT void SetContinuity (const GeomAbs_Shape C);
68
36b9ff75 69 //! define the Weights associed to the criterium used in
70 //! the optimization.
71 //!
72 //! if Wi <= 0
42cf5bc1 73 Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3);
74
36b9ff75 75 //! returns the type of parametrization used in the approximation
42cf5bc1 76 Standard_EXPORT Approx_ParametrizationType ParType() const;
77
36b9ff75 78 //! returns the Continuity used in the approximation
42cf5bc1 79 Standard_EXPORT GeomAbs_Shape Continuity() const;
80
36b9ff75 81 //! returns the Weights (as percent) associed to the criterium used in
82 //! the optimization.
42cf5bc1 83 Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const;
84
85 Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SweepSectionGenerator& SecGen, const Standard_Boolean SpApprox = Standard_False);
86
87 Standard_EXPORT void PerformSmoothing (const Handle(GeomFill_Line)& Lin, GeomFill_SweepSectionGenerator& SecGen);
88
89 Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SweepSectionGenerator& SecGen, const Standard_Integer NbMaxP);
90
91 Standard_Boolean IsDone() const;
92
93 Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
94
95 Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
96
97 Standard_Integer UDegree() const;
98
99 Standard_Integer VDegree() const;
100
101 const TColgp_Array2OfPnt& SurfPoles() const;
102
103 const TColStd_Array2OfReal& SurfWeights() const;
104
105 const TColStd_Array1OfReal& SurfUKnots() const;
106
107 const TColStd_Array1OfReal& SurfVKnots() const;
108
109 const TColStd_Array1OfInteger& SurfUMults() const;
110
111 const TColStd_Array1OfInteger& SurfVMults() const;
112
113 Standard_Integer NbCurves2d() const;
114
115 Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
116
117 Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
118
119 Standard_Integer Curves2dDegree() const;
120
121 const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
122
123 const TColStd_Array1OfReal& Curves2dKnots() const;
124
125 const TColStd_Array1OfInteger& Curves2dMults() const;
126
127 void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const;
128
129 Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
130
131
132
133
134protected:
135
136
137
138
139
140private:
141
142
143 Standard_EXPORT void InternalPerform (const Handle(GeomFill_Line)& Lin, GeomFill_SweepSectionGenerator& SecGen, const Standard_Boolean SpApprox, const Standard_Boolean UseVariational);
144
145
146 Standard_Boolean done;
147 Standard_Integer dmin;
148 Standard_Integer dmax;
149 Standard_Real tol3d;
150 Standard_Real tol2d;
151 Standard_Integer nbit;
152 Standard_Integer udeg;
153 Standard_Integer vdeg;
154 Standard_Boolean knownp;
155 Handle(TColgp_HArray2OfPnt) tabPoles;
156 Handle(TColStd_HArray2OfReal) tabWeights;
157 Handle(TColStd_HArray1OfReal) tabUKnots;
158 Handle(TColStd_HArray1OfReal) tabVKnots;
159 Handle(TColStd_HArray1OfInteger) tabUMults;
160 Handle(TColStd_HArray1OfInteger) tabVMults;
161 TColgp_SequenceOfArray1OfPnt2d seqPoles2d;
162 Standard_Real tol3dreached;
163 Standard_Real tol2dreached;
164 Approx_ParametrizationType paramtype;
165 GeomAbs_Shape continuity;
166 Standard_Real critweights[3];
167
168
169};
170
171#define TheSectionGenerator GeomFill_SweepSectionGenerator
172#define TheSectionGenerator_hxx <GeomFill_SweepSectionGenerator.hxx>
173#define Handle_TheLine Handle(GeomFill_Line)
174#define TheLine GeomFill_Line
175#define TheLine_hxx <GeomFill_Line.hxx>
176#define AppBlend_AppSurf GeomFill_AppSweep
177#define AppBlend_AppSurf_hxx <GeomFill_AppSweep.hxx>
178
179#include <AppBlend_AppSurf.lxx>
180
181#undef TheSectionGenerator
182#undef TheSectionGenerator_hxx
183#undef Handle_TheLine
184#undef TheLine
185#undef TheLine_hxx
186#undef AppBlend_AppSurf
187#undef AppBlend_AppSurf_hxx
188
189
190
191
192#endif // _GeomFill_AppSweep_HeaderFile