MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
math::BSpline< V, T > Class Template Reference

Implementation of non-uniform B-Spline curves according to. More...

#include <bspline.h>

Public Types

typedef std::vector< T > KnotVector
 
typedef std::vector< V > PointVector
 

Public Member Functions

 BSpline (void)
 
void add_knot (T const &t)
 Adds a knot to the knot vector.
 
void add_point (V const &p)
 Adds a point to the control point vector.
 
bool empty (void) const
 Returns whether there are no points in this spline.
 
evaluate (T const &t) const
 Evalutes the B-Spline.
 
int get_degree (void) const
 Returns the degree of the spline segments.
 
KnotVector const & get_knots (void) const
 Returns the knot vector.
 
PointVector const & get_points (void) const
 Returns the point vector.
 
void reserve (std::size_t n_points)
 Reserves space for points and the knot vector.
 
void scale_knots (T const &min, T const &max)
 Scales the knots such that evaluation is valid in [min, max].
 
void set_degree (int degree)
 Sets the degree of spline segments.
 
void transform (math::Matrix4f const &transf)
 Transforms the B-Spline.
 
void uniform_knots (T const &min, T const &max)
 Initializes the knot vector to be uniform.
 

Detailed Description

template<class V, class T = float>
class math::BSpline< V, T >

Implementation of non-uniform B-Spline curves according to.

http://en.wikipedia.org/wiki/B-spline

A B-Spline of degree n is defined by at least n+1 control points. Let p be the number of control points, the spline is composed of p-n segments. The knot vector contains m = p+n+1 real values and defines the length of the segments with respect to t. The first and last n values in the knot vector are "extra knots" that specify Bezier end conditions. The remaining p-n+1 knot values define the segment lengths.

The spline is evaluated in a simple manner using the de Boor algorithm. The current implementation is inefficient for large p.

Definition at line 36 of file bspline.h.

Member Typedef Documentation

◆ KnotVector

template<class V , class T = float>
typedef std::vector<T> math::BSpline< V, T >::KnotVector

Definition at line 39 of file bspline.h.

◆ PointVector

template<class V , class T = float>
typedef std::vector<V> math::BSpline< V, T >::PointVector

Definition at line 40 of file bspline.h.

Constructor & Destructor Documentation

◆ BSpline()

template<class V , class T >
math::BSpline< V, T >::BSpline ( void  )
inline

Definition at line 94 of file bspline.h.

Member Function Documentation

◆ add_knot()

template<class V , class T >
void math::BSpline< V, T >::add_knot ( T const &  t)
inline

Adds a knot to the knot vector.

Definition at line 137 of file bspline.h.

◆ add_point()

template<class V , class T >
void math::BSpline< V, T >::add_point ( V const &  p)
inline

Adds a point to the control point vector.

Definition at line 130 of file bspline.h.

◆ empty()

template<class V , class T >
bool math::BSpline< V, T >::empty ( void  ) const

Returns whether there are no points in this spline.

Definition at line 101 of file bspline.h.

◆ evaluate()

template<class V , class T >
V math::BSpline< V, T >::evaluate ( T const &  t) const
inline

Evalutes the B-Spline.

Definition at line 197 of file bspline.h.

◆ get_degree()

template<class V , class T >
int math::BSpline< V, T >::get_degree ( void  ) const
inline

Returns the degree of the spline segments.

Definition at line 115 of file bspline.h.

◆ get_knots()

template<class V , class T >
BSpline< V, T >::KnotVector const & math::BSpline< V, T >::get_knots ( void  ) const
inline

Returns the knot vector.

Definition at line 190 of file bspline.h.

◆ get_points()

template<class V , class T >
BSpline< V, T >::PointVector const & math::BSpline< V, T >::get_points ( void  ) const
inline

Returns the point vector.

Definition at line 183 of file bspline.h.

◆ reserve()

template<class V , class T >
void math::BSpline< V, T >::reserve ( std::size_t  n_points)
inline

Reserves space for points and the knot vector.

Definition at line 122 of file bspline.h.

◆ scale_knots()

template<class V , class T >
void math::BSpline< V, T >::scale_knots ( T const &  min,
T const &  max 
)
inline

Scales the knots such that evaluation is valid in [min, max].

Definition at line 172 of file bspline.h.

◆ set_degree()

template<class V , class T >
void math::BSpline< V, T >::set_degree ( int  degree)
inline

Sets the degree of spline segments.

Definition at line 108 of file bspline.h.

◆ transform()

template<class V , class T >
void math::BSpline< V, T >::transform ( math::Matrix4f const &  transf)
inline

Transforms the B-Spline.

Definition at line 225 of file bspline.h.

◆ uniform_knots()

template<class V , class T >
void math::BSpline< V, T >::uniform_knots ( T const &  min,
T const &  max 
)
inline

Initializes the knot vector to be uniform.

Definition at line 144 of file bspline.h.


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