OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WBSpline Class Reference

A B-spline. More...

#include <WBSpline.h>

+ Collaboration diagram for WBSpline:

Public Member Functions

 WBSpline (int order, std::vector< WVector3d > deBoorPoints)
 Constructor for the spline that takes the order and de Boor points while constructing a normalized knotVector automatically. More...
 
 WBSpline (int order, std::vector< WVector3d > deBoorPoints, std::vector< double > knots)
 Constructor for the spline that takes the order de Boor points and knots as arguments. More...
 
 ~WBSpline ()
 Empty destructor. More...
 
std::vector< WVector3dgetDeBoorPoints ()
 Returns the stored de Boor points. More...
 
std::vector< double > getKnots ()
 Returns the stored knots. More...
 
int getOrder ()
 Returns the order of the spline. More...
 
void setDeBoorPoints (std::vector< WVector3d > deBoorPoints)
 Sets new de Boor points for the spline. More...
 
void setKnots (std::vector< double > knots)
 Sets new knots for the spline. More...
 
void setOrder (int order)
 Sets a new order for the spline. More...
 
void samplePoints (std::vector< WVector3d > *p, double resolution)
 Compute sample points on the spline for a given resolution. More...
 
WVector3d f (double t)
 Compute a single sample point on the spline for the given parameter. More...
 

Private Member Functions

double getAlpha_i_j (int _i, int _j)
 Compute the alpha of the de Boor algorithm for the given parameters. More...
 
WVector3d controlPoint_i_j (int _i, int _j)
 Compute a control point of the de Boor algorithm for the given parameters. More...
 

Private Attributes

int m_order
 The order of the spline. More...
 
std::vector< WVector3dm_deBoorPoints
 The de Boor points of the spline. More...
 
std::vector< double > m_knots
 The knots of the spline. More...
 
double m_t
 The parameter value of the last spline evaluation i.e. the last call to f(). More...
 

Detailed Description

A B-spline.

Author
Patrick Oesterling

Definition at line 36 of file WBSpline.h.

Constructor & Destructor Documentation

◆ WBSpline() [1/2]

WBSpline::WBSpline ( int  order,
std::vector< WVector3d deBoorPoints 
)

Constructor for the spline that takes the order and de Boor points while constructing a normalized knotVector automatically.

Parameters
orderOrder of the spline.
deBoorPointsThe de Boor points for the spline

Definition at line 29 of file WBSpline.cpp.

References m_deBoorPoints, m_knots, and m_order.

◆ WBSpline() [2/2]

WBSpline::WBSpline ( int  order,
std::vector< WVector3d deBoorPoints,
std::vector< double >  knots 
)

Constructor for the spline that takes the order de Boor points and knots as arguments.

Parameters
orderOrder of the spline.
deBoorPointsThe de Boor points for the spline
knotsThe knots for the spline

Definition at line 56 of file WBSpline.cpp.

References m_deBoorPoints, m_knots, and m_order.

◆ ~WBSpline()

WBSpline::~WBSpline ( )

Empty destructor.

Definition at line 63 of file WBSpline.cpp.

Member Function Documentation

◆ controlPoint_i_j()

WVector3d WBSpline::controlPoint_i_j ( int  _i,
int  _j 
)
private

Compute a control point of the de Boor algorithm for the given parameters.

Parameters
_iFirst recursion parameter.
_jSecond recursion parameter.
Returns
De Boor control point at (_i,_j).

Definition at line 162 of file WBSpline.cpp.

References getAlpha_i_j(), and m_deBoorPoints.

Referenced by f().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ f()

WVector3d WBSpline::f ( double  t)

Compute a single sample point on the spline for the given parameter.

Parameters
tparameter on spline curve.
Returns
Sample point on the curve at t.

Definition at line 67 of file WBSpline.cpp.

References controlPoint_i_j(), m_knots, m_order, and m_t.

Referenced by WBSplineSurface::f(), and samplePoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAlpha_i_j()

double WBSpline::getAlpha_i_j ( int  _i,
int  _j 
)
private

Compute the alpha of the de Boor algorithm for the given parameters.

Parameters
_iFirst recursion parameter.
_jSecond recursion parameter.
Returns
De Boor alpha for (_i,_j)

Definition at line 156 of file WBSpline.cpp.

References m_knots, m_order, and m_t.

Referenced by controlPoint_i_j().

+ Here is the caller graph for this function:

◆ getDeBoorPoints()

std::vector< WVector3d > WBSpline::getDeBoorPoints ( )

Returns the stored de Boor points.

Returns
The stored de Boor points

Definition at line 111 of file WBSpline.cpp.

References m_deBoorPoints.

◆ getKnots()

std::vector< double > WBSpline::getKnots ( )

Returns the stored knots.

Returns
The stored knots

Definition at line 116 of file WBSpline.cpp.

References m_knots.

◆ getOrder()

int WBSpline::getOrder ( )

Returns the order of the spline.

Returns
The order of the spline

Definition at line 121 of file WBSpline.cpp.

References m_order.

◆ samplePoints()

void WBSpline::samplePoints ( std::vector< WVector3d > *  p,
double  resolution 
)

Compute sample points on the spline for a given resolution.

The sample points are stored in the vector given by the first argument.

Parameters
pThe pointer for returning the sample points.
resolutionThe resolution of the sample points.

Definition at line 141 of file WBSpline.cpp.

References f(), and m_knots.

+ Here is the call graph for this function:

◆ setDeBoorPoints()

void WBSpline::setDeBoorPoints ( std::vector< WVector3d deBoorPoints)

Sets new de Boor points for the spline.

Parameters
deBoorPointsThe new de Boor points for the spline.

Definition at line 126 of file WBSpline.cpp.

References m_deBoorPoints.

◆ setKnots()

void WBSpline::setKnots ( std::vector< double >  knots)

Sets new knots for the spline.

Parameters
knotsThe new knots for the spline.

Definition at line 131 of file WBSpline.cpp.

References m_knots.

◆ setOrder()

void WBSpline::setOrder ( int  order)

Sets a new order for the spline.

Parameters
orderThe new order of the spline.

Definition at line 136 of file WBSpline.cpp.

References m_order.

Member Data Documentation

◆ m_deBoorPoints

std::vector< WVector3d > WBSpline::m_deBoorPoints
private

The de Boor points of the spline.

Definition at line 112 of file WBSpline.h.

Referenced by controlPoint_i_j(), getDeBoorPoints(), setDeBoorPoints(), and WBSpline().

◆ m_knots

std::vector<double> WBSpline::m_knots
private

The knots of the spline.

Definition at line 113 of file WBSpline.h.

Referenced by f(), getAlpha_i_j(), getKnots(), samplePoints(), setKnots(), and WBSpline().

◆ m_order

int WBSpline::m_order
private

The order of the spline.

Definition at line 111 of file WBSpline.h.

Referenced by f(), getAlpha_i_j(), getOrder(), setOrder(), and WBSpline().

◆ m_t

double WBSpline::m_t
private

The parameter value of the last spline evaluation i.e. the last call to f().

Definition at line 114 of file WBSpline.h.

Referenced by f(), and getAlpha_i_j().


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