Public Member Functions | Private Attributes | Friends | List of all members
karto::Vector3< T > Class Template Reference

#include <Karto.h>

Public Member Functions

const T & GetX () const
 
const T & GetY () const
 
const T & GetZ () const
 
kt_double Length () const
 
void MakeCeil (const Vector3 &rOther)
 
void MakeFloor (const Vector3 &rOther)
 
kt_bool operator!= (const Vector3 &rOther) const
 
const Vector3 operator* (T scalar) const
 
const Vector3 operator+ (const Vector3 &rOther) const
 
const Vector3 operator+ (kt_double scalar) const
 
const Vector3 operator- (const Vector3 &rOther) const
 
const Vector3 operator- (kt_double scalar) const
 
Vector3operator= (const Vector3 &rOther)
 
kt_bool operator== (const Vector3 &rOther) const
 
void SetX (const T &x)
 
void SetY (const T &y)
 
void SetZ (const T &z)
 
kt_double SquaredLength () const
 
std::string ToString () const
 
 Vector3 ()
 
 Vector3 (T x, T y, T z)
 
 Vector3 (const Vector3 &rOther)
 

Private Attributes

m_Values [3]
 

Friends

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

Detailed Description

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

Represents a vector (x, y, z) in 3-dimensional real space.

Definition at line 1291 of file Karto.h.

Constructor & Destructor Documentation

◆ Vector3() [1/3]

template<typename T>
karto::Vector3< T >::Vector3 ( )
inline

Default constructor

Definition at line 1297 of file Karto.h.

◆ Vector3() [2/3]

template<typename T>
karto::Vector3< T >::Vector3 ( x,
y,
z 
)
inline

Constructor initializing point location

Parameters
x
y
z

Definition at line 1310 of file Karto.h.

◆ Vector3() [3/3]

template<typename T>
karto::Vector3< T >::Vector3 ( const Vector3< T > &  rOther)
inline

Copy constructor

Parameters
rOther

Definition at line 1321 of file Karto.h.

Member Function Documentation

◆ GetX()

template<typename T>
const T& karto::Vector3< T >::GetX ( ) const
inline

Gets the x-component of this vector

Returns
x-component

Definition at line 1333 of file Karto.h.

◆ GetY()

template<typename T>
const T& karto::Vector3< T >::GetY ( ) const
inline

Gets the y-component of this vector

Returns
y-component

Definition at line 1351 of file Karto.h.

◆ GetZ()

template<typename T>
const T& karto::Vector3< T >::GetZ ( ) const
inline

Gets the z-component of this vector

Returns
z-component

Definition at line 1369 of file Karto.h.

◆ Length()

template<typename T>
kt_double karto::Vector3< T >::Length ( ) const
inline

Returns the length of the vector.

Returns
Length of the vector

Definition at line 1418 of file Karto.h.

◆ MakeCeil()

template<typename T>
void karto::Vector3< T >::MakeCeil ( const Vector3< T > &  rOther)
inline

Ceiling vector operator

Parameters
rOtherVector3d

Definition at line 1398 of file Karto.h.

◆ MakeFloor()

template<typename T>
void karto::Vector3< T >::MakeFloor ( const Vector3< T > &  rOther)
inline

Floor vector operator

Parameters
rOtherVector3d

Definition at line 1387 of file Karto.h.

◆ operator!=()

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

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

Parameters
rOther

Definition at line 1520 of file Karto.h.

◆ operator*()

template<typename T>
const Vector3 karto::Vector3< T >::operator* ( scalar) const
inline

Scales the vector by the given scalar

Parameters
scalar

Definition at line 1500 of file Karto.h.

◆ operator+() [1/2]

template<typename T>
const Vector3 karto::Vector3< T >::operator+ ( const Vector3< T > &  rOther) const
inline

Binary vector add.

Parameters
rOther
Returns
vector sum

Definition at line 1455 of file Karto.h.

◆ operator+() [2/2]

template<typename T>
const Vector3 karto::Vector3< T >::operator+ ( kt_double  scalar) const
inline

Binary vector add.

Parameters
scalar
Returns
sum

Definition at line 1467 of file Karto.h.

◆ operator-() [1/2]

template<typename T>
const Vector3 karto::Vector3< T >::operator- ( const Vector3< T > &  rOther) const
inline

Binary vector subtract.

Parameters
rOther
Returns
vector difference

Definition at line 1479 of file Karto.h.

◆ operator-() [2/2]

template<typename T>
const Vector3 karto::Vector3< T >::operator- ( kt_double  scalar) const
inline

Binary vector subtract.

Parameters
scalar
Returns
difference

Definition at line 1491 of file Karto.h.

◆ operator=()

template<typename T>
Vector3& karto::Vector3< T >::operator= ( const Vector3< T > &  rOther)
inline

Assignment operator

Definition at line 1441 of file Karto.h.

◆ operator==()

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

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

Parameters
rOther

Definition at line 1509 of file Karto.h.

◆ SetX()

template<typename T>
void karto::Vector3< T >::SetX ( const T &  x)
inline

Sets the x-component of this vector

Parameters
x

Definition at line 1342 of file Karto.h.

◆ SetY()

template<typename T>
void karto::Vector3< T >::SetY ( const T &  y)
inline

Sets the y-component of this vector

Parameters
y

Definition at line 1360 of file Karto.h.

◆ SetZ()

template<typename T>
void karto::Vector3< T >::SetZ ( const T &  z)
inline

Sets the z-component of this vector

Parameters
z

Definition at line 1378 of file Karto.h.

◆ SquaredLength()

template<typename T>
kt_double karto::Vector3< T >::SquaredLength ( ) const
inline

Returns the square of the length of the vector

Returns
square of the length of the vector

Definition at line 1409 of file Karto.h.

◆ ToString()

template<typename T>
std::string karto::Vector3< T >::ToString ( ) const
inline

Returns a string representation of this vector

Returns
string representation of this vector

Definition at line 1427 of file Karto.h.

Friends And Related Function Documentation

◆ operator<<

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

Write Vector3 onto output stream

Parameters
rStreamoutput stream
rVectorto write

Definition at line 1532 of file Karto.h.

◆ operator>>

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

Read Vector3 from input stream

Parameters
rStreaminput stream

Definition at line 1542 of file Karto.h.

Member Data Documentation

◆ m_Values

template<typename T>
T karto::Vector3< T >::m_Values[3]
private

Definition at line 1549 of file Karto.h.


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


slam_toolbox
Author(s): Steve Macenski
autogenerated on Sat Oct 3 2020 03:51:02