Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlVector< T > Class Template Reference

This class implements a 3 dimensional vector for OpenVL. More...

#include <vlvector.h>

Inheritance diagram for vlVector< T >:

vlTriple< T > vlNormal< T > List of all members.

Public Member Functions

 vlVector (T const &x=0, T const &y=0, T const &z=0)
 default constructor

 vlVector (vlTriple< T > const &triple)
 Constructor when triple is given as input.

 ~vlVector ()
 default destructor

double dot (vlVector const &other) const
 does a dot product between self and other

vlVector< T > cross (vlVector const &other) const
 does a cross product between self and other

double length () const
 returns the length of the vector

void normalize ()
 normalizes the vector

void clamp (T const &min, T const &max)
 clamps the vector to the given range

void scale (vlVector< T > const &other)
 scales the vector using other


Detailed Description

template<class T>
class vlVector< T >

vlVector inherits from vlTriple.

Author:
Sarang Lakare <sarang@users.sf.net>

Definition at line 42 of file vlvector.h.


Constructor & Destructor Documentation

template<class T>
vlVector< T >::vlVector T const &  x = 0,
T const &  y = 0,
T const &  z = 0
 

Parameters:
T data type.
x the x value.
y the y value.
z the z value

Definition at line 84 of file vlvector.h.

References x, y, and z.

template<class T>
vlVector< T >::vlVector vlTriple< T > const &  triple  ) 
 

Definition at line 91 of file vlvector.h.

template<class T>
vlVector< T >::~vlVector  ) 
 

Parameters:
T data type.

Definition at line 103 of file vlvector.h.


Member Function Documentation

template<class T>
void vlVector< T >::clamp T const &  min,
T const &  max
[inline]
 

Parameters:
min the minimum value to clamp to.
max the maximum value to clamp to.

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 172 of file vlvector.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, vlTriple< T >::m_z, max, and min.

template<class T>
vlVector< T > vlVector< T >::cross vlVector< T > const &  other  )  const [inline]
 

Parameters:
other the other vector to do cross product with.
Returns:
the resultant vector.

Definition at line 115 of file vlvector.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

template<class T>
double vlVector< T >::dot vlVector< T > const &  other  )  const [inline]
 

Parameters:
other the other vector to do cross product with.
Returns:
the resultant vector.

Definition at line 130 of file vlvector.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

template<class T>
double vlVector< T >::length  )  const [inline]
 

Returns:
the length of the vector (double).

Definition at line 142 of file vlvector.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

Referenced by vlVector< T >::normalize().

template<class T>
void vlVector< T >::normalize  )  [inline]
 

Definition at line 152 of file vlvector.h.

References vlVector< T >::length(), vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.

Referenced by vlNormal< T >::operator *=(), vlNormal< T >::operator+=(), vlNormal< T >::operator-=(), vlNormal< float >::operator/=(), vlNormal< T >::operator/=(), vlNormal< T >::vlNormal(), vlNormal< float >::x(), vlNormal< float >::y(), and vlNormal< float >::z().

template<class T>
void vlVector< T >::scale vlVector< T > const &  other  )  [inline]
 

Parameters:
other the other vector to scale the current with.

Reimplemented in vlNormal< T >, and vlNormal< float >.

Definition at line 195 of file vlvector.h.

References vlTriple< T >::m_x, vlTriple< T >::m_y, and vlTriple< T >::m_z.


The documentation for this class was generated from the following file:
Generated on Fri Mar 18 11:33:20 2005 for OpenVL by doxygen 1.3.3