Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes

vl::Vector2< T_scalar_type > Class Template Reference

The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2. More...

#include <Vector2.hpp>

List of all members.

Public Types

typedef T_scalar_type scalar_type

Public Member Functions

 Vector2 (const Vector2 &other)
 Vector2 ()
template<class T >
 Vector2 (const T &other)
 Vector2 (T_scalar_type x, T_scalar_type y)
T_scalar_type * ptr ()
const T_scalar_type * ptr () const
const T_scalar_type & x () const
const T_scalar_type & y () const
T_scalar_type & x ()
T_scalar_type & y ()
const T_scalar_type & r () const
const T_scalar_type & g () const
T_scalar_type & r ()
T_scalar_type & g ()
const T_scalar_type & s () const
const T_scalar_type & t () const
T_scalar_type & s ()
T_scalar_type & t ()
Vector2 operator+ (const Vector2 &other) const
Vector2 operator- (const Vector2 &other) const
Vector2 operator* (const Vector2 &other) const
Vector2 operator/ (const Vector2 &other) const
Vector2 operator+ (T_scalar_type val) const
Vector2 operator- (T_scalar_type val) const
Vector2 operator* (T_scalar_type val) const
Vector2 operator/ (T_scalar_type val) const
Vector2 operator- () const
Vector2operator+= (const Vector2 &other)
Vector2operator-= (const Vector2 &other)
Vector2operator*= (const Vector2 &other)
Vector2operator/= (const Vector2 &other)
Vector2operator+= (T_scalar_type val)
Vector2operator-= (T_scalar_type val)
Vector2operator*= (T_scalar_type val)
Vector2operator/= (T_scalar_type val)
Vector2operator= (const Vector2 &other)
Vector2operator= (T_scalar_type val)
bool operator== (const Vector2 &other) const
bool operator!= (const Vector2 &other) const
bool operator< (const Vector2 &other) const
T_scalar_type & operator[] (unsigned i)
const T_scalar_type & operator[] (unsigned i) const
T_scalar_type length () const
T_scalar_type lengthSquared () const
bool isNull () const
const Vector2normalize (T_scalar_type *len=NULL)

Static Public Attributes

static const int scalar_count = 2

Protected Attributes

T_scalar_type mScalar [scalar_count]

Detailed Description

template<typename T_scalar_type>
class vl::Vector2< T_scalar_type >

The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2.

See also:
Vector4, Vector3, Matrix4, Matrix3, Matrix2

Member Typedef Documentation

template<typename T_scalar_type>
typedef T_scalar_type vl::Vector2< T_scalar_type >::scalar_type

Constructor & Destructor Documentation

template<typename T_scalar_type>
vl::Vector2< T_scalar_type >::Vector2 ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
vl::Vector2< T_scalar_type >::Vector2 (  ) [inline]
template<typename T_scalar_type>
template<class T >
vl::Vector2< T_scalar_type >::Vector2 ( const T &  other ) [inline, explicit]
template<typename T_scalar_type>
vl::Vector2< T_scalar_type >::Vector2 ( T_scalar_type  x,
T_scalar_type  y 
) [inline, explicit]

Member Function Documentation

template<typename T_scalar_type>
T_scalar_type* vl::Vector2< T_scalar_type >::ptr (  ) [inline]
template<typename T_scalar_type>
const T_scalar_type* vl::Vector2< T_scalar_type >::ptr (  ) const [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::x (  ) const [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::y (  ) const [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::x (  ) [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::y (  ) [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::r (  ) const [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::g (  ) const [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::r (  ) [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::g (  ) [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::s (  ) const [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::t (  ) const [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::s (  ) [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::t (  ) [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator+ ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator- ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator* ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator/ ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator+ ( T_scalar_type  val ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator- ( T_scalar_type  val ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator* ( T_scalar_type  val ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator/ ( T_scalar_type  val ) const [inline]
template<typename T_scalar_type>
Vector2 vl::Vector2< T_scalar_type >::operator- (  ) const [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator+= ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator-= ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator*= ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator/= ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator+= ( T_scalar_type  val ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator-= ( T_scalar_type  val ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator*= ( T_scalar_type  val ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator/= ( T_scalar_type  val ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator= ( const Vector2< T_scalar_type > &  other ) [inline]
template<typename T_scalar_type>
Vector2& vl::Vector2< T_scalar_type >::operator= ( T_scalar_type  val ) [inline]
template<typename T_scalar_type>
bool vl::Vector2< T_scalar_type >::operator== ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
bool vl::Vector2< T_scalar_type >::operator!= ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
bool vl::Vector2< T_scalar_type >::operator< ( const Vector2< T_scalar_type > &  other ) const [inline]
template<typename T_scalar_type>
T_scalar_type& vl::Vector2< T_scalar_type >::operator[] ( unsigned  i ) [inline]
template<typename T_scalar_type>
const T_scalar_type& vl::Vector2< T_scalar_type >::operator[] ( unsigned  i ) const [inline]
template<typename T_scalar_type>
T_scalar_type vl::Vector2< T_scalar_type >::length (  ) const [inline]
template<typename T_scalar_type>
T_scalar_type vl::Vector2< T_scalar_type >::lengthSquared (  ) const [inline]
template<typename T_scalar_type>
bool vl::Vector2< T_scalar_type >::isNull (  ) const [inline]
template<typename T_scalar_type>
const Vector2& vl::Vector2< T_scalar_type >::normalize ( T_scalar_type *  len = NULL ) [inline]

Member Data Documentation

template<typename T_scalar_type>
const int vl::Vector2< T_scalar_type >::scalar_count = 2 [static]
template<typename T_scalar_type>
T_scalar_type vl::Vector2< T_scalar_type >::mScalar[scalar_count] [protected]

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

Visualization Library v2010.11.1123 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Thu Nov 18 2010 02:08:16.
Permission is granted to use this page to write and publish articles regarding Visualization Library.