BasicVector2< Element > Class Template Reference

#include <Vector2.h>

Collaboration diagram for BasicVector2< Element >:
Collaboration graph
[legend]

Public Member Functions

 BasicVector2 ()
 BasicVector2 (const Element &x_, const Element &y_)
Element & x ()
Element & y ()
const Element & x () const
const Element & y () const
Element & operator[] (std::size_t i)
const Element & operator[] (std::size_t i) const
Element * data ()
const Element * data () const
bool operator== (const BasicVector2 &other) const
bool operator!= (const BasicVector2 &other) const
BasicVector2< Element > operator- () const
template<typename OtherElement >
BasicVector2< Element > operator+ (const BasicVector2< OtherElement > &other) const
template<typename OtherElement >
void operator+= (const BasicVector2< OtherElement > &other)
template<typename OtherElement >
BasicVector2< Element > operator- (const BasicVector2< OtherElement > &other) const
template<typename OtherElement >
void operator-= (const BasicVector2< OtherElement > &other)
template<typename OtherElement >
BasicVector2< Element > operator* (const BasicVector2< OtherElement > &other) const
template<typename OtherElement >
void operator*= (const BasicVector2< OtherElement > &other)
template<typename OtherElement >
BasicVector2< Element > operator* (const OtherElement &other) const
template<typename OtherElement >
void operator*= (const OtherElement &other)
template<typename OtherElement >
BasicVector2< Element > operator/ (const BasicVector2< OtherElement > &other) const
template<typename OtherElement >
void operator/= (const BasicVector2< OtherElement > &other)
template<typename OtherElement >
BasicVector2< Element > operator/ (const OtherElement &other) const
template<typename OtherElement >
void operator/= (const OtherElement &other)
double getLength () const
double getLengthSquared () const
template<typename OtherT >
Element dot (const BasicVector2< OtherT > &other) const
template<typename OtherT >
Element crossProduct (const BasicVector2< OtherT > &other) const
std::string toString () const

Private Attributes

Element m_elements [2]

Detailed Description

template<typename Element>
class BasicVector2< Element >

Definition at line 23 of file Vector2.h.


Constructor & Destructor Documentation

template<typename Element>
BasicVector2< Element >::BasicVector2 (  )  [inline]

Definition at line 30 of file Vector2.h.

template<typename Element>
BasicVector2< Element >::BasicVector2 ( const Element &  x_,
const Element &  y_ 
) [inline]

Construct a BasicVector2 with the 2 provided components.

Definition at line 36 of file Vector2.h.


Member Function Documentation

template<typename Element>
template<typename OtherT >
Element BasicVector2< Element >::crossProduct ( const BasicVector2< OtherT > &  other  )  const [inline]

Definition at line 252 of file Vector2.h.

template<typename Element>
const Element* BasicVector2< Element >::data (  )  const [inline]

Definition at line 75 of file Vector2.h.

template<typename Element>
Element* BasicVector2< Element >::data (  )  [inline]

Definition at line 71 of file Vector2.h.

template<typename Element>
template<typename OtherT >
Element BasicVector2< Element >::dot ( const BasicVector2< OtherT > &  other  )  const [inline]

Definition at line 238 of file Vector2.h.

template<typename Element>
double BasicVector2< Element >::getLength (  )  const [inline]

Return the length of this vector.

Returns:
The Pythagorean length of this vector.

Definition at line 214 of file Vector2.h.

template<typename Element>
double BasicVector2< Element >::getLengthSquared (  )  const [inline]

Return the squared length of this vector.

Definition at line 222 of file Vector2.h.

template<typename Element>
bool BasicVector2< Element >::operator!= ( const BasicVector2< Element > &  other  )  const [inline]

Compare this BasicVector2 against another for inequality.

Definition at line 89 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator* ( const OtherElement &  other  )  const [inline]

Definition at line 161 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator* ( const BasicVector2< OtherElement > &  other  )  const [inline]

Definition at line 145 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator*= ( const OtherElement &  other  )  [inline]

Definition at line 168 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator*= ( const BasicVector2< OtherElement > &  other  )  [inline]

Definition at line 152 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator+ ( const BasicVector2< OtherElement > &  other  )  const [inline]

Definition at line 106 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator+= ( const BasicVector2< OtherElement > &  other  )  [inline]

Definition at line 113 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator- ( const BasicVector2< OtherElement > &  other  )  const [inline]

Definition at line 123 of file Vector2.h.

template<typename Element>
BasicVector2<Element> BasicVector2< Element >::operator- (  )  const [inline]

Definition at line 97 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator-= ( const BasicVector2< OtherElement > &  other  )  [inline]

Definition at line 130 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator/ ( const OtherElement &  other  )  const [inline]

Definition at line 195 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
BasicVector2<Element> BasicVector2< Element >::operator/ ( const BasicVector2< OtherElement > &  other  )  const [inline]

Definition at line 179 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator/= ( const OtherElement &  other  )  [inline]

Definition at line 202 of file Vector2.h.

template<typename Element>
template<typename OtherElement >
void BasicVector2< Element >::operator/= ( const BasicVector2< OtherElement > &  other  )  [inline]

Definition at line 186 of file Vector2.h.

template<typename Element>
bool BasicVector2< Element >::operator== ( const BasicVector2< Element > &  other  )  const [inline]

Compare this BasicVector2 against another for equality.

Definition at line 82 of file Vector2.h.

template<typename Element>
const Element& BasicVector2< Element >::operator[] ( std::size_t  i  )  const [inline]

Definition at line 66 of file Vector2.h.

template<typename Element>
Element& BasicVector2< Element >::operator[] ( std::size_t  i  )  [inline]

Definition at line 62 of file Vector2.h.

template<typename Element>
std::string BasicVector2< Element >::toString (  )  const [inline]
Returns:
String representation of the vector - values are separated by space

Definition at line 260 of file Vector2.h.

template<typename Element>
const Element& BasicVector2< Element >::x (  )  const [inline]

Definition at line 53 of file Vector2.h.

template<typename Element>
Element& BasicVector2< Element >::x (  )  [inline]
template<typename Element>
const Element& BasicVector2< Element >::y (  )  const [inline]

Definition at line 57 of file Vector2.h.

template<typename Element>
Element& BasicVector2< Element >::y (  )  [inline]

Field Documentation

template<typename Element>
Element BasicVector2< Element >::m_elements[2] [private]

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

Generated by  doxygen 1.6.2