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