1 // Created on: 1993-03-09
3 // Copyright (c) 1993-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 _Geom_BSplineSurface_HeaderFile
18 #define _Geom_BSplineSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Precision.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <GeomAbs_BSplKnotDistribution.hxx>
26 #include <GeomAbs_Shape.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TColgp_HArray2OfPnt.hxx>
29 #include <TColStd_HArray2OfReal.hxx>
30 #include <TColStd_HArray1OfReal.hxx>
31 #include <TColStd_HArray1OfInteger.hxx>
32 #include <Standard_Real.hxx>
33 #include <Geom_BoundedSurface.hxx>
34 #include <TColgp_Array2OfPnt.hxx>
35 #include <TColStd_Array1OfReal.hxx>
36 #include <TColStd_Array1OfInteger.hxx>
37 #include <TColStd_Array2OfReal.hxx>
38 #include <TColgp_Array1OfPnt.hxx>
46 class Geom_BSplineSurface;
47 DEFINE_STANDARD_HANDLE(Geom_BSplineSurface, Geom_BoundedSurface)
49 //! Describes a BSpline surface.
50 //! In each parametric direction, a BSpline surface can be:
51 //! - uniform or non-uniform,
52 //! - rational or non-rational,
53 //! - periodic or non-periodic.
54 //! A BSpline surface is defined by:
55 //! - its degrees, in the u and v parametric directions,
56 //! - its periodic characteristic, in the u and v parametric directions,
57 //! - a table of poles, also called control points (together
58 //! with the associated weights if the surface is rational), and
59 //! - a table of knots, together with the associated multiplicities.
60 //! The degree of a Geom_BSplineSurface is limited to
61 //! a value (25) which is defined and controlled by the
62 //! system. This value is returned by the function MaxDegree.
64 //! Poles and Weights are manipulated using two associative double arrays:
65 //! - the poles table, which is a double array of gp_Pnt points, and
66 //! - the weights table, which is a double array of reals.
67 //! The bounds of the poles and weights arrays are:
68 //! - 1 and NbUPoles for the row bounds (provided
69 //! that the BSpline surface is not periodic in the u
70 //! parametric direction), where NbUPoles is the
71 //! number of poles of the surface in the u parametric direction, and
72 //! - 1 and NbVPoles for the column bounds (provided
73 //! that the BSpline surface is not periodic in the v
74 //! parametric direction), where NbVPoles is the
75 //! number of poles of the surface in the v parametric direction.
76 //! The poles of the surface are the points used to shape
77 //! and reshape the surface. They comprise a rectangular network.
78 //! If the surface is not periodic:
79 //! - The points (1, 1), (NbUPoles, 1), (1,
80 //! NbVPoles), and (NbUPoles, NbVPoles)
81 //! are the four parametric "corners" of the surface.
82 //! - The first column of poles and the last column of
83 //! poles define two BSpline curves which delimit the
84 //! surface in the v parametric direction. These are the
85 //! v isoparametric curves corresponding to the two
86 //! bounds of the v parameter.
87 //! - The first row of poles and the last row of poles
88 //! define two BSpline curves which delimit the surface
89 //! in the u parametric direction. These are the u
90 //! isoparametric curves corresponding to the two bounds of the u parameter.
91 //! If the surface is periodic, these geometric properties are not verified.
92 //! It is more difficult to define a geometrical significance
93 //! for the weights. However they are useful for
94 //! representing a quadric surface precisely. Moreover, if
95 //! the weights of all the poles are equal, the surface has
96 //! a polynomial equation, and hence is a "non-rational surface".
97 //! The non-rational surface is a special, but frequently
98 //! used, case, where all poles have identical weights.
99 //! The weights are defined and used only in the case of
100 //! a rational surface. The rational characteristic is
101 //! defined in each parametric direction. A surface can be
102 //! rational in the u parametric direction, and
103 //! non-rational in the v parametric direction.
104 //! Knots and Multiplicities
105 //! For a Geom_BSplineSurface the table of knots is
106 //! made up of two increasing sequences of reals, without
107 //! repetition, one for each parametric direction. The
108 //! multiplicities define the repetition of the knots.
109 //! A BSpline surface comprises multiple contiguous
110 //! patches, which are themselves polynomial or rational
111 //! surfaces. The knots are the parameters of the
112 //! isoparametric curves which limit these contiguous
113 //! patches. The multiplicity of a knot on a BSpline
114 //! surface (in a given parametric direction) is related to
115 //! the degree of continuity of the surface at that knot in
116 //! that parametric direction:
117 //! Degree of continuity at knot(i) = Degree - Multi(i) where:
118 //! - Degree is the degree of the BSpline surface in
119 //! the given parametric direction, and
120 //! - Multi(i) is the multiplicity of knot number i in
121 //! the given parametric direction.
122 //! There are some special cases, where the knots are
123 //! regularly spaced in one parametric direction (i.e. the
124 //! difference between two consecutive knots is a constant).
125 //! - "Uniform": all the multiplicities are equal to 1.
126 //! - "Quasi-uniform": all the multiplicities are equal to 1,
127 //! except for the first and last knots in this parametric
128 //! direction, and these are equal to Degree + 1.
129 //! - "Piecewise Bezier": all the multiplicities are equal to
130 //! Degree except for the first and last knots, which
131 //! are equal to Degree + 1. This surface is a
132 //! concatenation of Bezier patches in the given
133 //! parametric direction.
134 //! If the BSpline surface is not periodic in a given
135 //! parametric direction, the bounds of the knots and
136 //! multiplicities tables are 1 and NbKnots, where
137 //! NbKnots is the number of knots of the BSpline
138 //! surface in that parametric direction.
139 //! If the BSpline surface is periodic in a given parametric
140 //! direction, and there are k periodic knots and p
141 //! periodic poles in that parametric direction:
142 //! - the period is such that:
143 //! period = Knot(k+1) - Knot(1), and
144 //! - the poles and knots tables in that parametric
145 //! direction can be considered as infinite tables, such that:
146 //! Knot(i+k) = Knot(i) + period, and
147 //! Pole(i+p) = Pole(i)
148 //! Note: The data structure tables for a periodic BSpline
149 //! surface are more complex than those of a non-periodic one.
151 //! . A survey of curve and surface methods in CADG Wolfgang BOHM
153 //! . On de Boor-like algorithms and blossoming Wolfgang BOEHM
155 //! . Blossoming and knot insertion algorithms for B-spline curves
156 //! Ronald N. GOLDMAN
157 //! . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA
158 //! . Curves and Surfaces for Computer Aided Geometric Design,
159 //! a practical guide Gerald Farin
160 class Geom_BSplineSurface : public Geom_BoundedSurface
166 //! Creates a non-rational b-spline surface (weights
167 //! default value is 1.).
168 //! The following conditions must be verified.
169 //! 0 < UDegree <= MaxDegree.
170 //! UKnots.Length() == UMults.Length() >= 2
171 //! UKnots(i) < UKnots(i+1) (Knots are increasing)
172 //! 1 <= UMults(i) <= UDegree
173 //! On a non uperiodic surface the first and last
174 //! umultiplicities may be UDegree+1 (this is even
175 //! recommended if you want the curve to start and finish on
176 //! the first and last pole).
177 //! On a uperiodic surface the first and the last
178 //! umultiplicities must be the same.
179 //! on non-uperiodic surfaces
180 //! Poles.ColLength() == Sum(UMults(i)) - UDegree - 1 >= 2
181 //! on uperiodic surfaces
182 //! Poles.ColLength() == Sum(UMults(i)) except the first or last
183 //! The previous conditions for U holds also for V, with the
184 //! RowLength of the poles.
185 Standard_EXPORT Geom_BSplineSurface(const TColgp_Array2OfPnt& Poles, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean UPeriodic = Standard_False, const Standard_Boolean VPeriodic = Standard_False);
187 //! Creates a non-rational b-spline surface (weights
188 //! default value is 1.).
190 //! The following conditions must be verified.
191 //! 0 < UDegree <= MaxDegree.
193 //! UKnots.Length() == UMults.Length() >= 2
195 //! UKnots(i) < UKnots(i+1) (Knots are increasing)
196 //! 1 <= UMults(i) <= UDegree
198 //! On a non uperiodic surface the first and last
199 //! umultiplicities may be UDegree+1 (this is even
200 //! recommended if you want the curve to start and finish on
201 //! the first and last pole).
203 //! On a uperiodic surface the first and the last
204 //! umultiplicities must be the same.
206 //! on non-uperiodic surfaces
208 //! Poles.ColLength() == Sum(UMults(i)) - UDegree - 1 >= 2
210 //! on uperiodic surfaces
212 //! Poles.ColLength() == Sum(UMults(i)) except the first or
215 //! The previous conditions for U holds also for V, with the
216 //! RowLength of the poles.
217 Standard_EXPORT Geom_BSplineSurface(const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean UPeriodic = Standard_False, const Standard_Boolean VPeriodic = Standard_False);
219 //! Exchanges the u and v parametric directions on
220 //! this BSpline surface.
221 //! As a consequence:
222 //! - the poles and weights tables are transposed,
223 //! - the knots and multiplicities tables are exchanged,
224 //! - degrees of continuity, and rational, periodic and
225 //! uniform characteristics are exchanged, and
226 //! - the orientation of the surface is inverted.
227 Standard_EXPORT void ExchangeUV();
229 //! Sets the surface U periodic.
230 //! Modifies this surface to be periodic in the U
231 //! parametric direction.
232 //! To become periodic in a given parametric direction a
233 //! surface must be closed in that parametric direction,
234 //! and the knot sequence relative to that direction must be periodic.
235 //! To generate this periodic sequence of knots, the
236 //! functions FirstUKnotIndex and LastUKnotIndex are used to
237 //! compute I1 and I2. These are the indexes, in the
238 //! knot array associated with the given parametric
239 //! direction, of the knots that correspond to the first and
240 //! last parameters of this BSpline surface in the given
241 //! parametric direction. Hence the period is:
242 //! Knots(I1) - Knots(I2)
243 //! As a result, the knots and poles tables are modified.
245 //! Standard_ConstructionError if the surface is not
246 //! closed in the given parametric direction.
247 Standard_EXPORT void SetUPeriodic();
249 //! Sets the surface V periodic.
250 //! Modifies this surface to be periodic in the V
251 //! parametric direction.
252 //! To become periodic in a given parametric direction a
253 //! surface must be closed in that parametric direction,
254 //! and the knot sequence relative to that direction must be periodic.
255 //! To generate this periodic sequence of knots, the
256 //! functions FirstVKnotIndex and LastVKnotIndex are used to
257 //! compute I1 and I2. These are the indexes, in the
258 //! knot array associated with the given parametric
259 //! direction, of the knots that correspond to the first and
260 //! last parameters of this BSpline surface in the given
261 //! parametric direction. Hence the period is:
262 //! Knots(I1) - Knots(I2)
263 //! As a result, the knots and poles tables are modified.
265 //! Standard_ConstructionError if the surface is not
266 //! closed in the given parametric direction.
267 Standard_EXPORT void SetVPeriodic();
269 //! returns the parameter normalized within
270 //! the period if the surface is periodic : otherwise
271 //! does not do anything
272 Standard_EXPORT void PeriodicNormalization (Standard_Real& U, Standard_Real& V) const;
274 //! Assigns the knot of index Index in the knots table in
275 //! the corresponding parametric direction to be the
276 //! origin of this periodic BSpline surface. As a
277 //! consequence, the knots and poles tables are modified.
279 //! Standard_NoSuchObject if this BSpline surface is
280 //! not periodic in the given parametric direction.
281 //! Standard_DomainError if Index is outside the
282 //! bounds of the knots table in the given parametric direction.
283 Standard_EXPORT void SetUOrigin (const Standard_Integer Index);
285 //! Assigns the knot of index Index in the knots table in
286 //! the corresponding parametric direction to be the
287 //! origin of this periodic BSpline surface. As a
288 //! consequence, the knots and poles tables are modified.
290 //! Standard_NoSuchObject if this BSpline surface is
291 //! not periodic in the given parametric direction.
292 //! Standard_DomainError if Index is outside the
293 //! bounds of the knots table in the given parametric direction.
294 Standard_EXPORT void SetVOrigin (const Standard_Integer Index);
296 //! Sets the surface U not periodic.
297 //! Changes this BSpline surface into a non-periodic
298 //! surface along U direction.
299 //! If this surface is already non-periodic, it is not modified.
300 //! Note: the poles and knots tables are modified.
301 Standard_EXPORT void SetUNotPeriodic();
303 //! Sets the surface V not periodic.
304 //! Changes this BSpline surface into a non-periodic
305 //! surface along V direction.
306 //! If this surface is already non-periodic, it is not modified.
307 //! Note: the poles and knots tables are modified.
308 Standard_EXPORT void SetVNotPeriodic();
310 //! Changes the orientation of this BSpline surface in the
311 //! U parametric direction. The bounds of the
312 //! surface are not changed but the given parametric
313 //! direction is reversed. Hence the orientation of the
314 //! surface is reversed.
315 //! The knots and poles tables are modified.
316 Standard_EXPORT void UReverse() Standard_OVERRIDE;
318 //! Changes the orientation of this BSpline surface in the
319 //! V parametric direction. The bounds of the
320 //! surface are not changed but the given parametric
321 //! direction is reversed. Hence the orientation of the
322 //! surface is reversed.
323 //! The knots and poles tables are modified.
324 Standard_EXPORT void VReverse() Standard_OVERRIDE;
326 //! Computes the u parameter on the modified
327 //! surface, produced by reversing its U parametric
328 //! direction, for the point of u parameter U, on this BSpline surface.
329 //! For a BSpline surface, these functions return respectively:
330 //! - UFirst + ULast - U,
331 //! where UFirst, ULast are
332 //! the values of the first and last parameters of this
333 //! BSpline surface, in the u parametric directions.
334 Standard_EXPORT Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
336 //! Computes the v parameter on the modified
337 //! surface, produced by reversing its V parametric
338 //! direction, for the point of v parameter V on this BSpline surface.
339 //! For a BSpline surface, these functions return respectively:
340 //! - VFirst + VLast - V,
341 //! VFirst and VLast are
342 //! the values of the first and last parameters of this
343 //! BSpline surface, in the v pametric directions.
344 Standard_EXPORT Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE;
346 //! Increases the degrees of this BSpline surface to
347 //! UDegree and VDegree in the u and v parametric
348 //! directions respectively. As a result, the tables of poles,
349 //! weights and multiplicities are modified. The tables of
350 //! knots is not changed.
351 //! Note: Nothing is done if the given degree is less than
352 //! or equal to the current degree in the corresponding
353 //! parametric direction.
355 //! Standard_ConstructionError if UDegree or
356 //! VDegree is greater than
357 //! Geom_BSplineSurface::MaxDegree().
358 Standard_EXPORT void IncreaseDegree (const Standard_Integer UDegree, const Standard_Integer VDegree);
360 //! Inserts into the knots table for the U
361 //! parametric direction of this BSpline surface:
362 //! - the values of the array Knots, with their respective
363 //! multiplicities, Mults.
364 //! If the knot value to insert already exists in the table, its multiplicity is:
365 //! - increased by M, if Add is true (the default), or
366 //! - increased to M, if Add is false.
367 //! The tolerance criterion used to check the equality of
368 //! the knots is the larger of the values ParametricTolerance and
369 //! Standard_Real::Epsilon(val), where val is the knot value to be inserted.
371 //! - If a given multiplicity coefficient is null, or negative, nothing is done.
372 //! - The new multiplicity of a knot is limited to the degree of this BSpline surface in the
373 //! corresponding parametric direction.
375 //! Standard_ConstructionError if a knot value to
376 //! insert is outside the bounds of this BSpline surface in
377 //! the specified parametric direction. The comparison
378 //! uses the precision criterion ParametricTolerance.
379 Standard_EXPORT void InsertUKnots (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Real ParametricTolerance = 0.0, const Standard_Boolean Add = Standard_True);
381 //! Inserts into the knots table for the V
382 //! parametric direction of this BSpline surface:
383 //! - the values of the array Knots, with their respective
384 //! multiplicities, Mults.
385 //! If the knot value to insert already exists in the table, its multiplicity is:
386 //! - increased by M, if Add is true (the default), or
387 //! - increased to M, if Add is false.
388 //! The tolerance criterion used to check the equality of
389 //! the knots is the larger of the values ParametricTolerance and
390 //! Standard_Real::Epsilon(val), where val is the knot value to be inserted.
392 //! - If a given multiplicity coefficient is null, or negative, nothing is done.
393 //! - The new multiplicity of a knot is limited to the degree of this BSpline surface in the
394 //! corresponding parametric direction.
396 //! Standard_ConstructionError if a knot value to
397 //! insert is outside the bounds of this BSpline surface in
398 //! the specified parametric direction. The comparison
399 //! uses the precision criterion ParametricTolerance.
400 Standard_EXPORT void InsertVKnots (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Real ParametricTolerance = 0.0, const Standard_Boolean Add = Standard_True);
402 //! Reduces to M the multiplicity of the knot of index
403 //! Index in the U parametric direction. If M is 0, the knot is removed.
404 //! With a modification of this type, the table of poles is also modified.
405 //! Two different algorithms are used systematically to
406 //! compute the new poles of the surface. For each
407 //! pole, the distance between the pole calculated
408 //! using the first algorithm and the same pole
409 //! calculated using the second algorithm, is checked. If
410 //! this distance is less than Tolerance it ensures that
411 //! the surface is not modified by more than Tolerance.
412 //! Under these conditions, the function returns true;
413 //! otherwise, it returns false.
414 //! A low tolerance prevents modification of the
415 //! surface. A high tolerance "smoothes" the surface.
417 //! Standard_OutOfRange if Index is outside the
418 //! bounds of the knots table of this BSpline surface.
419 Standard_EXPORT Standard_Boolean RemoveUKnot (const Standard_Integer Index, const Standard_Integer M, const Standard_Real Tolerance);
421 //! Reduces to M the multiplicity of the knot of index
422 //! Index in the V parametric direction. If M is 0, the knot is removed.
423 //! With a modification of this type, the table of poles is also modified.
424 //! Two different algorithms are used systematically to
425 //! compute the new poles of the surface. For each
426 //! pole, the distance between the pole calculated
427 //! using the first algorithm and the same pole
428 //! calculated using the second algorithm, is checked. If
429 //! this distance is less than Tolerance it ensures that
430 //! the surface is not modified by more than Tolerance.
431 //! Under these conditions, the function returns true;
432 //! otherwise, it returns false.
433 //! A low tolerance prevents modification of the
434 //! surface. A high tolerance "smoothes" the surface.
436 //! Standard_OutOfRange if Index is outside the
437 //! bounds of the knots table of this BSpline surface.
438 Standard_EXPORT Standard_Boolean RemoveVKnot (const Standard_Integer Index, const Standard_Integer M, const Standard_Real Tolerance);
441 //! Increases the multiplicity of the knot of range UIndex
442 //! in the UKnots sequence.
443 //! M is the new multiplicity. M must be greater than the
444 //! previous multiplicity and lower or equal to the degree
445 //! of the surface in the U parametric direction.
446 //! Raised if M is not in the range [1, UDegree]
448 //! Raised if UIndex is not in the range [FirstUKnotIndex,
449 //! LastUKnotIndex] given by the methods with the same name.
450 Standard_EXPORT void IncreaseUMultiplicity (const Standard_Integer UIndex, const Standard_Integer M);
453 //! Increases until order M the multiplicity of the set of knots
454 //! FromI1,...., ToI2 in the U direction. This method can be used
455 //! to make a B_spline surface into a PiecewiseBezier B_spline
457 //! If <me> was uniform, it can become non uniform.
459 //! Raised if FromI1 or ToI2 is out of the range [FirstUKnotIndex,
462 //! M should be greater than the previous multiplicity of the
463 //! all the knots FromI1,..., ToI2 and lower or equal to the
464 //! Degree of the surface in the U parametric direction.
465 Standard_EXPORT void IncreaseUMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer M);
468 //! Increments the multiplicity of the consecutives uknots FromI1..ToI2
469 //! by step. The multiplicity of each knot FromI1,.....,ToI2 must be
470 //! lower or equal to the UDegree of the B_spline.
472 //! Raised if FromI1 or ToI2 is not in the range
473 //! [FirstUKnotIndex, LastUKnotIndex]
475 //! Raised if one knot has a multiplicity greater than UDegree.
476 Standard_EXPORT void IncrementUMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer Step);
479 //! Increases the multiplicity of a knot in the V direction.
480 //! M is the new multiplicity.
482 //! M should be greater than the previous multiplicity and lower
483 //! than the degree of the surface in the V parametric direction.
485 //! Raised if VIndex is not in the range [FirstVKnotIndex,
486 //! LastVKnotIndex] given by the methods with the same name.
487 Standard_EXPORT void IncreaseVMultiplicity (const Standard_Integer VIndex, const Standard_Integer M);
490 //! Increases until order M the multiplicity of the set of knots
491 //! FromI1,...., ToI2 in the V direction. This method can be used to
492 //! make a BSplineSurface into a PiecewiseBezier B_spline
493 //! surface. If <me> was uniform, it can become non-uniform.
495 //! Raised if FromI1 or ToI2 is out of the range [FirstVKnotIndex,
496 //! LastVKnotIndex] given by the methods with the same name.
498 //! M should be greater than the previous multiplicity of the
499 //! all the knots FromI1,..., ToI2 and lower or equal to the
500 //! Degree of the surface in the V parametric direction.
501 Standard_EXPORT void IncreaseVMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer M);
504 //! Increments the multiplicity of the consecutives vknots FromI1..ToI2
505 //! by step. The multiplicity of each knot FromI1,.....,ToI2 must be
506 //! lower or equal to the VDegree of the B_spline.
508 //! Raised if FromI1 or ToI2 is not in the range
509 //! [FirstVKnotIndex, LastVKnotIndex]
511 //! Raised if one knot has a multiplicity greater than VDegree.
512 Standard_EXPORT void IncrementVMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer Step);
515 //! Inserts a knot value in the sequence of UKnots. If U is a knot
516 //! value this method increases the multiplicity of the knot if the
517 //! previous multiplicity was lower than M else it does nothing. The
518 //! tolerance criterion is ParametricTolerance. ParametricTolerance
519 //! should be greater or equal than Resolution from package gp.
521 //! Raised if U is out of the bounds [U1, U2] given by the methods
522 //! Bounds, the criterion ParametricTolerance is used.
523 //! Raised if M is not in the range [1, UDegree].
524 Standard_EXPORT void InsertUKnot (const Standard_Real U, const Standard_Integer M, const Standard_Real ParametricTolerance, const Standard_Boolean Add = Standard_True);
527 //! Inserts a knot value in the sequence of VKnots. If V is a knot
528 //! value this method increases the multiplicity of the knot if the
529 //! previous multiplicity was lower than M otherwise it does nothing.
530 //! The tolerance criterion is ParametricTolerance.
531 //! ParametricTolerance should be greater or equal than Resolution
534 //! raises if V is out of the Bounds [V1, V2] given by the methods
535 //! Bounds, the criterion ParametricTolerance is used.
536 //! raises if M is not in the range [1, VDegree].
537 Standard_EXPORT void InsertVKnot (const Standard_Real V, const Standard_Integer M, const Standard_Real ParametricTolerance, const Standard_Boolean Add = Standard_True);
540 //! Segments the surface between U1 and U2 in the U-Direction.
541 //! between V1 and V2 in the V-Direction.
542 //! The control points are modified, the first and the last point
543 //! are not the same.
545 //! Parameters theUTolerance, theVTolerance define the possible proximity along the corresponding
546 //! direction of the segment boundaries and B-spline knots to treat them as equal.
549 //! Even if <me> is not closed it can become closed after the
550 //! segmentation for example if U1 or U2 are out of the bounds
551 //! of the surface <me> or if the surface makes loop.
552 //! raises if U2 < U1 or V2 < V1.
553 //! Standard_DomainError if U2 - U1 exceeds the uperiod for uperiodic surfaces.
554 //! i.e. ((U2 - U1) - UPeriod) > Precision::PConfusion().
555 //! Standard_DomainError if V2 - V1 exceeds the vperiod for vperiodic surfaces.
556 //! i.e. ((V2 - V1) - VPeriod) > Precision::PConfusion()).
557 Standard_EXPORT void Segment (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2,
558 const Standard_Real theUTolerance = Precision::PConfusion(),
559 const Standard_Real theVTolerance = Precision::PConfusion());
562 //! Segments the surface between U1 and U2 in the U-Direction.
563 //! between V1 and V2 in the V-Direction.
565 //! same as Segment but do nothing if U1 and U2 (resp. V1 and V2) are
566 //! equal to the bounds in U (resp. in V) of <me>.
567 //! For example, if <me> is periodic in V, it will be always periodic
568 //! in V after the segmentation if the bounds in V are unchanged
570 //! Parameters theUTolerance, theVTolerance define the possible proximity along the corresponding
571 //! direction of the segment boundaries and B-spline knots to treat them as equal.
574 //! Even if <me> is not closed it can become closed after the
575 //! segmentation for example if U1 or U2 are out of the bounds
576 //! of the surface <me> or if the surface makes loop.
577 //! raises if U2 < U1 or V2 < V1.
578 //! Standard_DomainError if U2 - U1 exceeds the uperiod for uperiodic surfaces.
579 //! i.e. ((U2 - U1) - UPeriod) > Precision::PConfusion().
580 //! Standard_DomainError if V2 - V1 exceeds the vperiod for vperiodic surfaces.
581 //! i.e. ((V2 - V1) - VPeriod) > Precision::PConfusion()).
582 Standard_EXPORT void CheckAndSegment (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2,
583 const Standard_Real theUTolerance = Precision::PConfusion(),
584 const Standard_Real theVTolerance = Precision::PConfusion());
586 //! Substitutes the UKnots of range UIndex with K.
588 //! Raised if UIndex < 1 or UIndex > NbUKnots
590 //! Raised if K >= UKnots(UIndex+1) or K <= UKnots(UIndex-1)
591 Standard_EXPORT void SetUKnot (const Standard_Integer UIndex, const Standard_Real K);
593 //! Changes all the U-knots of the surface.
594 //! The multiplicity of the knots are not modified.
596 //! Raised if there is an index such that UK (Index+1) <= UK (Index).
598 //! Raised if UK.Lower() < 1 or UK.Upper() > NbUKnots
599 Standard_EXPORT void SetUKnots (const TColStd_Array1OfReal& UK);
602 //! Changes the value of the UKnots of range UIndex and
603 //! increases its multiplicity.
605 //! Raised if UIndex is not in the range [FirstUKnotIndex,
606 //! LastUKnotIndex] given by the methods with the same name.
608 //! Raised if K >= UKnots(UIndex+1) or K <= UKnots(UIndex-1)
609 //! M must be lower than UDegree and greater than the previous
610 //! multiplicity of the knot of range UIndex.
611 Standard_EXPORT void SetUKnot (const Standard_Integer UIndex, const Standard_Real K, const Standard_Integer M);
613 //! Substitutes the VKnots of range VIndex with K.
615 //! Raised if VIndex < 1 or VIndex > NbVKnots
617 //! Raised if K >= VKnots(VIndex+1) or K <= VKnots(VIndex-1)
618 Standard_EXPORT void SetVKnot (const Standard_Integer VIndex, const Standard_Real K);
620 //! Changes all the V-knots of the surface.
621 //! The multiplicity of the knots are not modified.
623 //! Raised if there is an index such that VK (Index+1) <= VK (Index).
625 //! Raised if VK.Lower() < 1 or VK.Upper() > NbVKnots
626 Standard_EXPORT void SetVKnots (const TColStd_Array1OfReal& VK);
629 //! Changes the value of the VKnots of range VIndex and increases
630 //! its multiplicity.
632 //! Raised if VIndex is not in the range [FirstVKnotIndex,
633 //! LastVKnotIndex] given by the methods with the same name.
635 //! Raised if K >= VKnots(VIndex+1) or K <= VKnots(VIndex-1)
636 //! M must be lower than VDegree and greater than the previous
637 //! multiplicity of the knot of range VIndex.
638 Standard_EXPORT void SetVKnot (const Standard_Integer VIndex, const Standard_Real K, const Standard_Integer M);
641 //! Locates the parametric value U in the sequence of UKnots.
642 //! If "WithKnotRepetition" is True we consider the knot's
643 //! representation with repetition of multiple knot value,
644 //! otherwise we consider the knot's representation with
645 //! no repetition of multiple knot values.
646 //! UKnots (I1) <= U <= UKnots (I2)
647 //! . if I1 = I2 U is a knot value (the tolerance criterion
648 //! ParametricTolerance is used).
649 //! . if I1 < 1 => U < UKnots(1) - Abs(ParametricTolerance)
650 //! . if I2 > NbUKnots => U > UKnots(NbUKnots)+Abs(ParametricTolerance)
651 Standard_EXPORT void LocateU (const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, Standard_Integer& I2, const Standard_Boolean WithKnotRepetition = Standard_False) const;
654 //! Locates the parametric value V in the sequence of knots.
655 //! If "WithKnotRepetition" is True we consider the knot's
656 //! representation with repetition of multiple knot value,
657 //! otherwise we consider the knot's representation with
658 //! no repetition of multiple knot values.
659 //! VKnots (I1) <= V <= VKnots (I2)
660 //! . if I1 = I2 V is a knot value (the tolerance criterion
661 //! ParametricTolerance is used).
662 //! . if I1 < 1 => V < VKnots(1) - Abs(ParametricTolerance)
663 //! . if I2 > NbVKnots => V > VKnots(NbVKnots)+Abs(ParametricTolerance)
664 //! poles insertion and removing
665 //! The following methods are available only if the surface
666 //! is Uniform or QuasiUniform in the considered direction
667 //! The knot repartition is modified.
668 Standard_EXPORT void LocateV (const Standard_Real V, const Standard_Real ParametricTolerance, Standard_Integer& I1, Standard_Integer& I2, const Standard_Boolean WithKnotRepetition = Standard_False) const;
671 //! Substitutes the pole of range (UIndex, VIndex) with P.
672 //! If the surface is rational the weight of range (UIndex, VIndex)
675 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
676 //! VIndex > NbVPoles.
677 Standard_EXPORT void SetPole (const Standard_Integer UIndex, const Standard_Integer VIndex, const gp_Pnt& P);
680 //! Substitutes the pole and the weight of range (UIndex, VIndex)
683 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
684 //! VIndex > NbVPoles.
685 //! Raised if Weight <= Resolution from package gp.
686 Standard_EXPORT void SetPole (const Standard_Integer UIndex, const Standard_Integer VIndex, const gp_Pnt& P, const Standard_Real Weight);
689 //! Changes a column of poles or a part of this column.
690 //! Raised if Vindex < 1 or VIndex > NbVPoles.
692 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbUPoles.
693 Standard_EXPORT void SetPoleCol (const Standard_Integer VIndex, const TColgp_Array1OfPnt& CPoles);
696 //! Changes a column of poles or a part of this column with the
697 //! corresponding weights. If the surface was rational it can
698 //! become non rational. If the surface was non rational it can
700 //! Raised if Vindex < 1 or VIndex > NbVPoles.
702 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbUPoles
703 //! Raised if the bounds of CPoleWeights are not the same as the
704 //! bounds of CPoles.
705 //! Raised if one of the weight value of CPoleWeights is lower or
706 //! equal to Resolution from package gp.
707 Standard_EXPORT void SetPoleCol (const Standard_Integer VIndex, const TColgp_Array1OfPnt& CPoles, const TColStd_Array1OfReal& CPoleWeights);
710 //! Changes a row of poles or a part of this row with the
711 //! corresponding weights. If the surface was rational it can
712 //! become non rational. If the surface was non rational it can
714 //! Raised if Uindex < 1 or UIndex > NbUPoles.
716 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbVPoles
717 //! raises if the bounds of CPoleWeights are not the same as the
718 //! bounds of CPoles.
719 //! Raised if one of the weight value of CPoleWeights is lower or
720 //! equal to Resolution from package gp.
721 Standard_EXPORT void SetPoleRow (const Standard_Integer UIndex, const TColgp_Array1OfPnt& CPoles, const TColStd_Array1OfReal& CPoleWeights);
724 //! Changes a row of poles or a part of this row.
725 //! Raised if Uindex < 1 or UIndex > NbUPoles.
727 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbVPoles.
728 Standard_EXPORT void SetPoleRow (const Standard_Integer UIndex, const TColgp_Array1OfPnt& CPoles);
731 //! Changes the weight of the pole of range UIndex, VIndex.
732 //! If the surface was non rational it can become rational.
733 //! If the surface was rational it can become non rational.
735 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
736 //! VIndex > NbVPoles
738 //! Raised if weight is lower or equal to Resolution from
740 Standard_EXPORT void SetWeight (const Standard_Integer UIndex, const Standard_Integer VIndex, const Standard_Real Weight);
743 //! Changes a column of weights of a part of this column.
745 //! Raised if VIndex < 1 or VIndex > NbVPoles
747 //! Raised if CPoleWeights.Lower() < 1 or
748 //! CPoleWeights.Upper() > NbUPoles.
749 //! Raised if a weight value is lower or equal to Resolution
751 Standard_EXPORT void SetWeightCol (const Standard_Integer VIndex, const TColStd_Array1OfReal& CPoleWeights);
754 //! Changes a row of weights or a part of this row.
756 //! Raised if UIndex < 1 or UIndex > NbUPoles
758 //! Raised if CPoleWeights.Lower() < 1 or
759 //! CPoleWeights.Upper() > NbVPoles.
760 //! Raised if a weight value is lower or equal to Resolution
762 Standard_EXPORT void SetWeightRow (const Standard_Integer UIndex, const TColStd_Array1OfReal& CPoleWeights);
764 //! Move a point with parameter U and V to P.
765 //! given u,v as parameters) to reach a new position
766 //! UIndex1, UIndex2, VIndex1, VIndex2:
767 //! indicates the poles which can be moved
768 //! if Problem in BSplineBasis calculation, no change
769 //! for the curve and
770 //! UFirstIndex, VLastIndex = 0
771 //! VFirstIndex, VLastIndex = 0
773 //! Raised if UIndex1 < UIndex2 or VIndex1 < VIndex2 or
774 //! UIndex1 < 1 || UIndex1 > NbUPoles or
775 //! UIndex2 < 1 || UIndex2 > NbUPoles
776 //! VIndex1 < 1 || VIndex1 > NbVPoles or
777 //! VIndex2 < 1 || VIndex2 > NbVPoles
778 //! characteristics of the surface
779 Standard_EXPORT void MovePoint (const Standard_Real U, const Standard_Real V, const gp_Pnt& P, const Standard_Integer UIndex1, const Standard_Integer UIndex2, const Standard_Integer VIndex1, const Standard_Integer VIndex2, Standard_Integer& UFirstIndex, Standard_Integer& ULastIndex, Standard_Integer& VFirstIndex, Standard_Integer& VLastIndex);
782 //! Returns true if the first control points row and the last
783 //! control points row are identical. The tolerance criterion
784 //! is Resolution from package gp.
785 Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
788 //! Returns true if the first control points column and the
789 //! last last control points column are identical.
790 //! The tolerance criterion is Resolution from package gp.
791 Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
794 //! Returns True if the order of continuity of the surface in the
795 //! U direction is N.
797 Standard_EXPORT Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE;
800 //! Returns True if the order of continuity of the surface
801 //! in the V direction is N.
803 Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
806 //! Returns True if the surface is closed in the U direction
807 //! and if the B-spline has been turned into a periodic surface
808 //! using the function SetUPeriodic.
809 Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
812 //! Returns False if for each row of weights all the weights
814 //! The tolerance criterion is resolution from package gp.
817 //! if Weights = |0.5, 0.5, 0.5| returns False
819 Standard_EXPORT Standard_Boolean IsURational() const;
822 //! Returns True if the surface is closed in the V direction
823 //! and if the B-spline has been turned into a periodic
824 //! surface using the function SetVPeriodic.
825 Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
828 //! Returns False if for each column of weights all the weights
830 //! The tolerance criterion is resolution from package gp.
833 //! if Weights = |1.0, 2.0, 0.5| returns False
835 Standard_EXPORT Standard_Boolean IsVRational() const;
838 //! Returns the parametric bounds of the surface.
840 //! These parametric values are the bounds of the array of
841 //! knots UKnots and VKnots only if the first knots and the
842 //! last knots have a multiplicity equal to UDegree + 1 or
844 Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE;
847 //! Returns the continuity of the surface :
848 //! C0 : only geometric continuity,
849 //! C1 : continuity of the first derivative all along the Surface,
850 //! C2 : continuity of the second derivative all along the Surface,
851 //! C3 : continuity of the third derivative all along the Surface,
852 //! CN : the order of continuity is infinite.
853 //! A B-spline surface is infinitely continuously differentiable
854 //! for the couple of parameters U, V such that U != UKnots(i)
855 //! and V != VKnots(i). The continuity of the surface at a knot
856 //! value depends on the multiplicity of this knot.
858 //! If the surface is C1 in the V direction and C2 in the U
859 //! direction this function returns Shape = C1.
860 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
863 //! Computes the Index of the UKnots which gives the first
864 //! parametric value of the surface in the U direction.
865 //! The UIso curve corresponding to this value is a
866 //! boundary curve of the surface.
867 Standard_EXPORT Standard_Integer FirstUKnotIndex() const;
870 //! Computes the Index of the VKnots which gives the
871 //! first parametric value of the surface in the V direction.
872 //! The VIso curve corresponding to this knot is a boundary
873 //! curve of the surface.
874 Standard_EXPORT Standard_Integer FirstVKnotIndex() const;
877 //! Computes the Index of the UKnots which gives the
878 //! last parametric value of the surface in the U direction.
879 //! The UIso curve corresponding to this knot is a boundary
880 //! curve of the surface.
881 Standard_EXPORT Standard_Integer LastUKnotIndex() const;
884 //! Computes the Index of the VKnots which gives the
885 //! last parametric value of the surface in the V direction.
886 //! The VIso curve corresponding to this knot is a
887 //! boundary curve of the surface.
888 Standard_EXPORT Standard_Integer LastVKnotIndex() const;
890 //! Returns the number of knots in the U direction.
891 Standard_EXPORT Standard_Integer NbUKnots() const;
893 //! Returns number of poles in the U direction.
894 Standard_EXPORT Standard_Integer NbUPoles() const;
896 //! Returns the number of knots in the V direction.
897 Standard_EXPORT Standard_Integer NbVKnots() const;
899 //! Returns the number of poles in the V direction.
900 Standard_EXPORT Standard_Integer NbVPoles() const;
903 //! Returns the pole of range (UIndex, VIndex).
905 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
906 //! VIndex > NbVPoles.
907 Standard_EXPORT const gp_Pnt& Pole(const Standard_Integer UIndex, const Standard_Integer VIndex) const;
909 //! Returns the poles of the B-spline surface.
911 //! Raised if the length of P in the U and V direction
912 //! is not equal to NbUpoles and NbVPoles.
913 Standard_EXPORT void Poles (TColgp_Array2OfPnt& P) const;
915 //! Returns the poles of the B-spline surface.
916 Standard_EXPORT const TColgp_Array2OfPnt& Poles() const;
919 //! Returns the degree of the normalized B-splines Ni,n in the U
921 Standard_EXPORT Standard_Integer UDegree() const;
924 //! Returns the Knot value of range UIndex.
925 //! Raised if UIndex < 1 or UIndex > NbUKnots
926 Standard_EXPORT Standard_Real UKnot (const Standard_Integer UIndex) const;
929 //! Returns NonUniform or Uniform or QuasiUniform or
930 //! PiecewiseBezier. If all the knots differ by a
931 //! positive constant from the preceding knot in the U
932 //! direction the B-spline surface can be :
933 //! - Uniform if all the knots are of multiplicity 1,
934 //! - QuasiUniform if all the knots are of multiplicity 1
935 //! except for the first and last knot which are of
936 //! multiplicity Degree + 1,
937 //! - PiecewiseBezier if the first and last knots have
938 //! multiplicity Degree + 1 and if interior knots have
939 //! multiplicity Degree
940 //! otherwise the surface is non uniform in the U direction
941 //! The tolerance criterion is Resolution from package gp.
942 Standard_EXPORT GeomAbs_BSplKnotDistribution UKnotDistribution() const;
944 //! Returns the knots in the U direction.
946 //! Raised if the length of Ku is not equal to the number of knots
947 //! in the U direction.
948 Standard_EXPORT void UKnots (TColStd_Array1OfReal& Ku) const;
950 //! Returns the knots in the U direction.
951 Standard_EXPORT const TColStd_Array1OfReal& UKnots() const;
953 //! Returns the uknots sequence.
954 //! In this sequence the knots with a multiplicity greater than 1
957 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
959 //! Raised if the length of Ku is not equal to NbUPoles + UDegree + 1
960 Standard_EXPORT void UKnotSequence (TColStd_Array1OfReal& Ku) const;
962 //! Returns the uknots sequence.
963 //! In this sequence the knots with a multiplicity greater than 1
966 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
967 Standard_EXPORT const TColStd_Array1OfReal& UKnotSequence() const;
970 //! Returns the multiplicity value of knot of range UIndex in
972 //! Raised if UIndex < 1 or UIndex > NbUKnots.
973 Standard_EXPORT Standard_Integer UMultiplicity (const Standard_Integer UIndex) const;
976 //! Returns the multiplicities of the knots in the U direction.
978 //! Raised if the length of Mu is not equal to the number of
979 //! knots in the U direction.
980 Standard_EXPORT void UMultiplicities (TColStd_Array1OfInteger& Mu) const;
982 //! Returns the multiplicities of the knots in the U direction.
983 Standard_EXPORT const TColStd_Array1OfInteger& UMultiplicities() const;
986 //! Returns the degree of the normalized B-splines Ni,d in the
988 Standard_EXPORT Standard_Integer VDegree() const;
990 //! Returns the Knot value of range VIndex.
991 //! Raised if VIndex < 1 or VIndex > NbVKnots
992 Standard_EXPORT Standard_Real VKnot (const Standard_Integer VIndex) const;
995 //! Returns NonUniform or Uniform or QuasiUniform or
996 //! PiecewiseBezier. If all the knots differ by a positive
997 //! constant from the preceding knot in the V direction the
998 //! B-spline surface can be :
999 //! - Uniform if all the knots are of multiplicity 1,
1000 //! - QuasiUniform if all the knots are of multiplicity 1
1001 //! except for the first and last knot which are of
1002 //! multiplicity Degree + 1,
1003 //! - PiecewiseBezier if the first and last knots have
1004 //! multiplicity Degree + 1 and if interior knots have
1005 //! multiplicity Degree
1006 //! otherwise the surface is non uniform in the V direction.
1007 //! The tolerance criterion is Resolution from package gp.
1008 Standard_EXPORT GeomAbs_BSplKnotDistribution VKnotDistribution() const;
1010 //! Returns the knots in the V direction.
1012 //! Raised if the length of Kv is not equal to the number of
1013 //! knots in the V direction.
1014 Standard_EXPORT void VKnots (TColStd_Array1OfReal& Kv) const;
1016 //! Returns the knots in the V direction.
1017 Standard_EXPORT const TColStd_Array1OfReal& VKnots() const;
1019 //! Returns the vknots sequence.
1020 //! In this sequence the knots with a multiplicity greater than 1
1023 //! Kv = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
1025 //! Raised if the length of Kv is not equal to NbVPoles + VDegree + 1
1026 Standard_EXPORT void VKnotSequence (TColStd_Array1OfReal& Kv) const;
1028 //! Returns the vknots sequence.
1029 //! In this sequence the knots with a multiplicity greater than 1
1032 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
1033 Standard_EXPORT const TColStd_Array1OfReal& VKnotSequence() const;
1036 //! Returns the multiplicity value of knot of range VIndex in
1037 //! the v direction.
1038 //! Raised if VIndex < 1 or VIndex > NbVKnots
1039 Standard_EXPORT Standard_Integer VMultiplicity (const Standard_Integer VIndex) const;
1042 //! Returns the multiplicities of the knots in the V direction.
1044 //! Raised if the length of Mv is not equal to the number of
1045 //! knots in the V direction.
1046 Standard_EXPORT void VMultiplicities (TColStd_Array1OfInteger& Mv) const;
1048 //! Returns the multiplicities of the knots in the V direction.
1049 Standard_EXPORT const TColStd_Array1OfInteger& VMultiplicities() const;
1051 //! Returns the weight value of range UIndex, VIndex.
1053 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1
1054 //! or VIndex > NbVPoles.
1055 Standard_EXPORT Standard_Real Weight (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
1057 //! Returns the weights of the B-spline surface.
1059 //! Raised if the length of W in the U and V direction is
1060 //! not equal to NbUPoles and NbVPoles.
1061 Standard_EXPORT void Weights (TColStd_Array2OfReal& W) const;
1063 //! Returns the weights of the B-spline surface.
1064 //! value and derivatives computation
1065 Standard_EXPORT const TColStd_Array2OfReal* Weights() const;
1067 Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
1069 //! Raised if the continuity of the surface is not C1.
1070 Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
1072 //! Raised if the continuity of the surface is not C2.
1073 Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
1075 //! Raised if the continuity of the surface is not C3.
1076 Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
1079 //! Nu is the order of derivation in the U parametric direction and
1080 //! Nv is the order of derivation in the V parametric direction.
1082 //! Raised if the continuity of the surface is not CNu in the U
1083 //! direction and CNv in the V direction.
1085 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
1087 //! The following functions computes the point for the
1088 //! parametric values (U, V) and the derivatives at
1089 //! this point on the B-spline surface patch delimited
1090 //! with the knots FromUK1, FromVK1 and the knots ToUK2,
1091 //! ToVK2. (U, V) can be out of these parametric bounds
1092 //! but for the computation we only use the definition
1093 //! of the surface between these knots. This method is
1094 //! useful to compute local derivative, if the order of
1095 //! continuity of the whole surface is not greater enough.
1096 //! Inside the parametric knot's domain previously defined
1097 //! the evaluations are the same as if we consider the whole
1098 //! definition of the surface. Of course the evaluations are
1099 //! different outside this parametric domain.
1100 Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE;
1102 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1103 Standard_EXPORT void LocalD0 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P) const;
1106 //! Raised if the local continuity of the surface is not C1
1107 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1108 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1109 Standard_EXPORT void LocalD1 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
1112 //! Raised if the local continuity of the surface is not C2
1113 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1114 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1115 Standard_EXPORT void LocalD2 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const;
1118 //! Raised if the local continuity of the surface is not C3
1119 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1120 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1121 Standard_EXPORT void LocalD3 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const;
1124 //! Raised if the local continuity of the surface is not CNu
1125 //! between the knots FromUK1, ToUK2 and CNv between the knots
1127 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1128 Standard_EXPORT gp_Vec LocalDN (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, const Standard_Integer Nu, const Standard_Integer Nv) const;
1131 //! Computes the point of parameter U, V on the BSpline surface patch
1132 //! defines between the knots UK1 UK2, VK1, VK2. U can be out of the
1133 //! bounds [Knot UK1, Knot UK2] and V can be outof the bounds
1134 //! [Knot VK1, Knot VK2] but for the computation we only use the
1135 //! definition of the surface between these knot values.
1136 //! Raises if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1137 Standard_EXPORT gp_Pnt LocalValue (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2) const;
1140 //! Computes the U isoparametric curve.
1141 //! A B-spline curve is returned.
1142 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
1145 //! Computes the V isoparametric curve.
1146 //! A B-spline curve is returned.
1147 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE;
1150 //! Computes the U isoparametric curve.
1151 //! If CheckRational=False, no try to make it non-rational.
1152 //! A B-spline curve is returned.
1153 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U, const Standard_Boolean CheckRational) const;
1156 //! Computes the V isoparametric curve.
1157 //! If CheckRational=False, no try to make it non-rational.
1158 //! A B-spline curve is returned.
1160 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V, const Standard_Boolean CheckRational) const;
1162 //! Applies the transformation T to this BSpline surface.
1163 Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
1166 //! Returns the value of the maximum degree of the normalized
1167 //! B-spline basis functions in the u and v directions.
1168 Standard_EXPORT static Standard_Integer MaxDegree();
1170 //! Computes two tolerance values for this BSpline
1171 //! surface, based on the given tolerance in 3D space
1172 //! Tolerance3D. The tolerances computed are:
1173 //! - UTolerance in the u parametric direction, and
1174 //! - VTolerance in the v parametric direction.
1175 //! If f(u,v) is the equation of this BSpline surface,
1176 //! UTolerance and VTolerance guarantee that :
1177 //! | u1 - u0 | < UTolerance and
1178 //! | v1 - v0 | < VTolerance
1179 //! ====> |f (u1,v1) - f (u0,v0)| < Tolerance3D
1180 Standard_EXPORT void Resolution (const Standard_Real Tolerance3D, Standard_Real& UTolerance, Standard_Real& VTolerance);
1182 //! Creates a new object which is a copy of this BSpline surface.
1183 Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
1185 //! Dumps the content of me into the stream
1186 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
1191 DEFINE_STANDARD_RTTIEXT(Geom_BSplineSurface,Geom_BoundedSurface)
1195 //! Segments the surface between U1 and U2 in the U-Direction.
1196 //! between V1 and V2 in the V-Direction.
1197 //! The control points are modified, the first and the last point
1198 //! are not the same.
1200 //! Parameters EpsU, EpsV define the proximity along U-Direction and V-Direction respectively.
1201 void segment(const Standard_Real U1, const Standard_Real U2,
1202 const Standard_Real V1, const Standard_Real V2,
1203 const Standard_Real EpsU, const Standard_Real EpsV,
1204 const Standard_Boolean SegmentInU, const Standard_Boolean SegmentInV);
1210 //! Recompute the flatknots, the knotsdistribution, the
1211 //! continuity for U.
1212 Standard_EXPORT void UpdateUKnots();
1214 //! Recompute the flatknots, the knotsdistribution, the
1215 //! continuity for V.
1216 Standard_EXPORT void UpdateVKnots();
1218 Standard_Boolean urational;
1219 Standard_Boolean vrational;
1220 Standard_Boolean uperiodic;
1221 Standard_Boolean vperiodic;
1222 GeomAbs_BSplKnotDistribution uknotSet;
1223 GeomAbs_BSplKnotDistribution vknotSet;
1224 GeomAbs_Shape Usmooth;
1225 GeomAbs_Shape Vsmooth;
1226 Standard_Integer udeg;
1227 Standard_Integer vdeg;
1228 Handle(TColgp_HArray2OfPnt) poles;
1229 Handle(TColStd_HArray2OfReal) weights;
1230 Handle(TColStd_HArray1OfReal) ufknots;
1231 Handle(TColStd_HArray1OfReal) vfknots;
1232 Handle(TColStd_HArray1OfReal) uknots;
1233 Handle(TColStd_HArray1OfReal) vknots;
1234 Handle(TColStd_HArray1OfInteger) umults;
1235 Handle(TColStd_HArray1OfInteger) vmults;
1236 Standard_Real umaxderivinv;
1237 Standard_Real vmaxderivinv;
1238 Standard_Boolean maxderivinvok;
1249 #endif // _Geom_BSplineSurface_HeaderFile