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

#include <ObjectTypes/BSplineSurface/BSplineSurfaceT.hh>

Public Types

typedef PointT Point
 
typedef Point::value_type Scalar
 
typedef std::vector< std::vector< Point > > ControlNet
 
typedef std::vector< std::vector< unsigned char > > PropertyNet
 

Public Member Functions

 BSplineSurfaceT (unsigned int _degm=3, unsigned int _degn=3)
 Constructor. More...
 
void resize (unsigned int _m, unsigned int _n)
 Resizes the spline struct. More...
 
std::vector< Scalar > & get_knots_m ()
 get the knotvector in m direction of the bspline surface
 
std::vector< Scalar > & get_knots_n ()
 get the knotvector in m direction of the bspline surface
 
Knotvector get_knotvector_m ()
 Get the knotvector in m direction.
 
Knotvector get_knotvector_n ()
 Get the knotvector in n direction.
 
Knotvectorget_knotvector_m_ref ()
 Get a reference to the knotvector in m direction.
 
Knotvectorget_knotvector_n_ref ()
 Get a reference to the knotvector in n direction.
 
Scalar get_knot_m (int _i)
 Get knot i in m direction. More...
 
Scalar get_knot_n (int _i)
 Get knot i in n direction. More...
 
void set_knots_m (std::vector< Scalar > _knots)
 Set the knotvector of the bspline surface in m direction. More...
 
void set_knots_n (std::vector< Scalar > _knots)
 Set the knotvector of the bspline surface in n direction. More...
 
void insert_knot_m (double _t)
 Insert a knot i in m direction without changing the surface. More...
 
void insert_knot_n (double _t)
 Insert a knot i in n direction without changing the surface. More...
 
void createKnots ()
 Creates interpolating knotvectors 0...0, 1, 2, ..., n...n.
 
void set_degree (unsigned int _degm, unsigned int _degn)
 Sets the degree of the spline surface. More...
 
int degree_m () const
 Returns the spline degree in m direction.
 
int degree_n () const
 Returns the spline degree in n direction.
 
unsigned int n_control_points_m () const
 Returns the number of controlpoints in m direction.
 
unsigned int n_control_points_n () const
 Returns the number of controlpoints in n direction.
 
unsigned int n_knots_m ()
 Returns the number of knots in m direction.
 
unsigned int n_knots_n ()
 Returns the number of knots in n direction.
 
void reset_control_net ()
 Clears the control net.
 
Point & get_control_point (unsigned int _m, unsigned int _n)
 Returns a reference to the control point (m, n) More...
 
Point & operator() (unsigned int _m, unsigned int _n)
 Returns a reference to the control point (m, n) More...
 
const Point & operator() (unsigned int _m, unsigned int _n) const
 Returns a const reference to the control point (m, n) More...
 
Point & operator() (Vec2i _param)
 Returns a reference to the control point (m, n) More...
 
const Point & operator() (Vec2i _param) const
 Returns a const reference to the control point (m, n) More...
 
void get_vector_m (std::vector< Point > &_control_polygon, unsigned int _m)
 Returns an n control point vector. More...
 
void get_vector_n (std::vector< Point > &_control_polygon, unsigned int _n)
 Returns an m ctrPointVector. More...
 
void add_vector_m (const std::vector< Point > &_control_polygon)
 Adds a control point n-vector. More...
 
void add_vector_n (const std::vector< Point > &_control_polygon)
 Adds a control point m-vector. More...
 
void insert_vector_m (const std::vector< Point > &_control_polygon, unsigned int _m)
 Inserts an n control point vector. More...
 
void insert_vector_n (const std::vector< Point > &_control_polygon, unsigned int _n)
 Inserts an m control point vector. More...
 
void delete_vector_m (unsigned int _m)
 Deletes an n control point vector. More...
 
void delete_vector_n (unsigned int _n)
 Deletes an m control point vector. More...
 
Point surfacePoint (double _u, double _v)
 Evaluates a spline surface at parameters _u and _v. More...
 
void surfacePointNormal (Point &_pt, Point &_normal, double _u, double _v)
 Evaluates a spline surface at parameters _u and _v. More...
 
Point surfacePoint_rec (double _u, double _v)
 Evaluates a spline surface at parameters _u and _v. More...
 
Point derivativeSurfacePoint (double _u, double _v, int _derm, int _dern)
 Returns the _derm'th derivative of a spline surface. More...
 
Point normalSurfacePoint (double _u, double _v)
 Returns the normal of a spline surface. More...
 
Scalar basisFunction (Knotvector &_knotvector, int _i, int _n, double _t)
 A Spline Basis Function. More...
 
Scalar derivativeBasisFunction (Knotvector &_knotvector, int _i, int _n, double _t, int _der)
 Derivative of a Spline Basis Function. More...
 
ACG::Vec2i spanm (double _t)
 Returns the basis functions which are unequal to zero at parameter u. More...
 
ACG::Vec2i spann (double _t)
 Returns the basis functions which are unequal to zero at parameter v. More...
 
ACG::Vec2i interval_m (double _t)
 Returns the index of the knots u and u+1 such that t in [u, u+1) More...
 
ACG::Vec2i interval_n (double _t)
 Returns the index of the knots v and v+1 such that t in [v, v+1) More...
 
Scalar loweru ()
 Returns the lower u parameter.
 
Scalar upperu ()
 Returns the upper u parameter.
 
Scalar lowerv ()
 Returns the lower v parameter.
 
Scalar upperv ()
 Returns the upper v parameter.
 
void request_controlpoint_selections ()
 request control point selection property
 
void request_edge_selections ()
 request edge selection property
 
void release_controlpoint_selections ()
 release control point selection property
 
void release_edge_selections ()
 release edge selection property
 
bool controlpoint_selections_available () const
 Check if control point selection property is available.
 
bool edge_selections_available () const
 Check if edge selection property is available.
 
unsigned char & controlpoint_selection (unsigned int _i, unsigned int _j)
 
const unsigned char & controlpoint_selection (unsigned int _i, unsigned int _j) const
 
unsigned char & edge_selection (unsigned int _i, unsigned int _j)
 
const unsigned char & edge_selection (unsigned int _i, unsigned int _j) const
 
void select_controlpoint (unsigned int _iIdx, unsigned int _jIdx)
 
void deselect_controlpoint (unsigned int _iIdx, unsigned int _jIdx)
 
bool controlpoint_selected (unsigned int _iIdx, unsigned int _jIdx) 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

unsigned int dimm_
 number of control points in m direction
 
unsigned int dimn_
 number of control points in n direction
 
unsigned int degree_m_
 Spline degree in m direction.
 
unsigned int degree_n_
 Spline degree in n direction.
 
Knotvector knotvector_m_
 Knotvector in m direction.
 
Knotvector knotvector_n_
 Knotvector in n direction.
 
ControlNet control_net_
 
PropertyNet cpselections_
 list of control point properties
 
PropertyNet eselections_
 list of edge properties
 
unsigned int ref_count_cpselections_
 
unsigned int ref_count_eselections_
 

Detailed Description

template<class PointT>
class ACG::BSplineSurfaceT< PointT >

Brief Description.

A more elaborate description follows.

Definition at line 82 of file BSplineSurfaceT.hh.

Constructor & Destructor Documentation

◆ BSplineSurfaceT()

template<class PointT >
ACG::BSplineSurfaceT< PointT >::BSplineSurfaceT ( unsigned int  _degm = 3,
unsigned int  _degn = 3 
)
explicit

Constructor.

Parameters
_degmDegree in m direction
_degnDegree in n direction

Definition at line 75 of file BSplineSurfaceT_impl.hh.

Member Function Documentation

◆ add_vector_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::add_vector_m ( const std::vector< Point > &  _control_polygon)

Adds a control point n-vector.

Parameters
_control_polygonAdditional control point vector

Definition at line 187 of file BSplineSurfaceT_impl.hh.

◆ add_vector_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::add_vector_n ( const std::vector< Point > &  _control_polygon)

Adds a control point m-vector.

Parameters
_control_polygonAdditional control point vector

Definition at line 197 of file BSplineSurfaceT_impl.hh.

◆ basisFunction()

template<class PointT >
BSplineSurfaceT< PointT >::Scalar ACG::BSplineSurfaceT< PointT >::basisFunction ( Knotvector _knotvector,
int  _i,
int  _n,
double  _t 
)

A Spline Basis Function.

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

Definition at line 604 of file BSplineSurfaceT_impl.hh.

◆ delete_vector_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::delete_vector_m ( unsigned int  _m)

Deletes an n control point vector.

Parameters
_mthe m'th pointvector
Todo:
Improve deletion routine for control points and knots!

Definition at line 275 of file BSplineSurfaceT_impl.hh.

◆ delete_vector_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::delete_vector_n ( unsigned int  _n)

Deletes an m control point vector.

Parameters
_nthe n'th pointvector
Todo:
: Improve deletion routine for control points and knots!

Definition at line 302 of file BSplineSurfaceT_impl.hh.

◆ derivativeBasisFunction()

template<class PointT >
BSplineSurfaceT< PointT >::Scalar ACG::BSplineSurfaceT< PointT >::derivativeBasisFunction ( Knotvector _knotvector,
int  _i,
int  _n,
double  _t,
int  _der 
)

Derivative of a Spline Basis Function.

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

Definition at line 692 of file BSplineSurfaceT_impl.hh.

◆ derivativeSurfacePoint()

template<class PointT >
PointT ACG::BSplineSurfaceT< PointT >::derivativeSurfacePoint ( double  _u,
double  _v,
int  _derm,
int  _dern 
)

Returns the _derm'th derivative of a spline surface.

Parameters
_uthe parameter in u direction
_vthe parameter in v direction
_dermthe _derm'th derivative in m
_dernthe _dern'th derivative in n
Returns
the derivative

Definition at line 642 of file BSplineSurfaceT_impl.hh.

◆ get_control_point()

template<class PointT>
Point& ACG::BSplineSurfaceT< PointT >::get_control_point ( unsigned int  _m,
unsigned int  _n 
)
inline

Returns a reference to the control point (m, n)

Parameters
_m,_nthe control point index

Definition at line 193 of file BSplineSurfaceT.hh.

◆ get_knot_m()

template<class PointT>
Scalar ACG::BSplineSurfaceT< PointT >::get_knot_m ( int  _i)
inline

Get knot i in m direction.

Parameters
_iKnot index
Returns
Knot i

Definition at line 127 of file BSplineSurfaceT.hh.

◆ get_knot_n()

template<class PointT>
Scalar ACG::BSplineSurfaceT< PointT >::get_knot_n ( int  _i)
inline

Get knot i in n direction.

Parameters
_iKnot index
Returns
Knot i

Definition at line 134 of file BSplineSurfaceT.hh.

◆ get_vector_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::get_vector_m ( std::vector< Point > &  _control_polygon,
unsigned int  _m 
)

Returns an n control point vector.

Parameters
_mthe m'th pointvector
_control_polygonthe returned pointvector

Definition at line 333 of file BSplineSurfaceT_impl.hh.

◆ get_vector_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::get_vector_n ( std::vector< Point > &  _control_polygon,
unsigned int  _n 
)

Returns an m ctrPointVector.

Parameters
_nthe n'th pointvector
_control_polygonthe returned pointvector

Definition at line 344 of file BSplineSurfaceT_impl.hh.

◆ insert_knot_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::insert_knot_m ( double  _t)

Insert a knot i in m direction without changing the surface.

Parameters
_tParameter value

Definition at line 380 of file BSplineSurfaceT_impl.hh.

◆ insert_knot_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::insert_knot_n ( double  _t)

Insert a knot i in n direction without changing the surface.

Parameters
_tParameter value

Definition at line 424 of file BSplineSurfaceT_impl.hh.

◆ insert_vector_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::insert_vector_m ( const std::vector< Point > &  _control_polygon,
unsigned int  _m 
)

Inserts an n control point vector.

Parameters
_mthe position in m direction
_control_polygonthe pointvector to be inserted

Definition at line 207 of file BSplineSurfaceT_impl.hh.

◆ insert_vector_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::insert_vector_n ( const std::vector< Point > &  _control_polygon,
unsigned int  _n 
)

Inserts an m control point vector.

Parameters
_nthe position in n direction
_control_polygonthe pointvector to be inserted

Definition at line 240 of file BSplineSurfaceT_impl.hh.

◆ interval_m()

template<class PointT >
ACG::Vec2i ACG::BSplineSurfaceT< PointT >::interval_m ( 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 777 of file BSplineSurfaceT_impl.hh.

◆ interval_n()

template<class PointT >
ACG::Vec2i ACG::BSplineSurfaceT< PointT >::interval_n ( double  _t)

Returns the index of the knots v and v+1 such that t in [v, v+1)

Parameters
_tthe parameter

Definition at line 797 of file BSplineSurfaceT_impl.hh.

◆ normalSurfacePoint()

template<class PointT >
PointT ACG::BSplineSurfaceT< PointT >::normalSurfacePoint ( double  _u,
double  _v 
)

Returns the normal of a spline surface.

Parameters
_uthe parameter in u direction
_vthe parameter in v direction
Returns
the normal

Definition at line 674 of file BSplineSurfaceT_impl.hh.

◆ operator()() [1/4]

template<class PointT>
Point& ACG::BSplineSurfaceT< PointT >::operator() ( unsigned int  _m,
unsigned int  _n 
)
inline

Returns a reference to the control point (m, n)

Parameters
_m,_nthe control point index

Definition at line 203 of file BSplineSurfaceT.hh.

◆ operator()() [2/4]

template<class PointT>
const Point& ACG::BSplineSurfaceT< PointT >::operator() ( unsigned int  _m,
unsigned int  _n 
) const
inline

Returns a const reference to the control point (m, n)

Parameters
_m,_nthe control point index

Definition at line 213 of file BSplineSurfaceT.hh.

◆ operator()() [3/4]

template<class PointT>
Point& ACG::BSplineSurfaceT< PointT >::operator() ( Vec2i  _param)
inline

Returns a reference to the control point (m, n)

Parameters
_paramthe control point index

Definition at line 223 of file BSplineSurfaceT.hh.

◆ operator()() [4/4]

template<class PointT>
const Point& ACG::BSplineSurfaceT< PointT >::operator() ( Vec2i  _param) const
inline

Returns a const reference to the control point (m, n)

Parameters
_paramthe control point index

Definition at line 233 of file BSplineSurfaceT.hh.

◆ resize()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::resize ( unsigned int  _m,
unsigned int  _n 
)

Resizes the spline struct.

You usually shoudn't have to care about this I will probably make it private...

Parameters
_msize in m direction
_nsize in n direction

Definition at line 125 of file BSplineSurfaceT_impl.hh.

◆ set_degree()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::set_degree ( unsigned int  _degm,
unsigned int  _degn 
)

Sets the degree of the spline surface.

Parameters
_degmDegree in m direction
_degnDegree in n direction

Definition at line 176 of file BSplineSurfaceT_impl.hh.

◆ set_knots_m()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::set_knots_m ( std::vector< Scalar >  _knots)

Set the knotvector of the bspline surface in m direction.

Parameters
_knotsThe new knots

Definition at line 358 of file BSplineSurfaceT_impl.hh.

◆ set_knots_n()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::set_knots_n ( std::vector< Scalar >  _knots)

Set the knotvector of the bspline surface in n direction.

Parameters
_knotsThe new knots

Definition at line 369 of file BSplineSurfaceT_impl.hh.

◆ spanm()

template<class PointT >
ACG::Vec2i ACG::BSplineSurfaceT< PointT >::spanm ( double  _t)

Returns the basis functions which are unequal to zero at parameter u.

Parameters
_tthe parameter

Definition at line 757 of file BSplineSurfaceT_impl.hh.

◆ spann()

template<class PointT >
ACG::Vec2i ACG::BSplineSurfaceT< PointT >::spann ( double  _t)

Returns the basis functions which are unequal to zero at parameter v.

Parameters
_tthe parameter

Definition at line 767 of file BSplineSurfaceT_impl.hh.

◆ surfacePoint()

template<class PointT >
PointT ACG::BSplineSurfaceT< PointT >::surfacePoint ( double  _u,
double  _v 
)

Evaluates a spline surface at parameters _u and _v.

Parameters
_uthe parameter in u direction
_vthe parameter in v direction
Returns
the surface point

Definition at line 470 of file BSplineSurfaceT_impl.hh.

◆ surfacePoint_rec()

template<class PointT >
PointT ACG::BSplineSurfaceT< PointT >::surfacePoint_rec ( double  _u,
double  _v 
)

Evaluates a spline surface at parameters _u and _v.

Slower version of surfacePoint(), which evaluates the basis functions recursively.

Parameters
_uthe parameter in u direction
_vthe parameter in v direction
Returns
the surface point

Definition at line 571 of file BSplineSurfaceT_impl.hh.

◆ surfacePointNormal()

template<class PointT >
void ACG::BSplineSurfaceT< PointT >::surfacePointNormal ( Point &  _pt,
Point &  _normal,
double  _u,
double  _v 
)

Evaluates a spline surface at parameters _u and _v.

Computes surface point and normal at the same time (optimized).

Parameters
_pointpoint output
_normalnormal output
_uthe parameter in u direction
_vthe parameter in v direction
Returns
the surface point

Definition at line 513 of file BSplineSurfaceT_impl.hh.


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