|
Open CASCADE Technology
6.7.1
|
Describes a BSpline curve.
A BSpline curve can be:
More...
#include <Geom2d_BSplineCurve.hxx>

Public Member Functions | |
| Geom2d_BSplineCurve (const TColgp_Array1OfPnt2d &Poles, const TColStd_Array1OfReal &Knots, const TColStd_Array1OfInteger &Multiplicities, const Standard_Integer Degree, const Standard_Boolean Periodic=Standard_False) | |
Creates a non-rational B_spline curve on the <br>
basis <Knots, Multiplicities> of degree <Degree>. <br>
The following conditions must be verified. | |
| Geom2d_BSplineCurve (const TColgp_Array1OfPnt2d &Poles, const TColStd_Array1OfReal &Weights, const TColStd_Array1OfReal &Knots, const TColStd_Array1OfInteger &Multiplicities, const Standard_Integer Degree, const Standard_Boolean Periodic=Standard_False) | |
Creates a rational B_spline curve on the basis <br>
<Knots, Multiplicities> of degree <Degree>. <br>
The following conditions must be verified. | |
| void | IncreaseDegree (const Standard_Integer Degree) |
Increases the degree of this BSpline curve to <br> Degree. As a result, the poles, weights and | |
| void | IncreaseMultiplicity (const Standard_Integer Index, const Standard_Integer M) |
Increases the multiplicity of the knot <Index> to <br>
<M>. <br>
| |
| void | IncreaseMultiplicity (const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer M) |
Increases the multiplicities of the knots in <br>
[I1,I2] to <M>. <br>
| |
| void | IncrementMultiplicity (const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer M) |
Increases by M the multiplicity of the knots of indexes <br> I1 to I2 in the knots table of this BSpline curve. For | |
| void | InsertKnot (const Standard_Real U, const Standard_Integer M=1, const Standard_Real ParametricTolerance=0.0) |
Inserts a knot value in the sequence of knots. If <br>
<U> is an existing knot the multiplicity is <br>
increased by <M>. <br>
| |
| void | InsertKnots (const TColStd_Array1OfReal &Knots, const TColStd_Array1OfInteger &Mults, const Standard_Real ParametricTolerance=0.0, const Standard_Boolean Add=Standard_False) |
Inserts the values of the array Knots, with the <br> respective multiplicities given by the array Mults, into | |
| Standard_Boolean | RemoveKnot (const Standard_Integer Index, const Standard_Integer M, const Standard_Real Tolerance) |
Reduces the multiplicity of the knot of index Index <br> to M. If M is equal to 0, the knot is removed. | |
| void | InsertPoleAfter (const Standard_Integer Index, const gp_Pnt2d &P, const Standard_Real Weight=1.0) |
| The new pole is inserted after the pole of range Index. If the curve was non rational it can become rational. Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 //! Raised if Index is not in the range [1, Number of Poles] More... | |
| void | InsertPoleBefore (const Standard_Integer Index, const gp_Pnt2d &P, const Standard_Real Weight=1.0) |
| The new pole is inserted before the pole of range Index. If the curve was non rational it can become rational. Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 //! Raised if Index is not in the range [1, Number of Poles] More... | |
| void | RemovePole (const Standard_Integer Index) |
| Removes the pole of range Index If the curve was rational it can become non rational. Raised if the B-spline is NonUniform or PiecewiseBezier. Raised if the number of poles of the B-spline curve is lower or equal to 2 before removing. //! Raised if Index is not in the range [1, Number of Poles] More... | |
| void | Reverse () |
| Reverses the orientation of this BSpline curve. As a result More... | |
| Standard_Real | ReversedParameter (const Standard_Real U) const |
Computes the parameter on the reversed curve for <br> the point of parameter U on this BSpline curve. | |
| void | Segment (const Standard_Real U1, const Standard_Real U2) |
Modifies this BSpline curve by segmenting it <br> between U1 and U2. Either of these values can be | |
| void | SetKnot (const Standard_Integer Index, const Standard_Real K) |
Modifies this BSpline curve by assigning the value K <br> to the knot of index Index in the knots table. This is a | |
| void | SetKnots (const TColStd_Array1OfReal &K) |
Modifies this BSpline curve by assigning the array <br> K to its knots table. The multiplicity of the knots is not modified. | |
| void | SetKnot (const Standard_Integer Index, const Standard_Real K, const Standard_Integer M) |
Modifies this BSpline curve by assigning the value K <br> to the knot of index Index in the knots table. This is a | |
| void | PeriodicNormalization (Standard_Real &U) const |
Computes the parameter normalized within the <br> "first" period of this BSpline curve, if it is periodic: | |
| void | SetPeriodic () |
Changes this BSpline curve into a periodic curve. <br> To become periodic, the curve must first be closed. | |
| void | SetOrigin (const Standard_Integer Index) |
Assigns the knot of index Index in the knots table as <br> the origin of this periodic BSpline curve. As a | |
| void | SetNotPeriodic () |
Changes this BSpline curve into a non-periodic <br> curve. If this curve is already non-periodic, it is not modified. | |
| void | SetPole (const Standard_Integer Index, const gp_Pnt2d &P) |
Modifies this BSpline curve by assigning P to the <br> pole of index Index in the poles table. | |
| void | SetPole (const Standard_Integer Index, const gp_Pnt2d &P, const Standard_Real Weight) |
Modifies this BSpline curve by assigning P to the <br> pole of index Index in the poles table. | |
| void | SetWeight (const Standard_Integer Index, const Standard_Real Weight) |
Assigns the weight Weight to the pole of index Index of the poles table. <br> If the curve was non rational it can become rational. | |
| void | MovePoint (const Standard_Real U, const gp_Pnt2d &P, const Standard_Integer Index1, const Standard_Integer Index2, Standard_Integer &FirstModifiedPole, Standard_Integer &LastModifiedPole) |
Moves the point of parameter U of this BSpline <br> curve to P. Index1 and Index2 are the indexes in the | |
| void | MovePointAndTangent (const Standard_Real U, const gp_Pnt2d &P, const gp_Vec2d &Tangent, const Standard_Real Tolerance, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, Standard_Integer &ErrorStatus) |
Move a point with parameter U to P. <br> and makes it tangent at U be Tangent. | |
| Standard_Boolean | IsCN (const Standard_Integer N) const |
Returns true if the degree of continuity of this <br> BSpline curve is at least N. A BSpline curve is at least GeomAbs_C0. | |
| Standard_Boolean | IsClosed () const |
| Returns true if the distance between the first point and the last point of the curve is lower or equal to Resolution from package gp. Warnings : The first and the last point can be different from the first pole and the last pole of the curve. More... | |
| Standard_Boolean | IsPeriodic () const |
| Returns True if the curve is periodic. More... | |
| Standard_Boolean | IsRational () const |
| Returns True if the weights are not identical. The tolerance criterion is Epsilon of the class Real. More... | |
| GeomAbs_Shape | Continuity () const |
| Returns the global continuity of the curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, CN : the order of continuity is infinite. For a B-spline curve of degree d if a knot Ui has a multiplicity p the B-spline curve is only Cd-p continuous at Ui. So the global continuity of the curve can't be greater than Cd-p where p is the maximum multiplicity of the interior Knots. In the interior of a knot span the curve is infinitely continuously differentiable. More... | |
| Standard_Integer | Degree () const |
Returns the degree of this BSpline curve. <br> In this class the degree of the basis normalized B-spline | |
| void | D0 (const Standard_Real U, gp_Pnt2d &P) const |
Returns in P the point of parameter U. <br> If the curve is periodic then the returned point is P(U) with | |
| void | D1 (const Standard_Real U, gp_Pnt2d &P, gp_Vec2d &V1) const |
| Raised if the continuity of the curve is not C1. More... | |
| void | D2 (const Standard_Real U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2) const |
| Raised if the continuity of the curve is not C2. More... | |
| void | D3 (const Standard_Real U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const |
| For this BSpline curve, computes More... | |
| gp_Vec2d | DN (const Standard_Real U, const Standard_Integer N) const |
For the point of parameter U of this BSpline curve, <br> computes the vector corresponding to the Nth derivative. | |
| gp_Pnt2d | LocalValue (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2) const |
Raised if FromK1 = ToK2. <br> Raised if FromK1 and ToK2 are not in the range | |
| void | LocalD0 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d &P) const |
| void | LocalD1 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d &P, gp_Vec2d &V1) const |
| Raised if the local continuity of the curve is not C1 between the knot K1 and the knot K2. //! Raised if FromK1 = ToK2. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex]. More... | |
| void | LocalD2 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2) const |
| Raised if the local continuity of the curve is not C2 between the knot K1 and the knot K2. //! Raised if FromK1 = ToK2. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex]. More... | |
| void | LocalD3 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const |
| Raised if the local continuity of the curve is not C3 between the knot K1 and the knot K2. //! Raised if FromK1 = ToK2. Raised if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex]. More... | |
| gp_Vec2d | LocalDN (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Integer N) const |
| Raised if the local continuity of the curve is not CN between the knot K1 and the knot K2. //! Raised if FromK1 = ToK2. //! Raised if N < 1. Raises if FromK1 and ToK2 are not in the range [FirstUKnotIndex, LastUKnotIndex]. More... | |
| gp_Pnt2d | EndPoint () const |
Returns the last point of the curve. <br> Warnings : | |
| Standard_Integer | FirstUKnotIndex () const |
| For a B-spline curve the first parameter (which gives the start point of the curve) is a knot value but if the multiplicity of the first knot index is lower than Degree + 1 it is not the first knot of the curve. This method computes the index of the knot corresponding to the first parameter. More... | |
| Standard_Real | FirstParameter () const |
| Computes the parametric value of the start point of the curve. It is a knot value. More... | |
| Standard_Real | Knot (const Standard_Integer Index) const |
| Returns the knot of range Index. When there is a knot with a multiplicity greater than 1 the knot is not repeated. The method Multiplicity can be used to get the multiplicity of the Knot. //! Raised if Index < 1 or Index > NbKnots More... | |
| void | Knots (TColStd_Array1OfReal &K) const |
returns the knot values of the B-spline curve; <br> Raised if the length of K is not equal to the number of knots. | |
| void | KnotSequence (TColStd_Array1OfReal &K) const |
Returns the knots sequence. <br> In this sequence the knots with a multiplicity greater than 1 | |
| GeomAbs_BSplKnotDistribution | KnotDistribution () const |
| Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier. If all the knots differ by a positive constant from the preceding knot the BSpline Curve can be : More... | |
| Standard_Integer | LastUKnotIndex () const |
| For a BSpline curve the last parameter (which gives the end point of the curve) is a knot value but if the multiplicity of the last knot index is lower than Degree + 1 it is not the last knot of the curve. This method computes the index of the knot corresponding to the last parameter. More... | |
| Standard_Real | LastParameter () const |
| Computes the parametric value of the end point of the curve. It is a knot value. More... | |
| void | LocateU (const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer &I1, Standard_Integer &I2, const Standard_Boolean WithKnotRepetition=Standard_False) const |
| Locates the parametric value U in the sequence of knots. If "WithKnotRepetition" is True we consider the knot's representation with repetition of multiple knot value, otherwise we consider the knot's representation with no repetition of multiple knot values. Knots (I1) <= U <= Knots (I2) . if I1 = I2 U is a knot value (the tolerance criterion ParametricTolerance is used). . if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance) . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance) More... | |
| Standard_Integer | Multiplicity (const Standard_Integer Index) const |
| Returns the multiplicity of the knots of range Index. //! Raised if Index < 1 or Index > NbKnots More... | |
| void | Multiplicities (TColStd_Array1OfInteger &M) const |
| Returns the multiplicity of the knots of the curve. Raised if the length of M is not equal to NbKnots. More... | |
| Standard_Integer | NbKnots () const |
| Returns the number of knots. This method returns the number of knot without repetition of multiple knots. More... | |
| Standard_Integer | NbPoles () const |
| Returns the number of poles More... | |
| gp_Pnt2d | Pole (const Standard_Integer Index) const |
| Returns the pole of range Index. //! Raised if Index < 1 or Index > NbPoles. More... | |
| void | Poles (TColgp_Array1OfPnt2d &P) const |
Returns the poles of the B-spline curve; <br> Raised if the length of P is not equal to the number of poles. | |
| gp_Pnt2d | StartPoint () const |
Returns the start point of the curve. <br> Warnings : | |
| Standard_Real | Weight (const Standard_Integer Index) const |
| Returns the weight of the pole of range Index . //! Raised if Index < 1 or Index > NbPoles. More... | |
| void | Weights (TColStd_Array1OfReal &W) const |
Returns the weights of the B-spline curve; <br> Raised if the length of W is not equal to NbPoles. | |
| void | Transform (const gp_Trsf2d &T) |
| Applies the transformation T to this BSpline curve. More... | |
| void | Resolution (const Standard_Real ToleranceUV, Standard_Real &UTolerance) |
Computes for this BSpline curve the parametric <br> tolerance UTolerance for a given tolerance | |
| Handle_Geom2d_Geometry | Copy () const |
| Creates a new object which is a copy of this BSpline curve. More... | |
Public Member Functions inherited from Geom2d_Curve | |
| virtual Standard_Real | TransformedParameter (const Standard_Real U, const gp_Trsf2d &T) const |
Computes the parameter on the curve transformed by <br> T for the point of parameter U on this curve. | |
| virtual Standard_Real | ParametricTransformation (const gp_Trsf2d &T) const |
Returns the coefficient required to compute the <br> parametric transformation of this curve when | |
| Handle_Geom2d_Curve | Reversed () const |
Creates a reversed duplicate Changes the orientation of this curve. The first and <br> last parameters are not changed, but the parametric | |
| virtual Standard_Real | Period () const |
| Returns thne period of this curve. //! raises if the curve is not periodic More... | |
| gp_Pnt2d | Value (const Standard_Real U) const |
Computes the point of parameter U on <me>. <br> If the curve is periodic then the returned point is P(U) with | |
Public Member Functions inherited from Geom2d_Geometry | |
| void | Mirror (const gp_Pnt2d &P) |
Performs the symmetrical transformation of a Geometry <br> with respect to the point P which is the center of the | |
| void | Mirror (const gp_Ax2d &A) |
Performs the symmetrical transformation of a Geometry <br> with respect to an axis placement which is the axis of the symmetry. | |
| void | Rotate (const gp_Pnt2d &P, const Standard_Real Ang) |
Rotates a Geometry. P is the center of the rotation. <br> Ang is the angular value of the rotation in radians. | |
| void | Scale (const gp_Pnt2d &P, const Standard_Real S) |
| Scales a Geometry. S is the scaling value. More... | |
| void | Translate (const gp_Vec2d &V) |
| Translates a Geometry. V is the vector of the tanslation. More... | |
| void | Translate (const gp_Pnt2d &P1, const gp_Pnt2d &P2) |
| Translates a Geometry from the point P1 to the point P2. More... | |
| Handle_Geom2d_Geometry | Mirrored (const gp_Pnt2d &P) const |
| Handle_Geom2d_Geometry | Mirrored (const gp_Ax2d &A) const |
| Handle_Geom2d_Geometry | Rotated (const gp_Pnt2d &P, const Standard_Real Ang) const |
| Handle_Geom2d_Geometry | Scaled (const gp_Pnt2d &P, const Standard_Real S) const |
| Handle_Geom2d_Geometry | Transformed (const gp_Trsf2d &T) const |
| Handle_Geom2d_Geometry | Translated (const gp_Vec2d &V) const |
| Handle_Geom2d_Geometry | Translated (const gp_Pnt2d &P1, const gp_Pnt2d &P2) const |
Public Member Functions inherited from MMgt_TShared | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. More... | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. More... | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. More... | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. More... | |
| virtual | ~Standard_Transient () |
| Destructor must be virtual. More... | |
| virtual void | ShallowDump (Standard_OStream &) const |
| virtual const Handle_Standard_Type & | DynamicType () const |
| Returns a type information object about this object. More... | |
| Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
| Returns a true value if this is an instance of Type. More... | |
| Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName. More... | |
| Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| virtual Handle_Standard_Transient | This () const |
| Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
| Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More... | |
Static Public Member Functions | |
| static Standard_Integer | MaxDegree () |
| Returns the value of the maximum degree of the normalized B-spline basis functions in this package. More... | |
Describes a BSpline curve.
A BSpline curve can be:
| Geom2d_BSplineCurve::Geom2d_BSplineCurve | ( | const TColgp_Array1OfPnt2d & | Poles, |
| const TColStd_Array1OfReal & | Knots, | ||
| const TColStd_Array1OfInteger & | Multiplicities, | ||
| const Standard_Integer | Degree, | ||
| const Standard_Boolean | Periodic = Standard_False |
||
| ) |
Creates a non-rational B_spline curve on the <br>
basis <Knots, Multiplicities> of degree <Degree>. <br>
The following conditions must be verified.
0 < Degree <= MaxDegree.
Knots.Length() == Mults.Length() >= 2
Knots(i) < Knots(i+1) (Knots are increasing)
1 <= Mults(i) <= Degree
On a non periodic curve the first and last multiplicities
may be Degree+1 (this is even recommanded if you want the
curve to start and finish on the first and last pole).
On a periodic curve the first and the last multicities
must be the same.
on non-periodic curves
Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2
on periodic curves
Poles.Length() == Sum(Mults(i)) except the first or last
| Geom2d_BSplineCurve::Geom2d_BSplineCurve | ( | const TColgp_Array1OfPnt2d & | Poles, |
| const TColStd_Array1OfReal & | Weights, | ||
| const TColStd_Array1OfReal & | Knots, | ||
| const TColStd_Array1OfInteger & | Multiplicities, | ||
| const Standard_Integer | Degree, | ||
| const Standard_Boolean | Periodic = Standard_False |
||
| ) |
Creates a rational B_spline curve on the basis <br>
<Knots, Multiplicities> of degree <Degree>. <br>
The following conditions must be verified.
0 < Degree <= MaxDegree.
Knots.Length() == Mults.Length() >= 2
Knots(i) < Knots(i+1) (Knots are increasing)
1 <= Mults(i) <= Degree
On a non periodic curve the first and last multiplicities
may be Degree+1 (this is even recommanded if you want the
curve to start and finish on the first and last pole).
On a periodic curve the first and the last multicities
must be the same.
on non-periodic curves
Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2
on periodic curves
Poles.Length() == Sum(Mults(i)) except the first or last
|
virtual |
Returns the global continuity of the curve :
C0 : only geometric continuity,
C1 : continuity of the first derivative all along the Curve,
C2 : continuity of the second derivative all along the Curve,
C3 : continuity of the third derivative all along the Curve,
CN : the order of continuity is infinite.
For a B-spline curve of degree d if a knot Ui has a
multiplicity p the B-spline curve is only Cd-p continuous
at Ui. So the global continuity of the curve can't be greater
than Cd-p where p is the maximum multiplicity of the interior
Knots. In the interior of a knot span the curve is infinitely
continuously differentiable.
Implements Geom2d_Curve.
|
virtual |
Creates a new object which is a copy of this BSpline curve.
Implements Geom2d_Geometry.
|
virtual |
Returns in P the point of parameter U. <br>
If the curve is periodic then the returned point is P(U) with
U = Ustart + (U - Uend) where Ustart and Uend are the
parametric bounds of the curve.
Raised only for the "OffsetCurve" if it is not possible to
compute the current point. For example when the first
derivative on the basis curve and the offset direction
are parallel.
Implements Geom2d_Curve.
|
virtual |
Raised if the continuity of the curve is not C1.
Implements Geom2d_Curve.
|
virtual |
Raised if the continuity of the curve is not C2.
Implements Geom2d_Curve.
|
virtual |
For this BSpline curve, computes
Implements Geom2d_Curve.
| Standard_Integer Geom2d_BSplineCurve::Degree | ( | ) | const |
Returns the degree of this BSpline curve. <br>
In this class the degree of the basis normalized B-spline
functions cannot be greater than "MaxDegree"
//! Computation of value and derivatives
|
virtual |
For the point of parameter U of this BSpline curve, <br>
computes the vector corresponding to the Nth derivative.
Warning
On a point where the continuity of the curve is not the
one requested, this function impacts the part defined
by the parameter with a value greater than U, i.e. the
part of the curve to the "right" of the singularity.
Raises UndefinedDerivative if the continuity of the curve is not CN.
RangeError if N < 1.
//! The following functions computes the point of parameter U
and the derivatives at this point on the B-spline curve
arc defined between the knot FromK1 and the knot ToK2.
U can be out of bounds [Knot (FromK1), Knot (ToK2)] but
for the computation we only use the definition of the curve
between these two knots. This method is useful to compute
local derivative, if the order of continuity of the whole
curve is not greater enough. Inside the parametric
domain Knot (FromK1), Knot (ToK2) the evaluations are
the same as if we consider the whole definition of the
curve. Of course the evaluations are different outside
this parametric domain.
Implements Geom2d_Curve.
|
virtual |
Returns the last point of the curve. <br>
Warnings :
The last point of the curve is different from the last
pole of the curve if the multiplicity of the last knot
is lower than Degree.
Implements Geom2d_BoundedCurve.
|
virtual |
Computes the parametric value of the start point of the curve.
It is a knot value.
Implements Geom2d_Curve.
| Standard_Integer Geom2d_BSplineCurve::FirstUKnotIndex | ( | ) | const |
For a B-spline curve the first parameter (which gives the start
point of the curve) is a knot value but if the multiplicity of
the first knot index is lower than Degree + 1 it is not the
first knot of the curve. This method computes the index of the
knot corresponding to the first parameter.
| void Geom2d_BSplineCurve::IncreaseDegree | ( | const Standard_Integer | Degree | ) |
Increases the degree of this BSpline curve to <br>
Degree. As a result, the poles, weights and
multiplicities tables are modified; the knots table is
not changed. Nothing is done if Degree is less than
or equal to the current degree.
Exceptions
Standard_ConstructionError if Degree is greater than
Geom2d_BSplineCurve::MaxDegree().
| void Geom2d_BSplineCurve::IncreaseMultiplicity | ( | const Standard_Integer | Index, |
| const Standard_Integer | M | ||
| ) |
Increases the multiplicity of the knot <Index> to <br>
<M>. <br>
If <M> is lower or equal to the current
multiplicity nothing is done. If <M> is higher than
the degree the degree is used.
//! If <Index> is not in [FirstUKnotIndex, LastUKnotIndex]
| void Geom2d_BSplineCurve::IncreaseMultiplicity | ( | const Standard_Integer | I1, |
| const Standard_Integer | I2, | ||
| const Standard_Integer | M | ||
| ) |
Increases the multiplicities of the knots in <br>
[I1,I2] to <M>. <br>
For each knot if <M> is lower or equal to the
current multiplicity nothing is done. If <M> is
higher than the degree the degree is used.
As a result, the poles and weights tables of this curve are modified.
Warning
It is forbidden to modify the multiplicity of the first or
last knot of a non-periodic curve. Be careful as
Geom2d does not protect against this.
Exceptions
Standard_OutOfRange if either Index, I1 or I2 is
outside the bounds of the knots table.
| void Geom2d_BSplineCurve::IncrementMultiplicity | ( | const Standard_Integer | I1, |
| const Standard_Integer | I2, | ||
| const Standard_Integer | M | ||
| ) |
Increases by M the multiplicity of the knots of indexes <br>
I1 to I2 in the knots table of this BSpline curve. For
each knot, the resulting multiplicity is limited to the
degree of this curve. If M is negative, nothing is done.
As a result, the poles and weights tables of this
BSpline curve are modified.
Warning
It is forbidden to modify the multiplicity of the first or
last knot of a non-periodic curve. Be careful as
Geom2d does not protect against this.
Exceptions
Standard_OutOfRange if I1 or I2 is outside the
bounds of the knots table.
| void Geom2d_BSplineCurve::InsertKnot | ( | const Standard_Real | U, |
| const Standard_Integer | M = 1, |
||
| const Standard_Real | ParametricTolerance = 0.0 |
||
| ) |
Inserts a knot value in the sequence of knots. If <br>
<U> is an existing knot the multiplicity is <br>
increased by <M>. <br>
If U is not on the parameter range nothing is
done.
If the multiplicity is negative or null nothing is
done. The new multiplicity is limited to the
degree.
The tolerance criterion for knots equality is
the max of Epsilon(U) and ParametricTolerance.
Warning
| void Geom2d_BSplineCurve::InsertKnots | ( | const TColStd_Array1OfReal & | Knots, |
| const TColStd_Array1OfInteger & | Mults, | ||
| const Standard_Real | ParametricTolerance = 0.0, |
||
| const Standard_Boolean | Add = Standard_False |
||
| ) |
Inserts the values of the array Knots, with the <br>
respective multiplicities given by the array Mults, into
the knots table of this BSpline curve.
If a value of the array Knots is an existing knot, its multiplicity is:
| void Geom2d_BSplineCurve::InsertPoleAfter | ( | const Standard_Integer | Index, |
| const gp_Pnt2d & | P, | ||
| const Standard_Real | Weight = 1.0 |
||
| ) |
The new pole is inserted after the pole of range Index.
If the curve was non rational it can become rational.
Raised if the B-spline is NonUniform or PiecewiseBezier or if
Weight <= 0.0
//! Raised if Index is not in the range [1, Number of Poles]
| void Geom2d_BSplineCurve::InsertPoleBefore | ( | const Standard_Integer | Index, |
| const gp_Pnt2d & | P, | ||
| const Standard_Real | Weight = 1.0 |
||
| ) |
The new pole is inserted before the pole of range Index.
If the curve was non rational it can become rational.
Raised if the B-spline is NonUniform or PiecewiseBezier or if
Weight <= 0.0
//! Raised if Index is not in the range [1, Number of Poles]
|
virtual |
Returns true if the distance between the first point and the
last point of the curve is lower or equal to Resolution
from package gp.
Warnings :
The first and the last point can be different from the first
pole and the last pole of the curve.
Implements Geom2d_Curve.
|
virtual |
Returns true if the degree of continuity of this <br>
BSpline curve is at least N. A BSpline curve is at least GeomAbs_C0.
Exceptions Standard_RangeError if N is negative.
Implements Geom2d_Curve.
|
virtual |
Returns True if the curve is periodic.
Implements Geom2d_Curve.
| Standard_Boolean Geom2d_BSplineCurve::IsRational | ( | ) | const |
Returns True if the weights are not identical.
The tolerance criterion is Epsilon of the class Real.
| Standard_Real Geom2d_BSplineCurve::Knot | ( | const Standard_Integer | Index | ) | const |
Returns the knot of range Index. When there is a knot
with a multiplicity greater than 1 the knot is not repeated.
The method Multiplicity can be used to get the multiplicity
of the Knot.
//! Raised if Index < 1 or Index > NbKnots
| GeomAbs_BSplKnotDistribution Geom2d_BSplineCurve::KnotDistribution | ( | ) | const |
Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier.
If all the knots differ by a positive constant from the
preceding knot the BSpline Curve can be :
| void Geom2d_BSplineCurve::Knots | ( | TColStd_Array1OfReal & | K | ) | const |
returns the knot values of the B-spline curve; <br>
Raised if the length of K is not equal to the number of knots.
| void Geom2d_BSplineCurve::KnotSequence | ( | TColStd_Array1OfReal & | K | ) | const |
Returns the knots sequence. <br>
In this sequence the knots with a multiplicity greater than 1
are repeated.
Example :
K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
Raised if the length of K is not equal to NbPoles + Degree + 1
|
virtual |
Computes the parametric value of the end point of the curve.
It is a knot value.
Implements Geom2d_Curve.
| Standard_Integer Geom2d_BSplineCurve::LastUKnotIndex | ( | ) | const |
For a BSpline curve the last parameter (which gives the
end point of the curve) is a knot value but if the
multiplicity of the last knot index is lower than
Degree + 1 it is not the last knot of the curve. This
method computes the index of the knot corresponding to
the last parameter.
| void Geom2d_BSplineCurve::LocalD0 | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2, | ||
| gp_Pnt2d & | P | ||
| ) | const |
| void Geom2d_BSplineCurve::LocalD1 | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2, | ||
| gp_Pnt2d & | P, | ||
| gp_Vec2d & | V1 | ||
| ) | const |
Raised if the local continuity of the curve is not C1
between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
Raised if FromK1 and ToK2 are not in the range
[FirstUKnotIndex, LastUKnotIndex].
| void Geom2d_BSplineCurve::LocalD2 | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2, | ||
| gp_Pnt2d & | P, | ||
| gp_Vec2d & | V1, | ||
| gp_Vec2d & | V2 | ||
| ) | const |
Raised if the local continuity of the curve is not C2
between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
Raised if FromK1 and ToK2 are not in the range
[FirstUKnotIndex, LastUKnotIndex].
| void Geom2d_BSplineCurve::LocalD3 | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2, | ||
| gp_Pnt2d & | P, | ||
| gp_Vec2d & | V1, | ||
| gp_Vec2d & | V2, | ||
| gp_Vec2d & | V3 | ||
| ) | const |
Raised if the local continuity of the curve is not C3
between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
Raised if FromK1 and ToK2 are not in the range
[FirstUKnotIndex, LastUKnotIndex].
| gp_Vec2d Geom2d_BSplineCurve::LocalDN | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2, | ||
| const Standard_Integer | N | ||
| ) | const |
Raised if the local continuity of the curve is not CN
between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
//! Raised if N < 1.
Raises if FromK1 and ToK2 are not in the range
[FirstUKnotIndex, LastUKnotIndex].
| gp_Pnt2d Geom2d_BSplineCurve::LocalValue | ( | const Standard_Real | U, |
| const Standard_Integer | FromK1, | ||
| const Standard_Integer | ToK2 | ||
| ) | const |
Raised if FromK1 = ToK2. <br>
Raised if FromK1 and ToK2 are not in the range
[FirstUKnotIndex, LastUKnotIndex].
| void Geom2d_BSplineCurve::LocateU | ( | const Standard_Real | U, |
| const Standard_Real | ParametricTolerance, | ||
| Standard_Integer & | I1, | ||
| Standard_Integer & | I2, | ||
| const Standard_Boolean | WithKnotRepetition = Standard_False |
||
| ) | const |
Locates the parametric value U in the sequence of knots.
If "WithKnotRepetition" is True we consider the knot's
representation with repetition of multiple knot value,
otherwise we consider the knot's representation with
no repetition of multiple knot values.
Knots (I1) <= U <= Knots (I2)
. if I1 = I2 U is a knot value (the tolerance criterion
ParametricTolerance is used).
. if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance)
. if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance)
|
static |
Returns the value of the maximum degree of the normalized
B-spline basis functions in this package.
| void Geom2d_BSplineCurve::MovePoint | ( | const Standard_Real | U, |
| const gp_Pnt2d & | P, | ||
| const Standard_Integer | Index1, | ||
| const Standard_Integer | Index2, | ||
| Standard_Integer & | FirstModifiedPole, | ||
| Standard_Integer & | LastModifiedPole | ||
| ) |
Moves the point of parameter U of this BSpline <br>
curve to P. Index1 and Index2 are the indexes in the
table of poles of this BSpline curve of the first and
last poles designated to be moved.
FirstModifiedPole and LastModifiedPole are the
indexes of the first and last poles, which are
effectively modified.
In the event of incompatibility between Index1,
Index2 and the value U:
| void Geom2d_BSplineCurve::MovePointAndTangent | ( | const Standard_Real | U, |
| const gp_Pnt2d & | P, | ||
| const gp_Vec2d & | Tangent, | ||
| const Standard_Real | Tolerance, | ||
| const Standard_Integer | StartingCondition, | ||
| const Standard_Integer | EndingCondition, | ||
| Standard_Integer & | ErrorStatus | ||
| ) |
Move a point with parameter U to P. <br>
and makes it tangent at U be Tangent.
StartingCondition = -1 means first can move
EndingCondition = -1 means last point can move
StartingCondition = 0 means the first point cannot move
EndingCondition = 0 means the last point cannot move
StartingCondition = 1 means the first point and tangent cannot move
EndingCondition = 1 means the last point and tangent cannot move
and so forth
ErrorStatus != 0 means that there are not enought degree of freedom
with the constrain to deform the curve accordingly
| void Geom2d_BSplineCurve::Multiplicities | ( | TColStd_Array1OfInteger & | M | ) | const |
Returns the multiplicity of the knots of the curve.
Raised if the length of M is not equal to NbKnots.
| Standard_Integer Geom2d_BSplineCurve::Multiplicity | ( | const Standard_Integer | Index | ) | const |
Returns the multiplicity of the knots of range Index.
//! Raised if Index < 1 or Index > NbKnots
| Standard_Integer Geom2d_BSplineCurve::NbKnots | ( | ) | const |
Returns the number of knots. This method returns the number of
knot without repetition of multiple knots.
| Standard_Integer Geom2d_BSplineCurve::NbPoles | ( | ) | const |
Returns the number of poles
| void Geom2d_BSplineCurve::PeriodicNormalization | ( | Standard_Real & | U | ) | const |
Computes the parameter normalized within the <br>
"first" period of this BSpline curve, if it is periodic:
the returned value is in the range Param1 and
Param1 + Period, where:
| gp_Pnt2d Geom2d_BSplineCurve::Pole | ( | const Standard_Integer | Index | ) | const |
Returns the pole of range Index.
//! Raised if Index < 1 or Index > NbPoles.
| void Geom2d_BSplineCurve::Poles | ( | TColgp_Array1OfPnt2d & | P | ) | const |
Returns the poles of the B-spline curve; <br>
Raised if the length of P is not equal to the number of poles.
| Standard_Boolean Geom2d_BSplineCurve::RemoveKnot | ( | const Standard_Integer | Index, |
| const Standard_Integer | M, | ||
| const Standard_Real | Tolerance | ||
| ) |
Reduces the multiplicity of the knot of index Index <br>
to M. If M is equal to 0, the knot is removed.
With a modification of this type, the array of poles is also modified.
Two different algorithms are systematically used to
compute the new poles of the curve. If, for each
pole, the distance between the pole calculated
using the first algorithm and the same pole
calculated using the second algorithm, is less than
Tolerance, this ensures that the curve is not
modified by more than Tolerance. Under these
conditions, true is returned; otherwise, false is returned.
A low tolerance is used to prevent modification of
the curve. A high tolerance is used to "smooth" the curve.
Exceptions
Standard_OutOfRange if Index is outside the
bounds of the knots table.
| void Geom2d_BSplineCurve::RemovePole | ( | const Standard_Integer | Index | ) |
Removes the pole of range Index
If the curve was rational it can become non rational.
Raised if the B-spline is NonUniform or PiecewiseBezier.
Raised if the number of poles of the B-spline curve is lower or
equal to 2 before removing.
//! Raised if Index is not in the range [1, Number of Poles]
| void Geom2d_BSplineCurve::Resolution | ( | const Standard_Real | ToleranceUV, |
| Standard_Real & | UTolerance | ||
| ) |
Computes for this BSpline curve the parametric <br>
tolerance UTolerance for a given tolerance
Tolerance3D (relative to dimensions in the plane).
If f(t) is the equation of this BSpline curve,
UTolerance ensures that:
| t1 - t0| < Utolerance ===>
|f(t1) - f(t0)| < ToleranceUV
|
virtual |
Reverses the orientation of this BSpline curve. As a result
Implements Geom2d_Curve.
|
virtual |
Computes the parameter on the reversed curve for <br>
the point of parameter U on this BSpline curve.
The returned value is: UFirst + ULast - U,
where UFirst and ULast are the values of the
first and last parameters of this BSpline curve.
Implements Geom2d_Curve.
| void Geom2d_BSplineCurve::Segment | ( | const Standard_Real | U1, |
| const Standard_Real | U2 | ||
| ) |
Modifies this BSpline curve by segmenting it <br>
between U1 and U2. Either of these values can be
outside the bounds of the curve, but U2 must be greater than U1.
All data structure tables of this BSpline curve are
modified, but the knots located between U1 and U2
are retained. The degree of the curve is not modified.
Warnings :
Even if <me> is not closed it can become closed after the
segmentation for example if U1 or U2 are out of the bounds
of the curve <me> or if the curve makes loop.
After the segmentation the length of a curve can be null.
- The segmentation of a periodic curve over an <br>
interval corresponding to its period generates a
non-periodic curve with equivalent geometry.
Exceptions
Standard_DomainError if U2 is less than U1.
//! raises if U2 < U1.
| void Geom2d_BSplineCurve::SetKnot | ( | const Standard_Integer | Index, |
| const Standard_Real | K | ||
| ) |
Modifies this BSpline curve by assigning the value K <br>
to the knot of index Index in the knots table. This is a
relatively local modification because K must be such that:
Knots(Index - 1) < K < Knots(Index + 1)
Exceptions
Standard_ConstructionError if:
| void Geom2d_BSplineCurve::SetKnot | ( | const Standard_Integer | Index, |
| const Standard_Real | K, | ||
| const Standard_Integer | M | ||
| ) |
Modifies this BSpline curve by assigning the value K <br>
to the knot of index Index in the knots table. This is a
relatively local modification because K must be such that:
Knots(Index - 1) < K < Knots(Index + 1)
The second syntax allows you also to increase the
multiplicity of the knot to M (but it is not possible to
decrease the multiplicity of the knot with this function).
Exceptions
Standard_ConstructionError if:
| void Geom2d_BSplineCurve::SetKnots | ( | const TColStd_Array1OfReal & | K | ) |
Modifies this BSpline curve by assigning the array <br>
K to its knots table. The multiplicity of the knots is not modified.
Exceptions
Standard_ConstructionError if the values in the
array K are not in ascending order.
Standard_OutOfRange if the bounds of the array
K are not respectively 1 and the number of knots of this BSpline curve.
| void Geom2d_BSplineCurve::SetNotPeriodic | ( | ) |
Changes this BSpline curve into a non-periodic <br>
curve. If this curve is already non-periodic, it is not modified.
Note that the poles and knots tables are modified.
Warning
If this curve is periodic, as the multiplicity of the first
and last knots is not modified, and is not equal to
Degree + 1, where Degree is the degree of
this BSpline curve, the start and end points of the
curve are not its first and last poles.
| void Geom2d_BSplineCurve::SetOrigin | ( | const Standard_Integer | Index | ) |
Assigns the knot of index Index in the knots table as <br>
the origin of this periodic BSpline curve. As a
consequence, the knots and poles tables are modified.
Exceptions
Standard_NoSuchObject if this curve is not periodic.
Standard_DomainError if Index is outside the
bounds of the knots table.
| void Geom2d_BSplineCurve::SetPeriodic | ( | ) |
Changes this BSpline curve into a periodic curve. <br>
To become periodic, the curve must first be closed.
Next, the knot sequence must be periodic. For this,
FirstUKnotIndex and LastUKnotIndex are used to
compute I1 and I2, the indexes in the knots array
of the knots corresponding to the first and last
parameters of this BSpline curve.
The period is therefore Knot(I2) - Knot(I1).
Consequently, the knots and poles tables are modified.
Exceptions
Standard_ConstructionError if this BSpline curve is not closed.
| void Geom2d_BSplineCurve::SetPole | ( | const Standard_Integer | Index, |
| const gp_Pnt2d & | P | ||
| ) |
Modifies this BSpline curve by assigning P to the <br>
pole of index Index in the poles table.
Exceptions
Standard_OutOfRange if Index is outside the
bounds of the poles table.
Standard_ConstructionError if Weight is negative or null.
| void Geom2d_BSplineCurve::SetPole | ( | const Standard_Integer | Index, |
| const gp_Pnt2d & | P, | ||
| const Standard_Real | Weight | ||
| ) |
Modifies this BSpline curve by assigning P to the <br>
pole of index Index in the poles table.
The second syntax also allows you to modify the
weight of the modified pole, which becomes Weight.
In this case, if this BSpline curve is non-rational, it
can become rational and vice versa.
Exceptions
Standard_OutOfRange if Index is outside the
bounds of the poles table.
Standard_ConstructionError if Weight is negative or null.
| void Geom2d_BSplineCurve::SetWeight | ( | const Standard_Integer | Index, |
| const Standard_Real | Weight | ||
| ) |
Assigns the weight Weight to the pole of index Index of the poles table. <br>
If the curve was non rational it can become rational.
If the curve was rational it can become non rational.
Exceptions
Standard_OutOfRange if Index is outside the
bounds of the poles table.
Standard_ConstructionError if Weight is negative or null.
|
virtual |
Returns the start point of the curve. <br>
Warnings :
This point is different from the first pole of the curve if the
multiplicity of the first knot is lower than Degree.
Implements Geom2d_BoundedCurve.
|
virtual |
Applies the transformation T to this BSpline curve.
Implements Geom2d_Geometry.
| Standard_Real Geom2d_BSplineCurve::Weight | ( | const Standard_Integer | Index | ) | const |
Returns the weight of the pole of range Index .
//! Raised if Index < 1 or Index > NbPoles.
| void Geom2d_BSplineCurve::Weights | ( | TColStd_Array1OfReal & | W | ) | const |
Returns the weights of the B-spline curve; <br>
Raised if the length of W is not equal to NbPoles.
1.8.5