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. More...
 
 BSplineCurveT (const BSplineCurveT &_curve)
 Copy Constructor. More...
 
BSplineCurveToperator= (const BSplineCurveT &)=default
 Use the default = operator.
 
 ~BSplineCurveT ()
 Destructor. More...
 
std::vector< Scalar > & get_knots ()
 get the knotvector of the bspline curve More...
 
void set_knots (std::vector< Scalar > _knots)
 set the knotvector of the bspline curve More...
 
Knotvectorget_knotvector_ref ()
 get a reference to the knotvector More...
 
void set_knotvector_type (Knotvector::KnotvectorType _type)
 set type of knotvector More...
 
Scalar get_knot (int _i)
 get knot i More...
 
Point & get_control_point (int _i)
 get control point i More...
 
void add_control_point (const Point &_cp)
 add a control point More...
 
void insert_control_point (int _idx, const Point &_cp)
 insert a control point at given index More...
 
void delete_control_point (int _idx)
 delete control point at given index More...
 
void set_control_point (int _idx, const Point &_cp)
 reset a control point More...
 
void set_control_polygon (std::vector< Point > &_control_polygon)
 set whole control polygon More...
 
void reset_control_polygon ()
 Clears the control polygon. More...
 
void print () const
 print information string More...
 
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. More...
 
unsigned int n_control_points () const
 Returns the number of control points. More...
 
unsigned int n_knots () const
 Returns the number of knots. More...
 
unsigned int degree () const
 Returns the spline degree. More...
 
void set_degree (unsigned int _degree)
 Sets the spline degree. More...
 
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. More...
 
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. More...
 
Scalar upper () const
 Returns the upper parameter. More...
 
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 82 of file BSplineCurveT.hh.

Member Typedef Documentation

◆ Point

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

Definition at line 87 of file BSplineCurveT.hh.

◆ Scalar

template<class PointT >
typedef Point::value_type ACG::BSplineCurveT< PointT >::Scalar

Definition at line 88 of file BSplineCurveT.hh.

Constructor & Destructor Documentation

◆ BSplineCurveT() [1/2]

template<class PointT >
ACG::BSplineCurveT< PointT >::BSplineCurveT ( unsigned int  _degree = 3)

Constructor.

Definition at line 75 of file BSplineCurveT_impl.hh.

◆ BSplineCurveT() [2/2]

template<class PointT >
ACG::BSplineCurveT< PointT >::BSplineCurveT ( const BSplineCurveT< PointT > &  _curve)

Copy Constructor.

Definition at line 88 of file BSplineCurveT_impl.hh.

◆ ~BSplineCurveT()

template<class PointT >
ACG::BSplineCurveT< PointT >::~BSplineCurveT ( )
inline

Destructor.

Definition at line 100 of file BSplineCurveT.hh.

Member Function Documentation

◆ add_control_point()

template<class PointT >
void ACG::BSplineCurveT< PointT >::add_control_point ( const Point &  _cp)

add a control point

Definition at line 148 of file BSplineCurveT_impl.hh.

◆ autocompute_knotvector()

template<class PointT >
void ACG::BSplineCurveT< PointT >::autocompute_knotvector ( bool  _auto)
inline

Definition at line 190 of file BSplineCurveT.hh.

◆ basisFunction()

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 334 of file BSplineCurveT_impl.hh.

◆ controlpoint_selected()

template<class PointT >
bool ACG::BSplineCurveT< PointT >::controlpoint_selected ( unsigned int  _pIdx) const
inline

Definition at line 272 of file BSplineCurveT.hh.

◆ controlpoint_selection() [1/2]

template<class PointT >
unsigned char & ACG::BSplineCurveT< PointT >::controlpoint_selection ( unsigned int  _i)
inline

Definition at line 248 of file BSplineCurveT.hh.

◆ controlpoint_selection() [2/2]

template<class PointT >
const unsigned char & ACG::BSplineCurveT< PointT >::controlpoint_selection ( unsigned int  _i) const
inline

Definition at line 253 of file BSplineCurveT.hh.

◆ controlpoint_selections_available()

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

Definition at line 243 of file BSplineCurveT.hh.

◆ curvePoint()

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 279 of file BSplineCurveT_impl.hh.

◆ deBoorAlgorithm()

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 400 of file BSplineCurveT_impl.hh.

◆ degree()

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::degree ( ) const
inline

Returns the spline degree.

Definition at line 173 of file BSplineCurveT.hh.

◆ delete_control_point()

template<class PointT >
void ACG::BSplineCurveT< PointT >::delete_control_point ( int  _idx)

delete control point at given index

Definition at line 204 of file BSplineCurveT_impl.hh.

◆ derivativeBasisFunction()

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 373 of file BSplineCurveT_impl.hh.

◆ derivativeCurvePoint()

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 309 of file BSplineCurveT_impl.hh.

◆ deselect_controlpoint()

template<class PointT >
void ACG::BSplineCurveT< PointT >::deselect_controlpoint ( unsigned int  _pIdx)
inline

Definition at line 270 of file BSplineCurveT.hh.

◆ deselect_edge()

template<class PointT >
void ACG::BSplineCurveT< PointT >::deselect_edge ( unsigned int  _pIdx)
inline

Definition at line 275 of file BSplineCurveT.hh.

◆ edge_selected()

template<class PointT >
bool ACG::BSplineCurveT< PointT >::edge_selected ( unsigned int  _pIdx) const
inline

Definition at line 277 of file BSplineCurveT.hh.

◆ edge_selection() [1/2]

template<class PointT >
unsigned char & ACG::BSplineCurveT< PointT >::edge_selection ( unsigned int  _i)
inline

Definition at line 259 of file BSplineCurveT.hh.

◆ edge_selection() [2/2]

template<class PointT >
const unsigned char & ACG::BSplineCurveT< PointT >::edge_selection ( unsigned int  _i) const
inline

Definition at line 263 of file BSplineCurveT.hh.

◆ edge_selections_available()

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

Definition at line 244 of file BSplineCurveT.hh.

◆ fixNumberOfControlPoints()

template<class PointT >
void ACG::BSplineCurveT< PointT >::fixNumberOfControlPoints ( bool  _fix)
inline

Definition at line 192 of file BSplineCurveT.hh.

◆ get_control_point()

template<class PointT >
Point & ACG::BSplineCurveT< PointT >::get_control_point ( int  _i)
inline

get control point i

Definition at line 118 of file BSplineCurveT.hh.

◆ get_knot()

template<class PointT >
Scalar ACG::BSplineCurveT< PointT >::get_knot ( int  _i)
inline

get knot i

Definition at line 115 of file BSplineCurveT.hh.

◆ get_knots()

template<class PointT >
std::vector< Scalar > & ACG::BSplineCurveT< PointT >::get_knots ( )
inline

get the knotvector of the bspline curve

Definition at line 103 of file BSplineCurveT.hh.

◆ get_knotvector_ref()

template<class PointT >
Knotvector * ACG::BSplineCurveT< PointT >::get_knotvector_ref ( )
inline

get a reference to the knotvector

Definition at line 109 of file BSplineCurveT.hh.

◆ insert_control_point()

template<class PointT >
void ACG::BSplineCurveT< PointT >::insert_control_point ( int  _idx,
const Point &  _cp 
)

insert a control point at given index

Definition at line 173 of file BSplineCurveT_impl.hh.

◆ insertKnot()

template<class PointT >
void ACG::BSplineCurveT< PointT >::insertKnot ( double  _u)

Inserts a new knot at parameter u.

Definition at line 514 of file BSplineCurveT_impl.hh.

◆ interval()

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 486 of file BSplineCurveT_impl.hh.

◆ lower()

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

Returns the lower parameter.

Definition at line 447 of file BSplineCurveT_impl.hh.

◆ n_control_points()

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::n_control_points ( ) const
inline

Returns the number of control points.

Definition at line 167 of file BSplineCurveT.hh.

◆ n_knots()

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::n_knots ( ) const
inline

Returns the number of knots.

Definition at line 170 of file BSplineCurveT.hh.

◆ print()

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

print information string

Definition at line 500 of file BSplineCurveT_impl.hh.

◆ projected()

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

projected

Todo:
This is a hack actually. review

Definition at line 198 of file BSplineCurveT.hh.

◆ release_controlpoint_selections()

template<class PointT >
void ACG::BSplineCurveT< PointT >::release_controlpoint_selections ( )
inline

Definition at line 239 of file BSplineCurveT.hh.

◆ release_edge_selections()

template<class PointT >
void ACG::BSplineCurveT< PointT >::release_edge_selections ( )
inline

Definition at line 240 of file BSplineCurveT.hh.

◆ release_prop()

template<class PointT >
template<class PropT >
void ACG::BSplineCurveT< PointT >::release_prop ( unsigned int &  _ref_count,
PropT &  _prop 
)
private

Definition at line 133 of file BSplineCurveT_impl.hh.

◆ request_controlpoint_selections()

template<class PointT >
void ACG::BSplineCurveT< PointT >::request_controlpoint_selections ( )
inline

Definition at line 235 of file BSplineCurveT.hh.

◆ request_edge_selections()

template<class PointT >
void ACG::BSplineCurveT< PointT >::request_edge_selections ( )
inline

Definition at line 236 of file BSplineCurveT.hh.

◆ request_prop()

template<class PointT >
template<class PropT >
void ACG::BSplineCurveT< PointT >::request_prop ( unsigned int &  _ref_count,
PropT &  _prop 
)
private

Definition at line 116 of file BSplineCurveT_impl.hh.

◆ reset_control_polygon()

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

Clears the control polygon.

Definition at line 265 of file BSplineCurveT_impl.hh.

◆ reverse()

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

Reverses the curve.

Definition at line 570 of file BSplineCurveT_impl.hh.

◆ select_controlpoint()

template<class PointT >
void ACG::BSplineCurveT< PointT >::select_controlpoint ( unsigned int  _pIdx)
inline

Definition at line 269 of file BSplineCurveT.hh.

◆ select_edge()

template<class PointT >
void ACG::BSplineCurveT< PointT >::select_edge ( unsigned int  _pIdx)
inline

Definition at line 274 of file BSplineCurveT.hh.

◆ set_control_point()

template<class PointT >
void ACG::BSplineCurveT< PointT >::set_control_point ( int  _idx,
const Point &  _cp 
)

reset a control point

Definition at line 233 of file BSplineCurveT_impl.hh.

◆ set_control_polygon()

template<class PointT >
void ACG::BSplineCurveT< PointT >::set_control_polygon ( std::vector< Point > &  _control_polygon)

set whole control polygon

Definition at line 244 of file BSplineCurveT_impl.hh.

◆ set_degree()

template<class PointT >
void ACG::BSplineCurveT< PointT >::set_degree ( unsigned int  _degree)
inline

Sets the spline degree.

Definition at line 176 of file BSplineCurveT.hh.

◆ set_knots()

template<class PointT >
void ACG::BSplineCurveT< PointT >::set_knots ( std::vector< Scalar >  _knots)

set the knotvector of the bspline curve

Definition at line 557 of file BSplineCurveT_impl.hh.

◆ set_knotvector_type()

template<class PointT >
void ACG::BSplineCurveT< PointT >::set_knotvector_type ( Knotvector::KnotvectorType  _type)
inline

set type of knotvector

Definition at line 112 of file BSplineCurveT.hh.

◆ span()

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 467 of file BSplineCurveT_impl.hh.

◆ upper()

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

Returns the upper parameter.

Definition at line 457 of file BSplineCurveT_impl.hh.

Member Data Documentation

◆ autocompute_knotvector_

template<class PointT >
bool ACG::BSplineCurveT< PointT >::autocompute_knotvector_
private

Definition at line 296 of file BSplineCurveT.hh.

◆ control_polygon_

template<class PointT >
std::vector<Point> ACG::BSplineCurveT< PointT >::control_polygon_
private

Definition at line 290 of file BSplineCurveT.hh.

◆ cpselections_

template<class PointT >
std::vector<unsigned char> ACG::BSplineCurveT< PointT >::cpselections_
private

Definition at line 305 of file BSplineCurveT.hh.

◆ degree_

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::degree_
private

Definition at line 294 of file BSplineCurveT.hh.

◆ eselections_

template<class PointT >
std::vector<unsigned char> ACG::BSplineCurveT< PointT >::eselections_
private

Definition at line 308 of file BSplineCurveT.hh.

◆ fix_number_control_points_

template<class PointT >
bool ACG::BSplineCurveT< PointT >::fix_number_control_points_
private

Definition at line 298 of file BSplineCurveT.hh.

◆ knotvector_

template<class PointT >
Knotvector ACG::BSplineCurveT< PointT >::knotvector_
private

Definition at line 292 of file BSplineCurveT.hh.

◆ ref_count_cpselections_

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::ref_count_cpselections_
private

Definition at line 311 of file BSplineCurveT.hh.

◆ ref_count_eselections_

template<class PointT >
unsigned int ACG::BSplineCurveT< PointT >::ref_count_eselections_
private

Definition at line 312 of file BSplineCurveT.hh.


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