karto::Vector2< T > Class Template Reference

#include <Karto.h>

List of all members.

Public Member Functions

kt_double Distance (const Vector2 &rOther) const
const T & GetX () const
const T & GetY () const
kt_double Length () const
void MakeCeil (const Vector2 &rOther)
void MakeFloor (const Vector2 &rOther)
kt_bool operator!= (const Vector2 &rOther) const
const Vector2 operator* (T scalar) const
kt_double operator* (const Vector2 &rOther) const
void operator*= (T scalar)
const Vector2 operator+ (const Vector2 &rOther) const
void operator+= (const Vector2 &rOther)
const Vector2 operator- (T scalar) const
const Vector2 operator- (const Vector2 &rOther) const
void operator-= (const Vector2 &rOther)
const Vector2 operator/ (T scalar) const
void operator/= (T scalar)
kt_bool operator< (const Vector2 &rOther) const
kt_bool operator== (const Vector2 &rOther) const
void SetX (const T &x)
void SetY (const T &y)
kt_double SquaredDistance (const Vector2 &rOther) const
kt_double SquaredLength () const
 Vector2 (T x, T y)
 Vector2 ()

Private Attributes

m_Values [2]

Friends

std::ostream & operator<< (std::ostream &rStream, const Vector2 &rVector)
std::istream & operator>> (std::istream &rStream, const Vector2 &)

Detailed Description

template<typename T>
class karto::Vector2< T >

Definition at line 863 of file Karto.h.


Constructor & Destructor Documentation

template<typename T>
karto::Vector2< T >::Vector2 (  )  [inline]

Default constructor

Definition at line 869 of file Karto.h.

template<typename T>
karto::Vector2< T >::Vector2 ( x,
y 
) [inline]

Constructor initializing vector location

Parameters:
x 
y 

Definition at line 880 of file Karto.h.


Member Function Documentation

template<typename T>
kt_double karto::Vector2< T >::Distance ( const Vector2< T > &  rOther  )  const [inline]

Gets the distance to the other vector2

Parameters:
rOther 
Returns:
distance to other vector2

Definition at line 975 of file Karto.h.

template<typename T>
const T& karto::Vector2< T >::GetX (  )  const [inline]

Gets the x-coordinate of this vector2

Returns:
the x-coordinate of the vector2

Definition at line 891 of file Karto.h.

template<typename T>
const T& karto::Vector2< T >::GetY (  )  const [inline]

Gets the y-coordinate of this vector2

Returns:
the y-coordinate of the vector2

Definition at line 909 of file Karto.h.

template<typename T>
kt_double karto::Vector2< T >::Length (  )  const [inline]

Returns the length of the vector (x and y).

Returns:
length of the vector

Definition at line 956 of file Karto.h.

template<typename T>
void karto::Vector2< T >::MakeCeil ( const Vector2< T > &  rOther  )  [inline]

Ceiling point operator

Parameters:
rOther 

Definition at line 937 of file Karto.h.

template<typename T>
void karto::Vector2< T >::MakeFloor ( const Vector2< T > &  rOther  )  [inline]

Floor point operator

Parameters:
rOther 

Definition at line 927 of file Karto.h.

template<typename T>
kt_bool karto::Vector2< T >::operator!= ( const Vector2< T > &  rOther  )  const [inline]

Inequality operator returns true if any of the corresponding x, y values of each Vector2 not the same.

Parameters:
rOther 

Definition at line 1090 of file Karto.h.

template<typename T>
const Vector2 karto::Vector2< T >::operator* ( scalar  )  const [inline]

Scales the vector by the given scalar

Parameters:
scalar 

Definition at line 1053 of file Karto.h.

template<typename T>
kt_double karto::Vector2< T >::operator* ( const Vector2< T > &  rOther  )  const [inline]

Computes the dot product between the two vectors

Parameters:
rOther 
Returns:
dot product

Definition at line 1044 of file Karto.h.

template<typename T>
void karto::Vector2< T >::operator*= ( scalar  )  [inline]

In place scalar multiplication operator

Parameters:
scalar 

Definition at line 1071 of file Karto.h.

template<typename T>
const Vector2 karto::Vector2< T >::operator+ ( const Vector2< T > &  rOther  )  const [inline]

Addition operator

Parameters:
rOther 
Returns:
vector resulting from adding this vector with the given vector

Definition at line 1004 of file Karto.h.

template<typename T>
void karto::Vector2< T >::operator+= ( const Vector2< T > &  rOther  )  [inline]

In place Vector2 addition.

Definition at line 984 of file Karto.h.

template<typename T>
const Vector2 karto::Vector2< T >::operator- ( scalar  )  const [inline]

Subtract the vector by the given scalar

Parameters:
scalar 

Definition at line 1062 of file Karto.h.

template<typename T>
const Vector2 karto::Vector2< T >::operator- ( const Vector2< T > &  rOther  )  const [inline]

Subtraction operator

Parameters:
rOther 
Returns:
vector resulting from subtracting this vector from the given vector

Definition at line 1014 of file Karto.h.

template<typename T>
void karto::Vector2< T >::operator-= ( const Vector2< T > &  rOther  )  [inline]

In place Vector2 subtraction.

Definition at line 993 of file Karto.h.

template<typename T>
const Vector2 karto::Vector2< T >::operator/ ( scalar  )  const [inline]

Divides a Vector2

Parameters:
scalar 
Returns:
scalar product

Definition at line 1034 of file Karto.h.

template<typename T>
void karto::Vector2< T >::operator/= ( scalar  )  [inline]

In place scalar division operator

Parameters:
scalar 

Definition at line 1023 of file Karto.h.

template<typename T>
kt_bool karto::Vector2< T >::operator< ( const Vector2< T > &  rOther  )  const [inline]

Less than operator

Parameters:
rOther 
Returns:
true if left vector is less than right vector

Definition at line 1100 of file Karto.h.

template<typename T>
kt_bool karto::Vector2< T >::operator== ( const Vector2< T > &  rOther  )  const [inline]

Equality operator returns true if the corresponding x, y values of each Vector2 are the same values.

Parameters:
rOther 

Definition at line 1081 of file Karto.h.

template<typename T>
void karto::Vector2< T >::SetX ( const T &  x  )  [inline]

Sets the x-coordinate of this vector2

Parameters:
x the x-coordinate of the vector2

Definition at line 900 of file Karto.h.

template<typename T>
void karto::Vector2< T >::SetY ( const T &  y  )  [inline]

Sets the y-coordinate of this vector2

Parameters:
y the y-coordinate of the vector2

Definition at line 918 of file Karto.h.

template<typename T>
kt_double karto::Vector2< T >::SquaredDistance ( const Vector2< T > &  rOther  )  const [inline]

Returns the square distance to the given vector

Returns:
square distance to the given vector

Definition at line 965 of file Karto.h.

template<typename T>
kt_double karto::Vector2< T >::SquaredLength (  )  const [inline]

Returns the square of the length of the vector

Returns:
square of the length of the vector

Definition at line 947 of file Karto.h.


Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  rStream,
const Vector2< T > &  rVector 
) [friend]

Write Vector2 onto output stream

Parameters:
rStream output stream
rVector to write

Definition at line 1115 of file Karto.h.

template<typename T>
std::istream& operator>> ( std::istream &  rStream,
const Vector2< T > &   
) [friend]

Read Vector2 from input stream

Parameters:
rStream input stream
rVector to read

Definition at line 1126 of file Karto.h.


Member Data Documentation

template<typename T>
T karto::Vector2< T >::m_Values[2] [private]

Definition at line 1133 of file Karto.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


karto
Author(s): SRI International (package maintained by Brian Gerkey)
autogenerated on Fri Jan 11 10:07:06 2013