# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# vl::CatmullRomInterpolator< T > Class Template Reference

The LinearInterpolator class is a template class that implements Catmull-Rom spline interpolation. More...

`#include <CatmullRomInterpolator.hpp>`

Inheritance diagram for vl::CatmullRomInterpolator< T >:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| CatmullRomInterpolator ()
| CatmullRomInterpolator (const std::vector< T > &path)
void | setupEndPoints (bool is_loop)
| Call this function after having specified the control points if you want to automatically generate the start/end control points.
T | computePoint (float t) const
| Samples the Catmull-Rom spline at the given point. The `t` parameter must be in the range 0.0 ... 1.0 included.
void | setPath (const std::vector< T > &path)
| The control points defining the Catmull-Rom spline.
const std::vector< T > & | path () const
| The control points defining the Catmull-Rom spline.
std::vector< T > & | path ()
| The control points defining the Catmull-Rom spline.

## Protected Attributes

std::vector< T > | mPath
std::vector< T > | mCatmullRomSpline

## Detailed Description

### template<typename T>
class vl::CatmullRomInterpolator< T >

The LinearInterpolator class is a template class that implements Catmull-Rom spline interpolation.

Catmull-Rom spline interpolation allows smoother interpolations than simple linear interpolation, is thus indicated for example when you want to smoothly interpolate from one position to another or from one color to another.

See also:
  LinearInterpolator, Interpolator and the Interpolators Tutorial page.

Definition at line 46 of file CatmullRomInterpolator.hpp.

## Constructor & Destructor Documentation

template<typename T >

vl::CatmullRomInterpolator< T >::CatmullRomInterpolator | ( | ) | `[inline]`

Definition at line 51 of file CatmullRomInterpolator.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

template<typename T >

vl::CatmullRomInterpolator< T >::CatmullRomInterpolator | ( | const std::vector< T > & | path ) | `[inline]`

Definition at line 56 of file CatmullRomInterpolator.hpp.

## Member Function Documentation

template<typename T >

virtual const char* vl::CatmullRomInterpolator< T >::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 49 of file CatmullRomInterpolator.hpp.

template<typename T >

void vl::CatmullRomInterpolator< T >::setupEndPoints | ( | bool | is_loop ) | `[inline]`

Call this function after having specified the control points if you want to automatically generate the start/end control points.

Definition at line 59 of file CatmullRomInterpolator.hpp.

References vl::CatmullRomInterpolator< T >::mCatmullRomSpline, vl::CatmullRomInterpolator< T >::mPath, and VL_CHECK.

template<typename T >

T vl::CatmullRomInterpolator< T >::computePoint | ( | float | t ) | const`[inline]`

Samples the Catmull-Rom spline at the given point. The `t` parameter must be in the range 0.0 ... 1.0 included.

Definition at line 97 of file CatmullRomInterpolator.hpp.

References vl::clamp(), vl::CatmullRomInterpolator< T >::mCatmullRomSpline, and VL_CHECK.

Referenced by vl::CatmullRomInterpolatorDouble::computePoint(), vl::CatmullRomInterpolatorDVec2::computePoint(), vl::CatmullRomInterpolatorDVec3::computePoint(), vl::CatmullRomInterpolatorDVec4::computePoint(), vl::CatmullRomInterpolatorFloat::computePoint(), vl::CatmullRomInterpolatorFVec2::computePoint(), vl::CatmullRomInterpolatorFVec3::computePoint(), and vl::CatmullRomInterpolatorFVec4::computePoint().

template<typename T >

void vl::CatmullRomInterpolator< T >::setPath | ( | const std::vector< T > & | path ) | `[inline]`

The control points defining the Catmull-Rom spline.

Because of the Catmull-Rom formula the interpolated path must start and end with an extra control point (one on each side) and cannot have less than 4 control points. You can also automatically generate such extra control points by calling the setupEndPoints() method.

Definition at line 131 of file CatmullRomInterpolator.hpp.

References vl::CatmullRomInterpolator< T >::mPath, and vl::CatmullRomInterpolator< T >::path().

template<typename T >

const std::vector<T>& vl::CatmullRomInterpolator< T >::path | ( | ) | const`[inline]`

The control points defining the Catmull-Rom spline.

Definition at line 134 of file CatmullRomInterpolator.hpp.

References vl::CatmullRomInterpolator< T >::mPath.

Referenced by vl::CatmullRomInterpolator< T >::setPath().

template<typename T >

std::vector<T>& vl::CatmullRomInterpolator< T >::path | ( | ) | `[inline]`

The control points defining the Catmull-Rom spline.

Definition at line 137 of file CatmullRomInterpolator.hpp.

References vl::CatmullRomInterpolator< T >::mPath.

## Member Data Documentation

template<typename T >

std::vector<T> vl::CatmullRomInterpolator< T >::mPath`[protected]`

Definition at line 140 of file CatmullRomInterpolator.hpp.

Referenced by vl::CatmullRomInterpolator< T >::path(), vl::CatmullRomInterpolator< T >::setPath(), and vl::CatmullRomInterpolator< T >::setupEndPoints().

template<typename T >

std::vector<T> vl::CatmullRomInterpolator< T >::mCatmullRomSpline`[protected]`

Definition at line 141 of file CatmullRomInterpolator.hpp.

Referenced by vl::CatmullRomInterpolator< T >::computePoint(), and vl::CatmullRomInterpolator< T >::setupEndPoints().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/CatmullRomInterpolator.hpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:32.
Permission is granted to use this page to write and publish articles regarding Visualization Library.