# Visualization Library

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

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

Public Member Functions | Protected Attributes

# vl::LinearInterpolator< T > Class Template Reference

The LinearInterpolator class is a template class that implements linear interpolation. More...

`#include <LinearInterpolator.hpp>`

Inheritance diagram for vl::LinearInterpolator< T >:

List of all members.

## Public Member Functions

| LinearInterpolator ()
| LinearInterpolator (const std::vector< T > &path)
T | computePoint (float t) const
| Samples the path 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 > | mLinearSpline

## Detailed Description

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

The LinearInterpolator class is a template class that implements linear interpolation.

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

Definition at line 44 of file LinearInterpolator.hpp.

## Constructor & Destructor Documentation

template<typename T >

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

Definition at line 49 of file LinearInterpolator.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

template<typename T >

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

Definition at line 54 of file LinearInterpolator.hpp.

## Member Function Documentation

template<typename T >

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

Samples the path at the given point. The `t` parameter must be in the range 0.0 ... 1.0 included.

Definition at line 57 of file LinearInterpolator.hpp.

References vl::clamp(), and vl::LinearInterpolator< T >::mPath.

Referenced by vl::LinearInterpolatorDouble::computePoint(), vl::LinearInterpolatorDVec2::computePoint(), vl::LinearInterpolatorDVec3::computePoint(), vl::LinearInterpolatorDVec4::computePoint(), vl::LinearInterpolatorFloat::computePoint(), vl::LinearInterpolatorFVec2::computePoint(), vl::LinearInterpolatorFVec3::computePoint(), and vl::LinearInterpolatorFVec4::computePoint().

template<typename T >

void vl::LinearInterpolator< 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.

Definition at line 75 of file LinearInterpolator.hpp.

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

template<typename T >

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

The control points defining the Catmull-Rom spline.

Definition at line 77 of file LinearInterpolator.hpp.

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

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

template<typename T >

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

The control points defining the Catmull-Rom spline.

Definition at line 79 of file LinearInterpolator.hpp.

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

## Member Data Documentation

template<typename T >

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

Definition at line 82 of file LinearInterpolator.hpp.

Referenced by vl::LinearInterpolator< T >::computePoint(), vl::LinearInterpolator< T >::path(), and vl::LinearInterpolator< T >::setPath().

template<typename T >

std::vector<T> vl::LinearInterpolator< T >::mLinearSpline`[protected]`

Definition at line 83 of file LinearInterpolator.hpp.

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

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

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:06.
Permission is granted to use this page to write and publish articles regarding Visualization Library.