All Frameworks Class Hierarchy This Framework Previous Next Indexes
GeometricObjects Class CATKnotVector
CATKnotVector
Usage: you must use this class as is. You should never derive it.
public class CATKnotVector
Class containing all the data necessary to define
a uniform or non uniform, non periodic basis.
NOTE: PERIODIC NURBS ARE NOT SUPPORTED.
A basis is a set of piecewise polynomial functions
(of a given degree), called
basis functions. The pieces are the arcs.
They define the parameter domains between
two distincts successive knot values (global parameters at the
arc extremities). Then, the number of knots is the number of arcs plus 1.
The matching between arc number and Knot vector rank follows the rules ;
(i - IndexOffset)-th Arc starts at Knots(i-1) and ends at Knots(i) ,
There is one polynom per arc for each basis function.
The continuity order between arcs is equal to the degree minus the
multiplicity of the corresponding knot value.
| Multiplicity | Continuity order |
single knot value | 1 | Degree-1 |
internal knot values | 1<=m<=degree |
Degree-m |
extreme knot values for a non periodic basis |
degree+1 (by convention) | (-1) |
same first and last knot values for a periodic basis |
1<=m<=degree | Degree-m |
The number of arcs where
the polynom is not null depends on the knot vector mutiplicities.
Associating each basis
function to a control point (also called vertex),
allows the definition of Nurbs geometric
elements. A basis function represents the influence of one control point.
Note that vertices are not data of the knot vector, but of
the Nurbs polynomial element. Nevertheless, vertex ranks are handled in
methods of this class, because they are equivalent to the polynomial
basis ranks.
A CATKnotVector is a transient object, it can be saved as private data of a
curve or a surface.
A CATKnotVector is defined with:
CATLONG32 | Degree |
The degree of the B-Spline basis functions |
CATBoolean | IsPeriodic |
1 for a periodic basis: the parameter domain is unlimited.
If Delta= LastKnotValue - FirstKnotValue,
the evaluations at Parameter + Delta and Parameter are
the same.
0 otherwise |
CATBoolean | IsUniform |
1 in case of equally spaced knot values.
0 otherwise. |
CATLONG32 | NbOfKnots |
The number of knot values ( =NbOfArcs + 1 |
CATLONG32 | Knots |
The array of the knots values |
CATLONG32 | Multiplicities |
The array of the multiplicity of a knot value |
Sample of a non periodic non uniform knot vector, with C2 continuity:
CATLONG32 | Degree |
3 |
CATBoolean | IsPeriodic |
0 |
CATBoolean | IsUniform |
0 |
CATLONG32 | NbOfKnots |
4 |
CATLONG32 | Knots |
0 , 2 , 8 , 9 |
CATLONG32 | Multiplicities |
4 , 1 , 1 , 4 |
Constructor and Destructor Index
- o
CATKnotVector(CATKnotVector&,double,double,CATTolerance&)
- Copy Constructor.
- o
CATKnotVector(CATLONG32&,CATLONG32&,CATLONG32&,double*,CATLONG32*,CATLONG32)
-
- o
CATKnotVector(CATLONG32&,CATLONG32&,CATLONG32&,double,double,CATLONG32)
- Constructs a uniform CATKnotVector.
- o
CATKnotVector(CATLONG32&,CATLONG32&,double*,CATLONG32&,CATLONG32,CATTolerance&)
- Constructs a non-uniform CATKnotVector from a parameter array and
a general continuity order.
- o
CATKnotVector(CATLONG32)
- Constructs a Bezier CATKnotVector.
- o
CATKnotVector(CATTolerance&,CATError*&,CATLONG32&,CATLONG32&,CATLONG32&,double*,CATLONG32*,CATLONG32)
- Constructs a non-uniform CATKnotVector.
- o
CATKnotVector(CATTolerance&,CATError*&,CATLONG32&,CATLONG32&,CATLONG32&,double,double,CATLONG32)
- Constructs a uniform CATKnotVector.
- o
~CATKnotVector()
- Destructor.
- o
~CATKnotVector()
-
Method Index
- o
ConvertGlobalToLocalParameter(double&,double&,CATLONG32&)
- Retrieves the local parameter and the arc number of
this CATKnotVector global parameter.
- o
ConvertLocalToGlobalParameter(double&,CATLONG32&,double&)
- Retrieves the global parameter associated with a local parameter and an
arc number of this CATKnotVector.
- o
Extrapol(CATLONG32&,double*,CATLONG32*)
- Adds knots at the left or the right of this KnotVector.
- o
FirstVertexForOneArc(CATLONG32&,CATLONG32&)
- Retrieves the first control point which acts on an arc.
- o
GetDegree()
- Returns the degree of the basis defined by this CATKnotVector.
- o
GetIndexOffset()
- Returns the arc index offset.
- o
GetInternalExtremities(CATLONG32,double&,double&)
- Returns the local parameters on the arc iArc.
- o
GetKnotMultiplicity(CATLONG32&)
- Returns the multiplicity of this CATKnotVector knot value.
- o
GetKnots(double*&)
- Returns the pointer to the knot values array of this CATKnotVector.
- o
GetMaxExtremities(CATLONG32&,double&,CATLONG32&,double&)
- Returns the maximum local parameters and arc number of this Knot vector.
- o
GetNumberOfArcs()
- Returns the number of arcs of a nurbs using this CATKnotVector.
- o
GetNumberOfControlPoints()
- Returns the number of necessary control points for a nurbs using this
CATKnotVector.
- o
GetNumberOfKnots()
- Returns the number of distinct knot values of this CATKnotVector.
- o
GetPolynomialBasisForAllArcs()
- Returns the array of pointers on the polynoms defined by this CATKnotVector.
- o
GetPolynomialBasisForOneArc(CATLONG32&)
- Returns the array of pointers on the polynoms defined by this CATKnotVector
involved in one arc.
- o
IsContinuousOnDomain(CATLONG32&,CATLONG32&,CATLONG32&)
- Tests whether a given continuity order of the related basis
is garanteed on a subparameter domain.
- o
IsPeriodic()
- Tests if a CATKnotVector defines a periodic basis.
- o
IsUniform()
- Tests if a CATKnotVector defines a uniform basis.
- o
MoveInExtendedKnotVector(CATLONG32&,CATLONG32&,CATLONG32&)
- Shifts a position into the expanded CATKnotVector.
- o
PolynomialBasisForAllArcs(CATMathPolynomX***)
- Retrieves a bi-dimensional array of pointers on the polynoms defined by
this CATKnotVector.
- o
PolynomialBasisForOneArc(CATLONG32&,CATMathPolynomX**)
- Retrieves an array of pointers on the polynoms defined by this CATKnotVector
involved in one arc.
- o
SearchArcFromParameter(double&)
- Returns the arc number of this CATKnotVector global parameter.
- o
Set(CATKnotVector&,double,double,CATTolerance&)
- Copies a knot vector.
- o
SetDegree(CATLONG32&)
- Modifies the degree.
- o
SetIndexOffset(CATLONG32&)
- Modifies the arc index offset.
- o
SetKnotMultiplicity(CATLONG32&,CATLONG32&)
- Modifies a knot value multiplicity of this CATKnotVector.
- o
SetKnotValue(CATLONG32&,double&,CATTolerance&)
- Modifies a knot value of this CATKnotVector.
- o
SetNonUniformKnotVector(CATLONG32&,CATLONG32&,CATLONG32&,double*,CATLONG32*,CATLONG32)
- Redefines this as a non uniform CATKnotVector.
- o
SetTolerance(CATTolerance&)
-
- o
SetUniformKnotVector(CATLONG32&,CATLONG32&,CATLONG32&,double,double,CATLONG32)
- Redefines this as a uniform CATKnotVector .
- o
operator =(CATKnotVector&)
- Assignment operator.
Data Member Index
- o
_PrivateDoNotUseNotScaled_R18Restricted
-
Constructor and Destructor
o CATKnotVector
public CATKnotVector( | const CATKnotVector& | iKnotVectorToCopy, |
| double | iCoefficient | =1., |
| double | iShift | =0. , |
| const CATTolerance& | iTolObject | =CATGetDefaultTolerance()) |
-
Copy Constructor.
A linear transformation of the parameterization can be applied (optional)
New parameter= iCoefficient * Old parameter + iShift,
- Parameters:
-
- iKnotVectorToCopy
- The knot vector to copy.
- iCoefficient
- The coeficient of the transformation.
- iShift
- The shift of the transformation.
o CATKnotVector
-
o CATKnotVector
-
Constructs a uniform CATKnotVector.
- Parameters:
-
- iDegree
- The degree of the polynomial basis.
- iIsPeriodic
- The periodicity. So far, periodic basis are not supported.
Legal values 0.
- iNbOfArcs
- The number of arcs.
- iKnotStart
- The parameter value of the first knot.
- iStep
- The uniform step value between two knots.
- iIndexOffset
- The index for the first arc.
o CATKnotVector
-
Constructs a non-uniform CATKnotVector from a parameter array and
a general continuity order.
- Parameters:
-
- iIsPeriodic
- The periodicity.
Legal values0.
- iNbOfParameters
- The number of knot values specified for the knot vector. The number of arcs
is iNbOfParameters - 1.
- iParameters
- The array of the global parameter values at the end of each arc.
- iContinuityOrder
- The global continuity (0,1,2) of the curve. The degree of the polynomial basis
is iContinuityOrder + 1.
- iIndexOffset
- The index for the first arc.
o CATKnotVector
public CATKnotVector( | const CATLONG32 | iDegree | =3) |
-
Constructs a Bezier CATKnotVector.
It corresponds to one arc of degree iDegree.
- Parameters:
-
- iDegree
- The degree of the polynomial basis.
o CATKnotVector
-
Constructs a non-uniform CATKnotVector.
- Parameters:
-
- iDegree
- The degree of the polynomial basis.
- iIsPeriodic
- The periodicity.
Legal values 0.
- iNbOfKnots
- The number of knot values specified for the knot vector. The number of arcs
is iNbOfKnots - 1.
- iKnots
- The array of the global parameter values at the end of each arc.
- iMultiplicities
- The array of the corresponding multiplicities.
- iIndexOffset
- The index for the first arc.
o CATKnotVector
-
Constructs a uniform CATKnotVector.
- Parameters:
-
- iTolObject
- The set of geometric and mathematical tolerances.
- oError
- (output argument) The Error to raise if invalid data given to constructor.
- iDegree
- The degree of the polynomial basis.
- iIsPeriodic
- The periodicity. So far, periodic basis are not supported.
Legal values 0.
- iNbOfArcs
- The number of arcs.
- iKnotStart
- The parameter value of the first knot.
- iStep
- The uniform step value between two knots.
- iIndexOffset
- The index for the first arc.
o ~CATKnotVector
public virtual ~CATKnotVector( | ) |
-
Destructor.
o ~CATKnotVector
-
Methods
o ConvertGlobalToLocalParameter
public virtual void ConvertGlobalToLocalParameter( | const double& | iGlobalParameter, |
| double& | ioLocalParameter, |
| CATLONG32& | ioArcNum)const |
-
Retrieves the local parameter and the arc number of
this CATKnotVector global parameter.
- Parameters:
-
- ioLocalParameter
- The local parameter on oArcNum.
- ioArcNum
- The arc number starting at 1.
o ConvertLocalToGlobalParameter
public virtual void ConvertLocalToGlobalParameter( | const double& | iLocalParameter, |
| const CATLONG32& | iArcNum, |
| double& | ioParameter) const |
-
Retrieves the global parameter associated with a local parameter and an
arc number of this CATKnotVector.
- Parameters:
-
- iLocalParameter
- The local parameter on iArcNum.
- iArcNum
- The arc number.
- ioGlobalParameter
- The corresponding global parameter.
o Extrapol
public void Extrapol( | const CATLONG32& | iNbOfParameters, |
| const double* | iParameters, |
| const CATLONG32* | iContinuityOrders | =0) |
-
Adds knots at the left or the right of this KnotVector.
- Parameters:
-
- iNbOfParameters
- The number of knots to add.
- iParameters
- The array of parameters to add. These parameters must be either all strictly lower than the first knot,
or all strictly greater than the last knot.
- iContinuityOrders
- The iContinuityOrders at the additionnal arc limits ( shift of one with the parameters array)
This method returns an error when this is periodic.
o FirstVertexForOneArc
-
Retrieves the first control point which acts on an arc.
There is always Degree+1 control points acting on one arc. The
last point to act is then FirstVertexNum+Degree.
For advanced use.
The numbers start at 1.
o GetDegree
public INLINE short GetDegree( | )const |
-
Returns the degree of the basis defined by this CATKnotVector.
- Returns:
- The degree.
o GetIndexOffset
public INLINE short GetIndexOffset( | )const |
-
Returns the arc index offset.
- Returns:
- The arc index offset.
o GetInternalExtremities
public void GetInternalExtremities( | const CATLONG32 | iArc, |
| double& | ioLocalStart, |
| double& | ioLocalEnd) const |
-
Returns the local parameters on the arc iArc.
- Parameters:
-
- iArc
- The arc number. Begins at CATKnotVector::GetIndexOffset.
- ioLocalStart
- The parameter value at the begining of the arc.
- ioLocalEnd
- The parameter value at the end of the arc.
o GetKnotMultiplicity
-
Returns the multiplicity of this CATKnotVector knot value.
- Parameters:
-
- iKnotNum
- The knot number ( from 1 to KnotVector.GetNumberOfKnots )
o GetKnots
public INLINE void GetKnots( | const double*& | oKnots) const |
-
Returns the pointer to the knot values array of this CATKnotVector.
- Parameters:
-
- oKnots
- The array of the knots. As part of the knot vector, it is deleted at the knot vector deletion.
o GetMaxExtremities
public void GetMaxExtremities( | CATLONG32& | ioStartArc, |
| double& | ioLocalStart, |
| CATLONG32& | ioEndArc, |
| double& | ioLocalEnd) const |
-
Returns the maximum local parameters and arc number of this Knot vector.
- Parameters:
-
- ioStartArc
- The start arc.
- ioLocalStart
- The parameter value at the begining of ioStartArc.
- ioEndArc
- The end arc.
- ioLocalEnd
- The parameter value at the end of the arc of ioEndArc.
o GetNumberOfArcs
public INLINE short GetNumberOfArcs( | )const |
-
Returns the number of arcs of a nurbs using this CATKnotVector.
- Returns:
- The number of arcs.
o GetNumberOfControlPoints
public INLINE short GetNumberOfControlPoints( | )const |
-
Returns the number of necessary control points for a nurbs using this
CATKnotVector.
- Returns:
- The number of control points.
o GetNumberOfKnots
public INLINE short GetNumberOfKnots( | )const |
-
Returns the number of distinct knot values of this CATKnotVector.
- Returns:
- The number of distinct knot values.
o GetPolynomialBasisForAllArcs
public const CATMathPolynomX * const * GetPolynomialBasisForAllArcs( | )const |
-
Returns the array of pointers on the polynoms defined by this CATKnotVector.
For advanced use.
The returned array pointer is part of CATKnotVector local data.
This method must be recalled after any non const method applied on the CATKnotvector
The array consists of KnotVector.GetNumberOfArcs *( KnotVector.GetDegree + 1)
pointers on polynoms of degree KnotVector.GetDegree.
These polynoms are reparametrized in [0,Knots[ArcNum]-Knots[ArcNum-1]] where Arcnum
is the current arc number in array.
o GetPolynomialBasisForOneArc
public const CATMathPolynomX * const * GetPolynomialBasisForOneArc( | const CATLONG32& | iArcNum)const |
-
Returns the array of pointers on the polynoms defined by this CATKnotVector
involved in one arc.
For advanced use.
- Parameters:
-
- iArcNum
- The arc number starting at 1.
The returned array pointer is part of CATKnotVector local data.
This method must be recalled after any non const method applied on the CATKnotvector
The array consists of KnotVector.GetDegree + 1
pointers on polynoms of degree KnotVector.GetDegree.
These polynoms are reparametrized in [0,Knots[iArcNum +IndexOffset-1]-Knots[iArcNum +IndexOffset]].
o IsContinuousOnDomain
-
Tests whether a given continuity order of the related basis
is garanteed on a subparameter domain.
- Parameters:
-
- iContinuityOrder
- The global continuity (0,1,2) to test.
- iStartArcNum
- The number of the first arc of the domain.
- iEndArcNum
- The number of the last arc of the domain.
- Returns:
- The result of the test.
Legal values: TRUE if the continuity is garanteed, FALSE otherwise.
o IsPeriodic
-
Tests if a CATKnotVector defines a periodic basis.
- Returns:
-
- FALSE
- if the basis is not periodic
- TRUE
- if the basis is periodic (NOT SUPPORTED)
o IsUniform
-
Tests if a CATKnotVector defines a uniform basis.
- Returns:
-
- FALSE
- if the basis is not uniform
- TRUE
- if the basis is uniform
o MoveInExtendedKnotVector
-
Shifts a position into the expanded CATKnotVector.
For advanced use.
The extented knot vector is the array of knot values as many repeated as
the multiplicity order. The expanded vector of the introduction sample is
the following series:
- expanded knot
- 0, 0, 0, 0, 2, 8, 9, 9, 9, 9
- knot repetition
- 1, 2, 3, 4, 1, 1, 1, 2, 3, 4
- Parameters:
-
- ioKnotIndex
- The index (starting at 0) of the knot value of a CATKnotVector to shift
(resp being shifted).
- ioKnotRep
- The corresponding knot repetition value to shift (resp being shifted).
- iMove
- The shift to operate to the corresponding point into the expanded knot
vector.
CATLONG32 ioKnotIndex = 0, ioKnotRep = 2, iMove = 5;
KnotVector.MoveInExtendedKnotVector(ioKnotIndex,ioKnotRep,iMove)
cout << "new knot index=" << ioKnotIndex << endl;
cout << "corresponding knot repetition=" << ioKnotRep << endl;
gives
new knot index= 3
corresponding knot repetition= 1
o PolynomialBasisForAllArcs
-
Retrieves a bi-dimensional array of pointers on the polynoms defined by
this CATKnotVector.
For advanced use.
- Parameters:
-
- ioPolynom
- The array of KnotVector.GetNumberOfArcs
pointers on array of KnotVector.GetDegree + 1
pointers on polynoms of degree KnotVector.GetDegree.
These polynoms are reparametrized in [0,Knots[ArcNum]-Knots[ArcNum-1]] where Arcnum
is the current arc number in array.
If a pointer is NULL in the array, the polynom is created and you then have to deleted it after use.
o PolynomialBasisForOneArc
-
Retrieves an array of pointers on the polynoms defined by this CATKnotVector
involved in one arc.
For advanced use.
- Parameters:
-
- iArcNum
- The arc number.
- ioPolynom
- The array of KnotVector.GetDegree + 1
pointers on polynoms of degree KnotVector.GetDegree.
These polynoms are reparametrized in [0,Knots[iArcNum +IndexOffset-1]-Knots[iArcNum +IndexOffset]]
If a pointer is NULL in the array, the polynom is created and you then have to deleted it after use.
o SearchArcFromParameter
public CATLONG32 SearchArcFromParameter( | const double& | iGlobalParameter) const |
-
Returns the arc number of this CATKnotVector global parameter.
- Returns:
- The arc numbers start at 1.
o Set
public void Set( | const CATKnotVector& | iKnotVectorToCopy, |
| double | iCoefficient | =1., |
| double | iShift | =0. , |
| const CATTolerance& | iTolObject | =CATGetDefaultTolerance()) |
-
Copies a knot vector.
Optionally, redefines the parameterization by a linear transformation:
New parameter= iCoefficient * Old parameter + iShift.
- Parameters:
-
- iKnotVectorToCopy
- The knot vector to copy.
- iCoefficient
- The coefficient of the transformation.
- iShift
- The shift of the transformation.
o SetDegree
-
Modifies the degree.
- Parameters:
-
- iDegree
- The new degree value. If it is
higher, the continuity order between arcs remains unchanged.
If it is lower, the continuity order between arcs is limited to Degree -1.
o SetIndexOffset
public INLINE void SetIndexOffset( | const CATLONG32& | iOffset) |
-
Modifies the arc index offset.
- Parameters:
-
- iOffset
- The new value of the arc offset.
o SetKnotMultiplicity
-
Modifies a knot value multiplicity of this CATKnotVector.
- Parameters:
-
- iKnotNum
- The knot number ( from 1 to KnotVector.GetNumberOfKnots ).
- iNewKnotMultiplicity
- The new knot multiplicity.
o SetKnotValue
public void SetKnotValue( | const CATLONG32& | iKnotNum, |
| const double& | iNewKnotValue, |
| const CATTolerance& | iTolObject | =CATGetDefaultTolerance()) |
-
Modifies a knot value of this CATKnotVector.
- Parameters:
-
- iKnotNum
- The knot number ( from 1 to KnotVector.GetNumberOfKnots )
- iNewKnotValue
- The new knot value.
o SetNonUniformKnotVector
-
Redefines this as a non uniform CATKnotVector.
- Parameters:
-
- iDegree
- The new degree of the polynomial basis.
- iIsPeriodic
- The new periodicity.
legal values0.
- iKnotsCount
- The new number of knot values specified for the knot vector. The number of arcs
is iKnotsCount - 1.
- iKnots
- The array of the new global parameter values at the end of each arc.
- iMultiplicities
- The array of the new corresponding multiplicities.
- iIndexOffset
- The new index for the first arc.
o SetTolerance
public void SetTolerance( | const CATTolerance& | iTolObject | =CATGetDefaultTolerance()) |
-
o SetUniformKnotVector
public void SetUniformKnotVector( | const CATLONG32& | iDegree, |
| const CATLONG32& | iIsPeriodic, |
| const CATLONG32& | iArcsCount, |
| const double | iKnotStart | =0., |
| const double | iStep | =1., |
| const CATLONG32 | iIndexOffset | =0) |
-
Redefines this as a uniform CATKnotVector .
- Parameters:
-
- iDegree
- The new degree of the polynomial basis.
- iIsPeriodic
- The new periodicity.
legal values0.
- iArcsCount
- The new number of arcs.
- iKnotStart
- The new parameter value of the first knot.
- iStep
- The new uniform step value between two knots.
- iIndexOffset
- The new index for the first arc.
o operator =
-
Assignment operator.
Desallocates and reallocates the left operand, except if it is the
same object as the right operand (iKnotVectorToAffect).
Data Members
o _PrivateDoNotUseNotScaled_R18Restricted
public int _PrivateDoNotUseNotScaled_R18Restricted
-
This object is included in the file: CATKnotVector.h
If needed, your Imakefile.mk should include the module: CATGeometricObjects