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
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_SectionLaw_HeaderFile
18 #define _GeomFill_SectionLaw_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Transient.hxx>
24 #include <TColgp_Array1OfPnt.hxx>
25 #include <TColStd_Array1OfReal.hxx>
26 #include <TColgp_Array1OfVec.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TColStd_Array1OfInteger.hxx>
29 #include <GeomAbs_Shape.hxx>
30 class Geom_BSplineSurface;
35 class GeomFill_SectionLaw;
36 DEFINE_STANDARD_HANDLE(GeomFill_SectionLaw, Standard_Transient)
38 //! To define section law in sweeping
39 class GeomFill_SectionLaw : public Standard_Transient
45 //! compute the section for v = param
46 Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weigths) = 0;
48 //! compute the first derivative in v direction of the
49 //! section for v = param
50 //! Warning : It used only for C1 or C2 approximation
51 Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths);
53 //! compute the second derivative in v direction of the
54 //! section for v = param
55 //! Warning : It used only for C2 approximation
56 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);
58 //! give if possible an bspline Surface, like iso-v are the
59 //! section. If it is not possible this methode have to
60 //! get an Null Surface. It is the default implementation.
61 Standard_EXPORT virtual Handle(Geom_BSplineSurface) BSplineSurface() const;
63 //! get the format of an section
64 Standard_EXPORT virtual void SectionShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree) const = 0;
66 //! get the Knots of the section
67 Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) const = 0;
69 //! get the Multplicities of the section
70 Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) const = 0;
72 //! Returns if the sections are rationnal or not
73 Standard_EXPORT virtual Standard_Boolean IsRational() const = 0;
75 //! Returns if the sections are periodic or not
76 Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const = 0;
78 //! Returns if law is periodic or not
79 Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const = 0;
81 //! Returns the number of intervals for continuity
83 //! May be one if Continuity(me) >= <S>
84 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
86 //! Stores in <T> the parameters bounding the intervals
87 //! of continuity <S>.
89 //! The array must provide enough room to accommodate
90 //! for the parameters. i.e. T.Length() > NbIntervals()
91 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
93 //! Sets the bounds of the parametric interval on
95 //! This determines the derivatives in these values if the
96 //! function is not Cn.
97 Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0;
99 //! Gets the bounds of the parametric interval on
101 Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const = 0;
103 //! Gets the bounds of the function parametric domain.
104 //! Warning: This domain it is not modified by the
106 Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const = 0;
108 //! Returns the tolerances associated at each poles to
109 //! reach in approximation, to satisfy: BoundTol error
110 //! at the Boundary AngleTol tangent error at the
111 //! Boundary (in radian) SurfTol error inside the
113 Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, TColStd_Array1OfReal& Tol3d) const = 0;
115 //! Is useful, if (me) have to run numerical
116 //! algorithm to perform D0, D1 or D2
117 //! The default implementation make nothing.
118 Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d);
120 //! Get the barycentre of Surface.
121 //! An very poor estimation is sufficient.
122 //! This information is useful to perform well
123 //! conditioned rational approximation.
124 //! Warning: Used only if <me> IsRational
125 Standard_EXPORT virtual gp_Pnt BarycentreOfSurf() const;
127 //! Returns the length of the greater section. This
128 //! information is useful to G1's control.
129 //! Warning: With an little value, approximation can be slower.
130 Standard_EXPORT virtual Standard_Real MaximalSection() const = 0;
132 //! Compute the minimal value of weight for each poles
134 //! This information is useful to control error
135 //! in rational approximation.
136 //! Warning: Used only if <me> IsRational
137 Standard_EXPORT virtual void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const;
139 //! Say if all sections are equals
140 Standard_EXPORT virtual Standard_Boolean IsConstant (Standard_Real& Error) const;
142 //! Return a copy of the constant Section, if me
144 Standard_EXPORT virtual Handle(Geom_Curve) ConstantSection() const;
146 //! Returns True if all section are circle, with same
147 //! plane,same center and linear radius evolution
148 //! Return False by Default.
149 Standard_EXPORT virtual Standard_Boolean IsConicalLaw (Standard_Real& Error) const;
151 //! Return the circle section at parameter <Param>, if
152 //! <me> a IsConicalLaw
153 Standard_EXPORT virtual Handle(Geom_Curve) CirclSection (const Standard_Real Param) const;
158 DEFINE_STANDARD_RTTIEXT(GeomFill_SectionLaw,Standard_Transient)
178 #endif // _GeomFill_SectionLaw_HeaderFile