Public Member Functions | Private Attributes | Friends
karto::Vector2< T > Class Template Reference

#include <Geometry.h>

Inheritance diagram for karto::Vector2< T >:
Inheritance graph
[legend]

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
kt_double operator* (const Vector2 &rOther) const
const Vector2 operator* (T scalar) const
void operator*= (T scalar)
const Vector2 operator+ (const Vector2 &rOther) const
void operator+= (const Vector2 &rOther)
const Vector2 operator- (const Vector2 &rOther) const
const Vector2 operator- (T scalar) 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
const String ToString () const
 Vector2 ()
 Vector2 (T x, T y)

Private Attributes

m_Values [2]

Friends

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

Detailed Description

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

Represents a 2-dimensional vector (x, y)

Definition at line 323 of file Geometry.h.


Constructor & Destructor Documentation

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

Vector at the origin

Definition at line 329 of file Geometry.h.

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

Vector at the given location

Parameters:
xx
yy

Definition at line 340 of file Geometry.h.


Member Function Documentation

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

Gets the distance to the given vector

Parameters:
rOthervector
Returns:
distance to given vector

Definition at line 443 of file Geometry.h.

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

Gets the x-coordinate of this vector

Returns:
the x-coordinate of the vector

Definition at line 351 of file Geometry.h.

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

Gets the y-coordinate of this vector

Returns:
the y-coordinate of the vector

Definition at line 369 of file Geometry.h.

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

Returns the length of the vector

Returns:
length of the vector

Definition at line 423 of file Geometry.h.

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

Ceiling point operator

Parameters:
rOthervector

Definition at line 397 of file Geometry.h.

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

Floor point operator

Parameters:
rOthervector

Definition at line 387 of file Geometry.h.

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

Inequality operator

Definition at line 557 of file Geometry.h.

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

Vector dot-product

Definition at line 516 of file Geometry.h.

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

Scales the vector by the given scalar

Definition at line 524 of file Geometry.h.

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

In-place scalar multiplication

Definition at line 540 of file Geometry.h.

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

Vector addition

Definition at line 483 of file Geometry.h.

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

In-place vector addition

Definition at line 465 of file Geometry.h.

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

Vector subtraction

Definition at line 491 of file Geometry.h.

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

Subtract the vector by the given scalar

Definition at line 532 of file Geometry.h.

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

In-place vector subtraction

Definition at line 474 of file Geometry.h.

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

Divides a vector by the scalar

Definition at line 508 of file Geometry.h.

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

In-place scalar division

Definition at line 499 of file Geometry.h.

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

Less than operator

Parameters:
rOthervector
Returns:
true if left vector is 'less' than right vector by comparing corresponding x coordinates and then corresponding y coordinates

Definition at line 568 of file Geometry.h.

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

Equality operator

Definition at line 549 of file Geometry.h.

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

Sets the x-coordinate of this vector

Parameters:
xthe x-coordinate of the vector

Definition at line 360 of file Geometry.h.

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

Sets the y-coordinate of this vector

Parameters:
ythe y-coordinate of the vector

Definition at line 378 of file Geometry.h.

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

Returns the square of the distance to the given vector

Parameters:
rOthervector
Returns:
square of the distance to the given vector

Definition at line 433 of file Geometry.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 414 of file Geometry.h.

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

Returns a string representation of this vector

Returns:
string representation of this vector

Reimplemented in karto::gps::PointGps.

Definition at line 452 of file Geometry.h.


Friends And Related Function Documentation

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

Write vector onto output stream

Definition at line 587 of file Geometry.h.


Member Data Documentation

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

Definition at line 594 of file Geometry.h.


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


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Thu Aug 27 2015 14:07:26