0032951: Coding - get rid of unused headers [GeomConvert to IGESBasic]
[occt.git] / src / GeomFill / GeomFill_NSections.hxx
1 // Created on: 1998-12-14
2 // Created by: Joelle CHAUVET
3 // Copyright (c) 1998-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_NSections_HeaderFile
18 #define _GeomFill_NSections_HeaderFile
19
20 #include <Standard.hxx>
21
22 #include <Standard_Real.hxx>
23 #include <TColGeom_SequenceOfCurve.hxx>
24 #include <GeomFill_SequenceOfTrsf.hxx>
25 #include <TColStd_SequenceOfReal.hxx>
26 #include <GeomFill_SectionLaw.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29 #include <TColgp_Array1OfVec.hxx>
30 #include <Standard_Integer.hxx>
31 #include <TColStd_Array1OfInteger.hxx>
32 #include <GeomAbs_Shape.hxx>
33 class Geom_BSplineSurface;
34 class gp_Pnt;
35 class Geom_Curve;
36
37
38 class GeomFill_NSections;
39 DEFINE_STANDARD_HANDLE(GeomFill_NSections, GeomFill_SectionLaw)
40
41 //! Define a Section Law by N Sections
42 class GeomFill_NSections : public GeomFill_SectionLaw
43 {
44
45 public:
46
47   
48   //! Make a SectionLaw with N Curves.
49   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC);
50   
51   //! Make a SectionLaw with N Curves and N associated parameters.
52   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP);
53   
54   //! Make a SectionLaw with N Curves and N associated parameters.
55   //! UF and UL are the parametric bounds of the NSections
56   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL);
57   
58   //! Make a SectionLaw with N Curves and N associated parameters.
59   //! UF and UL are the parametric bounds of the NSections
60   //! VF and VL are the parametric bounds of the path
61   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL);
62   
63   //! Make a SectionLaw with N Curves and N associated parameters.
64   //! UF and UL are the parametric bounds of the NSections
65   //! VF and VL are the parametric bounds of the path
66   //! UF and UL are the parametric bounds of the NSections
67   //! Surf is a reference surface used by BRepFill_NSections
68   Standard_EXPORT GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const GeomFill_SequenceOfTrsf& Trsfs, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL, const Handle(Geom_BSplineSurface)& Surf);
69   
70   //! compute the section for v = param
71   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
72   
73   //! compute the first  derivative in v direction  of the
74   //! section for v =  param
75   //! Warning : It used only for C1 or C2 approximation
76   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
77   
78   //! compute the second derivative  in v direction of the
79   //! section  for v = param
80   //! Warning : It used only for C2 approximation
81   Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
82   
83   //! Sets the reference surface
84   Standard_EXPORT void SetSurface (const Handle(Geom_BSplineSurface)& RefSurf);
85   
86   //! Computes the surface
87   Standard_EXPORT void ComputeSurface();
88   
89   //! give if possible an bspline Surface, like iso-v are the
90   //! section.  If it is  not possible  this methode have  to
91   //! get an Null Surface.  Is it the default implementation.
92   Standard_EXPORT virtual Handle(Geom_BSplineSurface) BSplineSurface() const Standard_OVERRIDE;
93   
94   //! get the format of an  section
95   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const Standard_OVERRIDE;
96   
97   //! get the Knots of the section
98   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const Standard_OVERRIDE;
99   
100   //! get the Multplicities of the section
101   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const Standard_OVERRIDE;
102   
103   //! Returns if the sections are rationnal or not
104   Standard_EXPORT virtual Standard_Boolean IsRational() const Standard_OVERRIDE;
105   
106   //! Returns if the sections are periodic or not
107   Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
108   
109   //! Returns if the law  isperiodic or not
110   Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
111   
112   //! Returns  the number  of  intervals for  continuity
113   //! <S>.
114   //! May be one if Continuity(me) >= <S>
115   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
116   
117   //! Stores in <T> the  parameters bounding the intervals
118   //! of continuity <S>.
119   //!
120   //! The array must provide  enough room to  accommodate
121   //! for the parameters. i.e. T.Length() > NbIntervals()
122   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
123   
124   //! Sets the bounds of the parametric interval on
125   //! the function
126   //! This determines the derivatives in these values if the
127   //! function is not Cn.
128   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
129   
130   //! Gets the bounds of the parametric interval on
131   //! the function
132   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
133   
134   //! Gets the bounds of the function parametric domain.
135   //! Warning: This domain it is  not modified by the
136   //! SetValue method
137   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
138   
139   //! Returns the tolerances associated at each poles to
140   //! reach  in approximation, to satisfy: BoundTol error
141   //! at the   Boundary  AngleTol tangent error  at  the
142   //! Boundary  (in radian)  SurfTol   error inside the
143   //! surface.
144   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const Standard_OVERRIDE;
145   
146   //! Get the barycentre of Surface.
147   //! An   very  poor estimation is sufficient.
148   //! This information is useful to perform well
149   //! conditioned rational approximation.
150   //! Warning: Used only if <me> IsRational
151   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const Standard_OVERRIDE;
152   
153   //! Returns the   length of the greater section. This
154   //! information is useful to G1's control.
155   //! Warning: With an little value, approximation can be slower.
156   Standard_EXPORT virtual Standard_Real MaximalSection() const Standard_OVERRIDE;
157   
158   //! Compute the minimal value of weight for each poles
159   //! in all  sections.
160   //! This information is  useful to control error
161   //! in rational approximation.
162   //! Warning: Used only if <me> IsRational
163   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
164   
165   //! return True If the Law isConstant
166   Standard_EXPORT virtual Standard_Boolean IsConstant (Standard_Real& Error) const Standard_OVERRIDE;
167   
168   //! Return the constant Section if <me>  IsConstant.
169   Standard_EXPORT virtual Handle(Geom_Curve) ConstantSection() const Standard_OVERRIDE;
170   
171   //! Returns True if all section  are circle, with same
172   //! plane,same center and  linear  radius  evolution
173   //! Return False by Default.
174   Standard_EXPORT virtual Standard_Boolean IsConicalLaw (Standard_Real& Error) const Standard_OVERRIDE;
175   
176   //! Return the circle section  at parameter <Param>, if
177   //! <me> a  IsConicalLaw
178   Standard_EXPORT virtual Handle(Geom_Curve) CirclSection (const Standard_Real Param) const Standard_OVERRIDE;
179
180
181
182
183   DEFINE_STANDARD_RTTIEXT(GeomFill_NSections,GeomFill_SectionLaw)
184
185 protected:
186
187
188
189
190 private:
191
192
193   Standard_Real UFirst;
194   Standard_Real ULast;
195   Standard_Real VFirst;
196   Standard_Real VLast;
197   TColGeom_SequenceOfCurve mySections;
198   GeomFill_SequenceOfTrsf myTrsfs;
199   TColStd_SequenceOfReal myParams;
200   Handle(Geom_BSplineSurface) mySurface;
201   Handle(Geom_BSplineSurface) myRefSurf;
202
203
204 };
205
206
207
208
209
210
211
212 #endif // _GeomFill_NSections_HeaderFile