Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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.
Knotvector * | get_knotvector_m_ref ()
| Get a reference to the knotvector in m direction.
Knotvector * | get_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 88 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

  _degm | Degree in m direction
  _degn | Degree in n direction

Definition at line 81 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_polygon | Additional control point vector

Definition at line 193 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_polygon | Additional control point vector

Definition at line 203 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

  _knotvector | the knotvector
  _i | the i'th basis function
  _n | the spline degree
  _t | the parameter Returns N_i^p(_u)

Definition at line 610 of file BSplineSurfaceT.cc.

template<class PointT >

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

Deletes an n control point vector.

Parameters

  _m | the m'th pointvector

Todo:
  Improve deletion routine for control points and knots!

Definition at line 281 of file BSplineSurfaceT.cc.

template<class PointT >

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

Deletes an m control point vector.

Parameters

  _n | the n'th pointvector

Todo:
  : Improve deletion routine for control points and knots!

Definition at line 308 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

  _knotvector | the knotvector
  _i | the i'th basis function
  _n | the spline degree
  _t | the parameter
  _der | the _der'th derivative

Definition at line 698 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

  _u | the parameter in u direction
  _v | the parameter in v direction
  _derm | the _derm'th derivative in m
  _dern | the _dern'th derivative in n

Returns
  the derivative

Definition at line 648 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,_n | the control point index

Definition at line 199 of file BSplineSurfaceT.hh.

template<class PointT>

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

Get knot i in m direction.

Parameters

  _i | Knot index

Returns
  Knot i

Definition at line 133 of file BSplineSurfaceT.hh.

template<class PointT>

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

Get knot i in n direction.

Parameters

  _i | Knot index

Returns
  Knot i

Definition at line 140 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

  _m | the m'th pointvector
  _control_polygon | the returned pointvector

Definition at line 339 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

  _n | the n'th pointvector
  _control_polygon | the returned pointvector

Definition at line 350 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

  _t | Parameter value

Definition at line 386 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

  _t | Parameter value

Definition at line 430 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

  _m | the position in m direction
  _control_polygon | the pointvector to be inserted

Definition at line 213 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

  _n | the position in n direction
  _control_polygon | the pointvector to be inserted

Definition at line 246 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

  _t | the parameter

Definition at line 783 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

  _t | the parameter

Definition at line 803 of file BSplineSurfaceT.cc.

template<class PointT >

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

Returns the normal of a spline surface.

Parameters

  _u | the parameter in u direction
  _v | the parameter in v direction

Returns
  the normal

Definition at line 680 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,_n | the control point index

Definition at line 209 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,_n | the control point index

Definition at line 219 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

  _param | the control point index

Definition at line 229 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

  _param | the control point index

Definition at line 239 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

  _m | size in m direction
  _n | size in n direction

Definition at line 131 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

  _degm | Degree in m direction
  _degn | Degree in n direction

Definition at line 182 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

  _knots | The new knots

Definition at line 364 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

  _knots | The new knots

Definition at line 375 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

  _t | the parameter

Definition at line 763 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

  _t | the parameter

Definition at line 773 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

  _u | the parameter in u direction
  _v | the parameter in v direction

Returns
  the surface point

Definition at line 476 of file BSplineSurfaceT.cc.

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

  _u | the parameter in u direction
  _v | the parameter in v direction

Returns
  the surface point

Definition at line 577 of file BSplineSurfaceT.cc.

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

  _point | point output
  _normal | normal output
  _u | the parameter in u direction
  _v | the parameter in v direction

Returns
  the surface point

Definition at line 519 of file BSplineSurfaceT.cc.

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

- ObjectTypes/BSplineSurface/BSplineSurfaceT.hh
- ObjectTypes/BSplineSurface/BSplineSurfaceT.cc