Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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...
 
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 81 of file BSplineSurfaceT.hh.

Constructor & Destructor Documentation

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 73 of file BSplineSurfaceT.cc.

Member Function Documentation

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 186 of file BSplineSurfaceT.cc.

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 196 of file BSplineSurfaceT.cc.

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 502 of file BSplineSurfaceT.cc.

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 274 of file BSplineSurfaceT.cc.

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 301 of file BSplineSurfaceT.cc.

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 590 of file BSplineSurfaceT.cc.

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 540 of file BSplineSurfaceT.cc.

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 192 of file BSplineSurfaceT.hh.

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 126 of file BSplineSurfaceT.hh.

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 133 of file BSplineSurfaceT.hh.

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 332 of file BSplineSurfaceT.cc.

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 343 of file BSplineSurfaceT.cc.

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 379 of file BSplineSurfaceT.cc.

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 423 of file BSplineSurfaceT.cc.

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 206 of file BSplineSurfaceT.cc.

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 239 of file BSplineSurfaceT.cc.

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 698 of file BSplineSurfaceT.cc.

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 720 of file BSplineSurfaceT.cc.

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 572 of file BSplineSurfaceT.cc.

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 202 of file BSplineSurfaceT.hh.

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 212 of file BSplineSurfaceT.hh.

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 222 of file BSplineSurfaceT.hh.

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 232 of file BSplineSurfaceT.hh.

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 124 of file BSplineSurfaceT.cc.

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 175 of file BSplineSurfaceT.cc.

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 357 of file BSplineSurfaceT.cc.

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 368 of file BSplineSurfaceT.cc.

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 652 of file BSplineSurfaceT.cc.

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 675 of file BSplineSurfaceT.cc.

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 469 of file BSplineSurfaceT.cc.


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