Developer Documentation
ACG::BSplineCurveT< PointT > Class Template Reference

#include <AC>

Public Types

typedef PointT Point
 
typedef Point::value_type Scalar
 

Public Member Functions

 BSplineCurveT (unsigned int _degree=3)
 Constructor.
 
 BSplineCurveT (const BSplineCurveT &_curve)
 Copy Constructor.
 
 ~BSplineCurveT ()
 Destructor.
 
std::vector< Scalar > & get_knots ()
 get the knotvector of the bspline curve
 
void set_knots (std::vector< Scalar > _knots)
 set the knotvector of the bspline curve
 
Knotvectorget_knotvector_ref ()
 get a reference to the knotvector
 
void set_knotvector_type (Knotvector::KnotvectorType _type)
 set type of knotvector
 
Scalar get_knot (int _i)
 get knot i
 
Point & get_control_point (int _i)
 get control point i
 
void add_control_point (const Point &_cp)
 add a control point
 
void insert_control_point (int _idx, const Point &_cp)
 insert a control point at given index
 
void delete_control_point (int _idx)
 delete control point at given index
 
void set_control_point (int _idx, const Point &_cp)
 reset a control point
 
void set_control_polygon (std::vector< Point > &_control_polygon)
 set whole control polygon
 
void reset_control_polygon ()
 Clears the control polygon.
 
void print () const
 print information string
 
Point curvePoint (Scalar _u)
 
Point derivativeCurvePoint (Scalar _u, unsigned int _der)
 
std::vector< Point > deBoorAlgorithm (double _u)
 
void insertKnot (double _u)
 Inserts a new knot at parameter u.
 
unsigned int n_control_points () const
 Returns the number of control points.
 
unsigned int n_knots () const
 Returns the number of knots.
 
unsigned int degree () const
 Returns the spline degree.
 
void set_degree (unsigned int _degree)
 Sets the spline degree.
 
ACG::Vec2i span (double _t)
 
ACG::Vec2i interval (double _t)
 
void autocompute_knotvector (bool _auto)
 
void fixNumberOfControlPoints (bool _fix)
 
bool projected ()
 projected More...
 
void reverse ()
 Reverses the curve.
 
Scalar basisFunction (int _i, int _n, Scalar _t)
 
Scalar derivativeBasisFunction (int _i, int _n, Scalar _t, int _der)
 
Scalar lower () const
 Returns the lower parameter.
 
Scalar upper () const
 Returns the upper parameter.
 
void request_controlpoint_selections ()
 
void request_edge_selections ()
 
void release_controlpoint_selections ()
 
void release_edge_selections ()
 
bool controlpoint_selections_available () const
 
bool edge_selections_available () const
 
unsigned char & controlpoint_selection (unsigned int _i)
 
const unsigned char & controlpoint_selection (unsigned int _i) const
 
unsigned char & edge_selection (unsigned int _i)
 
const unsigned char & edge_selection (unsigned int _i) const
 
void select_controlpoint (unsigned int _pIdx)
 
void deselect_controlpoint (unsigned int _pIdx)
 
bool controlpoint_selected (unsigned int _pIdx) const
 
void select_edge (unsigned int _pIdx)
 
void deselect_edge (unsigned int _pIdx)
 
bool edge_selected (unsigned int _pIdx) const
 

Private Member Functions

template<class PropT >
void request_prop (unsigned int &_ref_count, PropT &_prop)
 
template<class PropT >
void release_prop (unsigned int &_ref_count, PropT &_prop)
 

Private Attributes

std::vector< Point > control_polygon_
 
Knotvector knotvector_
 
unsigned int degree_
 
bool autocompute_knotvector_
 
bool fix_number_control_points_
 
std::vector< unsigned char > cpselections_
 
std::vector< unsigned char > eselections_
 
unsigned int ref_count_cpselections_
 
unsigned int ref_count_eselections_
 

Detailed Description

template<class PointT>
class ACG::BSplineCurveT< PointT >

/.../BSplineCurveT.hh>

Brief Description.

A more elaborate description follows.

Definition at line 88 of file BSplineCurveT.hh.

Member Function Documentation

template<class PointT >
BSplineCurveT< PointT >::Scalar ACG::BSplineCurveT< PointT >::basisFunction ( int  _i,
int  _n,
Scalar  _t 
)

A Spline Basis Function

Parameters
_ithe i'th basis function
_nthe spline degree
_tthe parameter Returns N_i^p(_u)

Definition at line 341 of file BSplineCurveT.cc.

template<class PointT >
PointT ACG::BSplineCurveT< PointT >::curvePoint ( Scalar  _u)

Evaluates a spline curve at parameter _u

Parameters
_uthe parameter
Returns
the curve point

Definition at line 286 of file BSplineCurveT.cc.

template<class PointT >
std::vector< PointT > ACG::BSplineCurveT< PointT >::deBoorAlgorithm ( double  _u)

Evaluates the curve at parameter u using deBoor algorithm.

Parameters
_uthe parameter
Returns
triangular array of control points

Definition at line 407 of file BSplineCurveT.cc.

template<class PointT >
BSplineCurveT< PointT >::Scalar ACG::BSplineCurveT< PointT >::derivativeBasisFunction ( int  _i,
int  _n,
Scalar  _t,
int  _der 
)

Derivative of a Spline Basis Function

Parameters
_ithe i'th basis function
_nthe spline degree
_tthe parameter
_derthe _der'th derivative

Definition at line 380 of file BSplineCurveT.cc.

template<class PointT >
PointT ACG::BSplineCurveT< PointT >::derivativeCurvePoint ( Scalar  _u,
unsigned int  _der 
)

Returns the _derm'th derivative of a spline curve

Parameters
_uthe parameter
_derthe _derm'th derivative
Returns
the derivative

Definition at line 316 of file BSplineCurveT.cc.

template<class PointT >
ACG::Vec2i ACG::BSplineCurveT< PointT >::interval ( double  _t)

returns the index of the knots u and u+1 such that t in [u, u+1)

Parameters
_tthe parameter

Definition at line 493 of file BSplineCurveT.cc.

template<class PointT>
bool ACG::BSplineCurveT< PointT >::projected ( )
inline

projected

Todo:
This is a hack actually. review

Definition at line 201 of file BSplineCurveT.hh.

template<class PointT >
ACG::Vec2i ACG::BSplineCurveT< PointT >::span ( double  _t)

returns the basis functions which are unequal to zero at parameter t

Parameters
_tthe parameter

Definition at line 474 of file BSplineCurveT.cc.


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