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_AppSurf_HeaderFile |
18 | #define _GeomFill_AppSurf_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> |
40 | class StdFail_NotDone; |
41 | class Standard_DomainError; |
42 | class Standard_OutOfRange; |
43 | class GeomFill_SectionGenerator; |
44 | class GeomFill_Line; |
45 | |
c60ae7f6 |
46 | //! Approximate a BSplineSurface passing by all the |
47 | //! curves described in the SectionGenerator |
42cf5bc1 |
48 | |
49 | class GeomFill_AppSurf : public AppBlend_Approx |
50 | { |
51 | public: |
52 | |
53 | DEFINE_STANDARD_ALLOC |
54 | |
55 | |
56 | Standard_EXPORT GeomFill_AppSurf(); |
57 | |
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); |
59 | |
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); |
61 | |
36b9ff75 |
62 | //! Define the type of parametrization used in the approximation |
42cf5bc1 |
63 | Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType); |
64 | |
36b9ff75 |
65 | //! Define the Continuity used in the approximation |
42cf5bc1 |
66 | Standard_EXPORT void SetContinuity (const GeomAbs_Shape C); |
67 | |
36b9ff75 |
68 | //! define the Weights associed to the criterium used in |
69 | //! the optimization. |
70 | //! |
71 | //! if Wi <= 0 |
42cf5bc1 |
72 | Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3); |
73 | |
36b9ff75 |
74 | //! returns the type of parametrization used in the approximation |
42cf5bc1 |
75 | Standard_EXPORT Approx_ParametrizationType ParType() const; |
76 | |
36b9ff75 |
77 | //! returns the Continuity used in the approximation |
42cf5bc1 |
78 | Standard_EXPORT GeomAbs_Shape Continuity() const; |
79 | |
36b9ff75 |
80 | //! returns the Weights (as percent) associed to the criterium used in |
81 | //! the optimization. |
42cf5bc1 |
82 | Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const; |
83 | |
84 | Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Boolean SpApprox = Standard_False); |
85 | |
86 | Standard_EXPORT void PerformSmoothing (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen); |
87 | |
88 | Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Integer NbMaxP); |
89 | |
90 | Standard_Boolean IsDone() const; |
91 | |
92 | Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const; |
93 | |
94 | Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const; |
95 | |
96 | Standard_Integer UDegree() const; |
97 | |
98 | Standard_Integer VDegree() const; |
99 | |
100 | const TColgp_Array2OfPnt& SurfPoles() const; |
101 | |
102 | const TColStd_Array2OfReal& SurfWeights() const; |
103 | |
104 | const TColStd_Array1OfReal& SurfUKnots() const; |
105 | |
106 | const TColStd_Array1OfReal& SurfVKnots() const; |
107 | |
108 | const TColStd_Array1OfInteger& SurfUMults() const; |
109 | |
110 | const TColStd_Array1OfInteger& SurfVMults() const; |
111 | |
112 | Standard_Integer NbCurves2d() const; |
113 | |
114 | Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const; |
115 | |
116 | Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const; |
117 | |
118 | Standard_Integer Curves2dDegree() const; |
119 | |
120 | const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const; |
121 | |
122 | const TColStd_Array1OfReal& Curves2dKnots() const; |
123 | |
124 | const TColStd_Array1OfInteger& Curves2dMults() const; |
125 | |
126 | void TolReached (Standard_Real& Tol3d, Standard_Real& Tol2d) const; |
127 | |
128 | Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const; |
129 | |
130 | |
131 | |
132 | |
133 | protected: |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | private: |
140 | |
141 | |
142 | Standard_EXPORT void InternalPerform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Boolean SpApprox, const Standard_Boolean UseVariational); |
143 | |
144 | |
145 | Standard_Boolean done; |
146 | Standard_Integer dmin; |
147 | Standard_Integer dmax; |
148 | Standard_Real tol3d; |
149 | Standard_Real tol2d; |
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]; |
166 | |
167 | |
168 | }; |
169 | |
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> |
177 | |
178 | #include <AppBlend_AppSurf.lxx> |
179 | |
180 | #undef TheSectionGenerator |
181 | #undef TheSectionGenerator_hxx |
182 | #undef Handle_TheLine |
183 | #undef TheLine |
184 | #undef TheLine_hxx |
185 | #undef AppBlend_AppSurf |
186 | #undef AppBlend_AppSurf_hxx |
187 | |
188 | |
189 | |
190 | |
191 | #endif // _GeomFill_AppSurf_HeaderFile |