CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OdGeKnotVector Class Reference

#include <GeKnotVector.h>

Public Member Functions

 OdGeKnotVector (double tol=globalKnotTolerance)
 
 OdGeKnotVector (int size, int growSize, double tol=globalKnotTolerance)
 
 OdGeKnotVector (int size, const double source[], double tol=globalKnotTolerance)
 
 OdGeKnotVector (int plusMult, const OdGeKnotVector &source)
 
 OdGeKnotVector (const OdGeKnotVector &source)
 
 OdGeKnotVector (const OdGeDoubleArray &source, double tol=globalKnotTolerance)
 
 ~OdGeKnotVector ()
 
OdGeKnotVectoroperator= (const OdGeKnotVector &knotVector)
 
OdGeKnotVectoroperator= (const OdGeDoubleArray &dblArray)
 
double & operator[] (int i)
 
double operator[] (int i) const
 
bool isEqualTo (const OdGeKnotVector &knotVector) const
 
double startParam () const
 
double endParam () const
 
int multiplicityAt (int knotIndex) const
 
int numIntervals () const
 
int getInterval (int order, double param, OdGeInterval &interval) const
 
void getDistinctKnots (OdGeDoubleArray &knots, OdGeIntArray *multiplicity=NULL) const
 
bool contains (double param) const
 
bool isOn (double knot) const
 
OdGeKnotVectorreverse ()
 
OdGeKnotVectorremoveAt (int knotIndex)
 
OdGeKnotVectorremoveSubVector (int startIndex, int endIndex)
 
OdGeKnotVectorinsertAt (int knotIndex, double knot, int multiplicity=1)
 
OdGeKnotVectorinsert (double param)
 
int append (double knot)
 
OdGeKnotVectorappend (OdGeKnotVector &tail, double knotRatio=0.0)
 
int split (double param, OdGeKnotVector *pKnotHead, int multLast, OdGeKnotVector *pKnotTail, int multFirst) const
 
OdGeKnotVectorsetRange (double lower, double upper)
 
double tolerance () const
 
OdGeKnotVectorsetTolerance (double tol)
 
int length () const
 
bool isEmpty () const
 
int logicalLength () const
 
OdGeKnotVectorsetLogicalLength (int size)
 
int physicalLength () const
 
OdGeKnotVectorsetPhysicalLength (int physLength)
 
int growLength () const
 
OdGeKnotVectorsetGrowLength (int rowLength)
 
const double * getPtr () const
 
const double * asArrayPtr () const
 
double * asArrayPtr ()
 
OdGeKnotVectorset (int size, const double source[], double tol=globalKnotTolerance)
 
int multiplicityAt (double param) const
 
OdGeDoubleArraygetArray ()
 
const OdGeDoubleArraygetArray () const
 

Static Public Attributes

static GE_STATIC_EXPORT const double globalKnotTolerance
 
static GE_STATIC_EXPORT const OdGeVector2d globalKnotTolerance2d
 

Protected Member Functions

bool isValid (OdUInt32 knotIndex) const
 

Protected Attributes

OdGeDoubleArray m_Data
 
double m_Tolerance
 

Detailed Description

This class represents an ordered series of monotonically increasing doubles used by spline entities.

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

Definition at line 44 of file GeKnotVector.h.

Constructor & Destructor Documentation

◆ OdGeKnotVector() [1/6]

OdGeKnotVector::OdGeKnotVector ( double  tol = globalKnotTolerance)

Constructor for the OdGeKnotVector class.

Parameters
tol[in] Knot equality tolerance.

◆ OdGeKnotVector() [2/6]

OdGeKnotVector::OdGeKnotVector ( int  size,
int  growSize,
double  tol = globalKnotTolerance 
)

Constructor for the OdGeKnotVector class.

Parameters
size[in] Physical length of the vector.
growSize[in] Length of the future vector size increments.
tol[in] Knot equality tolerance.

◆ OdGeKnotVector() [3/6]

OdGeKnotVector::OdGeKnotVector ( int  size,
const double  source[],
double  tol = globalKnotTolerance 
)

Constructor for the OdGeKnotVector class.

Parameters
size[in] Length of the vector.
source[in] An array of knot values to be copied.
tol[in] Knot equality tolerance.

◆ OdGeKnotVector() [4/6]

OdGeKnotVector::OdGeKnotVector ( int  plusMult,
const OdGeKnotVector source 
)

Constructor for the OdGeKnotVector class.

Parameters
plusMult[in] Multiplicity increment for each knot.
source[in] Object to be copied.

◆ OdGeKnotVector() [5/6]

OdGeKnotVector::OdGeKnotVector ( const OdGeKnotVector source)

Constructor for the OdGeKnotVector class.

Parameters
source[in] Object to be copied.

◆ OdGeKnotVector() [6/6]

OdGeKnotVector::OdGeKnotVector ( const OdGeDoubleArray source,
double  tol = globalKnotTolerance 
)

Constructor for the OdGeKnotVector class.

Parameters
source[in] An array of knot values to be copied.
tol[in] Knot equality tolerance.

◆ ~OdGeKnotVector()

OdGeKnotVector::~OdGeKnotVector ( )

Destructor for the OdGeKnotVector class.

Member Function Documentation

◆ append() [1/2]

int OdGeKnotVector::append ( double  knot)

Appends a single knot to this vector, and returns the value of the single knot.

Parameters
knot[in] New last knot value.

◆ append() [2/2]

OdGeKnotVector & OdGeKnotVector::append ( OdGeKnotVector tail,
double  knotRatio = 0.0 
)

Appends a vector to this vector, and returns a reference to this vector.

Parameters
tail[in] Knot vector to be appended.
knotRatio[in] Knot ratio.
Remarks
If knotRatio > 0, append performs a linear transformations on this vector and on tail, such that the ratio of their lengths is equal to knotRatio, and that tail immediately follows this vector. tail is modified by this operation.

◆ asArrayPtr() [1/2]

double * OdGeKnotVector::asArrayPtr ( )

Returns this vector as an array of doubles.

Remarks
The number of elements in this array is returned by logicalLength(), and set by setLogicalLength().

◆ asArrayPtr() [2/2]

const double * OdGeKnotVector::asArrayPtr ( ) const

Returns this vector as an array of doubles.

Remarks
The number of elements in this array is returned by logicalLength(), and set by setLogicalLength().

◆ contains()

bool OdGeKnotVector::contains ( double  param) const

Checks whether this knot vector contains the specified parameter.

Parameters
param[in] Parameter to be tested.
Returns
true if an only if the specified parameter is between the first and last knots.

◆ endParam()

double OdGeKnotVector::endParam ( ) const

Returns the last knot value of this vector.

◆ getArray() [1/2]

OdGeDoubleArray & OdGeKnotVector::getArray ( )

Returns an array of knot values.

◆ getArray() [2/2]

const OdGeDoubleArray & OdGeKnotVector::getArray ( ) const

Returns a constant array of knot values.

◆ getDistinctKnots()

void OdGeKnotVector::getDistinctKnots ( OdGeDoubleArray knots,
OdGeIntArray multiplicity = NULL 
) const

Returns the number of distinct knots.

Parameters
knots[in] Array of knots.
multiplicity[out] Receives an array of multiplicities (repetitions) of each knot.
Remarks
If consecutive knots are within the knot equality tolerance, the knots are considered identical, and their multiplicities combined.

◆ getInterval()

int OdGeKnotVector::getInterval ( int  order,
double  param,
OdGeInterval interval 
) const

Returns the knot interval, and the index of the knot interval, containing the point specified by param.

Parameters
order[in] The order of the spline.
param[in] Parameter to specify a point on the vector.
interval[out] Receives the interval containing the point specified by param.
Remarks
param must lie between the knot values indexed by order -1 and length() - order, where order is the order of the spline.

◆ getPtr()

const double * OdGeKnotVector::getPtr ( ) const

Returns this vector as an array of doubles.

Remarks
The number of elements in this array is returned by logicalLength(), and set by setLogicalLength().

◆ growLength()

int OdGeKnotVector::growLength ( ) const

Returns the length by which the array is set to grow automatically.

◆ insert()

OdGeKnotVector & OdGeKnotVector::insert ( double  param)

Inserts a knot in the appropriate knot interval as specified by param, and returns a reference to this vector.

Parameters
param[in] Parameter to specify a point on the vector.
Remarks
If the specified point is within the knot equality tolerance of another knot, said knot's multiplicity is incremented.

◆ insertAt()

OdGeKnotVector & OdGeKnotVector::insertAt ( int  knotIndex,
double  knot,
int  multiplicity = 1 
)

Inserts the specified knot the specified number of times at the specified index, and returns a reference to this vector.

Parameters
knotIndex[in] Knot index.
knot[in] Value to be inserted
multiplicity[in] Number of times to insert the knot.

◆ isEmpty()

bool OdGeKnotVector::isEmpty ( ) const

Returns true if and only if length() == 0.

◆ isEqualTo()

bool OdGeKnotVector::isEqualTo ( const OdGeKnotVector knotVector) const

Returns true if and only if knotVector is identical to this one.

Parameters
knotVector[in] Knot vector.

◆ isOn()

bool OdGeKnotVector::isOn ( double  knot) const

Checks whether the specified knot is a member of this vector within the knot equality tolerance.

Parameters
knot[in] Parameter to be tested.
Returns
true if and only if knot is a member of this vector.

◆ isValid()

bool OdGeKnotVector::isValid ( OdUInt32  knotIndex) const
protected

Returns true if and only if index < length()

Parameters
knotIndex[in] Knot index.

◆ length()

int OdGeKnotVector::length ( ) const

Returns the length of this vector.

◆ logicalLength()

int OdGeKnotVector::logicalLength ( ) const

Returns the logical length of this vector.

Remarks
The logical length is the number of elements in the array returned by asArrayPtr() and getPtr().

◆ multiplicityAt() [1/2]

int OdGeKnotVector::multiplicityAt ( double  param) const

Returns the knot multiplicity for the passed knot value.

Parameters
param[in] Knot value.

◆ multiplicityAt() [2/2]

int OdGeKnotVector::multiplicityAt ( int  knotIndex) const

Returns knot multiplicity (repetitions) of the knot value at the specified index.

Parameters
knotIndex[in] Knot index.
Remarks
If consecutive knots are within the knot equality tolerance, the knots are considered identical, and their multiplicities combined.

◆ numIntervals()

int OdGeKnotVector::numIntervals ( ) const

Returns the number of intervals between distinct knots.

Remarks
Consecutive knots are considered distinct if and only if they are not within the knot equality tolerance.

◆ operator=() [1/2]

OdGeKnotVector & OdGeKnotVector::operator= ( const OdGeDoubleArray dblArray)

Assignment operator for the OdGeKnotVector object.

Parameters
dblArray[in] Array of double values from which to create knots.
Returns
A reference to this OdGeKnotVector object.

◆ operator=() [2/2]

OdGeKnotVector & OdGeKnotVector::operator= ( const OdGeKnotVector knotVector)

Assignment operator for the OdGeKnotVector object.

Parameters
knotVector[in] Knot vector to assign.
Returns
A reference to this OdGeKnotVector object.

◆ operator[]() [1/2]

double & OdGeKnotVector::operator[] ( int  i)

References the ith knot of the knot vector.

Parameters
i[in] Index of knot.
Returns
Knot as a double value.

◆ operator[]() [2/2]

double OdGeKnotVector::operator[] ( int  i) const

Returns the ith knot of the knot vector.

Parameters
i[in] Index of knot.
Returns
Knot as a double value.

◆ physicalLength()

int OdGeKnotVector::physicalLength ( ) const

Returns the physical length of this vector.

Remarks
The physical length is the maximum logical length of the array before it automatically grows.

◆ removeAt()

OdGeKnotVector & OdGeKnotVector::removeAt ( int  knotIndex)

Removes the specified knot from this vector, and returns a reference to this vector.

Parameters
knotIndex[in] Knot index.

◆ removeSubVector()

OdGeKnotVector & OdGeKnotVector::removeSubVector ( int  startIndex,
int  endIndex 
)

Removes the specified range of knots from this vector, and returns a reference to this vector.

Parameters
startIndex[in] Index of the first knot to be removed.
endIndex[in] Index of the last knot to be removed.

◆ reverse()

OdGeKnotVector & OdGeKnotVector::reverse ( )

Reverses the order of this vector, and returns a reference to this vector.

◆ set()

OdGeKnotVector & OdGeKnotVector::set ( int  size,
const double  source[],
double  tol = globalKnotTolerance 
)

Sets the parameters for this vector according to the arguments, and returns a reference to this vector.

Parameters
size[in] Length of vector.
source[in] Array of parameters for this vector.
tol[in] Knot equality tolerance.
Returns
Reference to this vector.

◆ setGrowLength()

OdGeKnotVector & OdGeKnotVector::setGrowLength ( int  rowLength)

Set the length by which the array will grow automatically.

Parameters
rowLength[in] The length for the array automatic resizing.

◆ setLogicalLength()

OdGeKnotVector & OdGeKnotVector::setLogicalLength ( int  size)

Sets the logical length of this vector, and returns a reference to this vector.

Parameters
size[in] Logical length of vector.
Remarks
The logical length is the number of elements in the array returned by asArrayPtr() and getPtr().

◆ setPhysicalLength()

OdGeKnotVector & OdGeKnotVector::setPhysicalLength ( int  physLength)

Sets the physical length of this vector, and returns a reference to this vector.

Parameters
physLength[in] Physical length of vector.
Remarks
The physical length is the maximum logical length of the array before it automatically grows.

◆ setRange()

OdGeKnotVector & OdGeKnotVector::setRange ( double  lower,
double  upper 
)

Transforms this vector such that the first knot has a value of lower, and the last knot has a value of upper, and returns a reference to this vector.

Parameters
lower[in] New lower knot.
upper[in] New upper knot.

◆ setTolerance()

OdGeKnotVector & OdGeKnotVector::setTolerance ( double  tol)

Sets the knot equality tolerance for this vector, and returns a reference to this vector.

Parameters
tol[in] Knot equality tolerance.

◆ split()

int OdGeKnotVector::split ( double  param,
OdGeKnotVector pKnotHead,
int  multLast,
OdGeKnotVector pKnotTail,
int  multFirst 
) const

Splits this vector at the point corresponding to param.

Parameters
param[in] Parameter to specify a point on the vector.
pKnotHead[out] Receives the head portion of the split.
multLast[in] Multiplicity of the last knot in the head portion.
pKnotTail[out] Receives the tail portion of the split.
multFirst[in] Multiplicity of the first knot in the tail portion.

◆ startParam()

double OdGeKnotVector::startParam ( ) const

Returns the first knot value of this vector.

◆ tolerance()

double OdGeKnotVector::tolerance ( ) const

Returns the knot equality tolerance.

Member Data Documentation

◆ globalKnotTolerance

GE_STATIC_EXPORT const double OdGeKnotVector::globalKnotTolerance
static

Default knot tolerance.

Definition at line 50 of file GeKnotVector.h.

◆ globalKnotTolerance2d

GE_STATIC_EXPORT const OdGeVector2d OdGeKnotVector::globalKnotTolerance2d
static

Default knot tolerance for 2d knots.

Definition at line 54 of file GeKnotVector.h.

◆ m_Data

OdGeDoubleArray OdGeKnotVector::m_Data
protected

Definition at line 498 of file GeKnotVector.h.

◆ m_Tolerance

double OdGeKnotVector::m_Tolerance
protected

Definition at line 499 of file GeKnotVector.h.


The documentation for this class was generated from the following file: