Warnings on vc14 were eliminated
[occt.git] / src / GeomFill / GeomFill_SectionLaw.hxx
1 // Created on: 1997-11-20
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1997-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_SectionLaw_HeaderFile
18 #define _GeomFill_SectionLaw_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <MMgt_TShared.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Real.hxx>
26 #include <TColgp_Array1OfPnt.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <TColgp_Array1OfVec.hxx>
29 #include <Standard_Integer.hxx>
30 #include <TColStd_Array1OfInteger.hxx>
31 #include <GeomAbs_Shape.hxx>
32 class Standard_NotImplemented;
33 class Standard_DomainError;
34 class Standard_OutOfRange;
35 class Geom_BSplineSurface;
36 class gp_Pnt;
37 class Geom_Curve;
38
39
40 class GeomFill_SectionLaw;
41 DEFINE_STANDARD_HANDLE(GeomFill_SectionLaw, MMgt_TShared)
42
43 //! To define section law in  sweeping
44 class GeomFill_SectionLaw : public MMgt_TShared
45 {
46
47 public:
48
49   
50   //! compute the section for v = param
51   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weigths) = 0;
52   
53   //! compute the first  derivative in v direction  of the
54   //! section for v =  param
55   //! Warning : It used only for C1 or C2 aproximation
56   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths);
57   
58   //! compute the second derivative  in v direction of the
59   //! section  for v = param
60   //! Warning : It used only for C2 aproximation
61   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);
62   
63   //! give if possible an bspline Surface, like iso-v are the
64   //! section.   If it is  not possible this  methode have to
65   //! get an Null Surface. It is the default  implementation.
66   Standard_EXPORT virtual Handle(Geom_BSplineSurface) BSplineSurface() const;
67   
68   //! get the format of an  section
69   Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const = 0;
70   
71   //! get the Knots of the section
72   Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const = 0;
73   
74   //! get the Multplicities of the section
75   Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const = 0;
76   
77   //! Returns if the sections are rationnal or not
78   Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
79   
80   //! Returns if the sections are periodic or not
81   Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const = 0;
82   
83   //! Returns if law is periodic or not
84   Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const = 0;
85   
86   //! Returns  the number  of  intervals for  continuity
87   //! <S>.
88   //! May be one if Continuity(me) >= <S>
89   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
90   
91   //! Stores in <T> the  parameters bounding the intervals
92   //! of continuity <S>.
93   //!
94   //! The array must provide  enough room to  accomodate
95   //! for the parameters. i.e. T.Length() > NbIntervals()
96   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
97   
98   //! Sets the bounds of the parametric interval on
99   //! the function
100   //! This determines the derivatives in these values if the
101   //! function is not Cn.
102   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0;
103   
104   //! Gets the bounds of the parametric interval on
105   //! the function
106   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const = 0;
107   
108   //! Gets the bounds of the function parametric domain.
109   //! Warning: This domain it is  not modified by the
110   //! SetValue method
111   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const = 0;
112   
113   //! Returns the tolerances associated at each poles to
114   //! reach  in approximation, to satisfy: BoundTol error
115   //! at the   Boundary  AngleTol tangent error  at  the
116   //! Boundary  (in radian)  SurfTol   error inside the
117   //! surface.
118   Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const = 0;
119   
120   //! Is  usefull, if (me)  have to run  numerical
121   //! algorithm  to perform D0,  D1 or D2
122   //! The default implementation make nothing.
123   Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d);
124   
125   //! Get the barycentre of Surface.
126   //! An   very  poor estimation is sufficent.
127   //! This information is usefull to perform well
128   //! conditioned rational approximation.
129   //! Warning: Used only if <me> IsRational
130   Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const;
131   
132   //! Returns the   length of the greater section. This
133   //! information is usefull to G1's control.
134   //! Warning: With an little value, approximation can be slower.
135   Standard_EXPORT virtual Standard_Real MaximalSection() const = 0;
136   
137   //! Compute the minimal value of weight for each poles
138   //! in all  sections.
139   //! This information is  usefull to control error
140   //! in rational approximation.
141   //! Warning: Used only if <me> IsRational
142   Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const;
143   
144   //! Say if all sections are equals
145   Standard_EXPORT virtual Standard_Boolean IsConstant (Standard_Real& Error) const;
146   
147   //! Return a  copy of the  constant Section,  if me
148   //! IsConstant
149   Standard_EXPORT virtual Handle(Geom_Curve) ConstantSection() const;
150   
151   //! Returns True if all section  are circle, with same
152   //! plane,same center and  linear  radius  evolution
153   //! Return False by Default.
154   Standard_EXPORT virtual Standard_Boolean IsConicalLaw (Standard_Real& Error) const;
155   
156   //! Return the circle section  at parameter <Param>, if
157   //! <me> a  IsConicalLaw
158   Standard_EXPORT virtual Handle(Geom_Curve) CirclSection (const Standard_Real Param) const;
159
160
161
162
163   DEFINE_STANDARD_RTTIEXT(GeomFill_SectionLaw,MMgt_TShared)
164
165 protected:
166
167
168
169
170 private:
171
172
173
174
175 };
176
177
178
179
180
181
182
183 #endif // _GeomFill_SectionLaw_HeaderFile