CFx SDK Documentation  2020SP3
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OdGeKnotVector Class Reference

#include <GeKnotVector.h>

Public Member Functions

 OdGeKnotVector (double tol=1.e-9)
 
 OdGeKnotVector (int size, int growSize, double tol=1.e-9)
 
 OdGeKnotVector (int size, const double source[], double tol=1.e-9)
 
 OdGeKnotVector (int plusMult, const OdGeKnotVector &source)
 
 OdGeKnotVector (const OdGeKnotVector &source)
 
 OdGeKnotVector (const OdGeDoubleArray &source, double tol=1.e-9)
 
 ~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)
 
int growLength () const
 
OdGeKnotVectorsetGrowLength (int rowLength)
 
const double * getPtr () const
 
const double * asArrayPtr () const
 
double * asArrayPtr ()
 
OdGeKnotVectorset (int size, const double source[], double tol=1.e-9)
 
int multiplicityAt (double param) const
 

Protected Member Functions

bool isValid (OdUInt32 knotIndex) const
 

Protected Attributes

OdGeDoubleArray m_Data
 
double m_Tolerance
 

Friends

GE_TOOLKIT_EXPORT OdGeDoubleArraygetArray (OdGeKnotVector *p)
 
GE_TOOLKIT_EXPORT const OdGeDoubleArraygetArray (const OdGeKnotVector *p)
 

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 43 of file GeKnotVector.h.

Constructor & Destructor Documentation

◆ OdGeKnotVector() [1/6]

OdGeKnotVector::OdGeKnotVector ( double  tol = 1.e-9)
Parameters
tol[in] Knot equality tolerance.
size[in] Length of vector.
growSize[in] Length of future vector size increments.
plusMult[in] Multiplicity increment for each knot.
source[in] Object to be cloned.

◆ OdGeKnotVector() [2/6]

OdGeKnotVector::OdGeKnotVector ( int  size,
int  growSize,
double  tol = 1.e-9 
)

◆ OdGeKnotVector() [3/6]

OdGeKnotVector::OdGeKnotVector ( int  size,
const double  source[],
double  tol = 1.e-9 
)

◆ OdGeKnotVector() [4/6]

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

◆ OdGeKnotVector() [5/6]

OdGeKnotVector::OdGeKnotVector ( const OdGeKnotVector source)

◆ OdGeKnotVector() [6/6]

OdGeKnotVector::OdGeKnotVector ( const OdGeDoubleArray source,
double  tol = 1.e-9 
)

◆ ~OdGeKnotVector()

OdGeKnotVector::~OdGeKnotVector ( )

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

Returns true if an only if the specified parameter is between the first and last knots.

Parameters
param[in] Parameter to be tested.

◆ endParam()

double OdGeKnotVector::endParam ( ) const

Returns the last knot value of this vector.

◆ 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 ot 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

Returns true if and only if knot is a member of this vector within the knot equality tolerance.

◆ 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

◆ 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)

◆ operator=() [2/2]

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

◆ operator[]() [1/2]

double& OdGeKnotVector::operator[] ( int  i)
Parameters
i[in] Index of knot.
Returns
Returns or references the ith knot of the knot vector.

◆ operator[]() [2/2]

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

◆ physicalLength()

int OdGeKnotVector::physicalLength ( ) const

◆ 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 = 1.e-9 
)

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

Parameters
tol[in] Knot equality tolerance.
size[in] Length of 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  )

◆ 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.

Friends And Related Function Documentation

◆ getArray [1/2]

GE_TOOLKIT_EXPORT const OdGeDoubleArray& getArray ( const OdGeKnotVector p)
friend

◆ getArray [2/2]

Member Data Documentation

◆ m_Data

OdGeDoubleArray OdGeKnotVector::m_Data
protected

Definition at line 383 of file GeKnotVector.h.

◆ m_Tolerance

double OdGeKnotVector::m_Tolerance
protected

Definition at line 384 of file GeKnotVector.h.


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