Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mirtk::Vector4D< T > Struct Template Reference

#include <Vector4D.h>

Collaboration diagram for mirtk::Vector4D< T >:
Collaboration graph

Public Member Functions

double Length () const
 
void Normalize ()
 
bool operator!= (const Vector4D &v) const
 
template<typename S >
Vector4D operator* (S s) const
 
template<typename S >
Vector4Doperator*= (S s)
 
Vector4Doperator*= (const Vector4D &v)
 
template<typename S >
Vector4D operator+ (S s) const
 
Vector4D operator+ (const Vector4D &v) const
 
template<typename S >
Vector4Doperator+= (S s)
 
Vector4Doperator+= (const Vector4D &v)
 
Vector4D operator- () const
 
template<typename S >
Vector4D operator- (S s) const
 
Vector4D operator- (const Vector4D &v) const
 
template<typename S >
Vector4Doperator-= (S s)
 
Vector4Doperator-= (const Vector4D &v)
 
Vector4D operator/ (const Vector4D &v) const
 
template<typename S >
Vector4D operator/ (S s) const
 
Vector4Doperator/= (const Vector4D &v)
 
template<typename S >
Vector4Doperator/= (S s)
 
bool operator< (const Vector4D &v) const
 
bool operator<= (const Vector4D &v) const
 
Vector4Doperator= (T s)
 
Vector4Doperator= (const Vector4D &v)
 
bool operator== (const Vector4D &v) const
 
bool operator> (const Vector4D &v) const
 
bool operator>= (const Vector4D &v) const
 
 Vector4D ()
 
 Vector4D (T x)
 
 Vector4D (T x, T y, T z, T t)
 
 Vector4D (const Vector4D &)
 

Static Public Member Functions

static double DotProduct (const Vector4D &v1, const Vector4D &v2)
 

Public Attributes

_t
 The t component.
 
_x
 The x component.
 
_y
 The y component.
 
_z
 The z component.
 

Detailed Description

template<typename T>
struct mirtk::Vector4D< T >

Represents a 4D vector

Note
Must be a primitive type which can be treated as an array of four values of type T without virtual function table et al. Thus, keep this type as simple as possible!

Definition at line 38 of file Vector.h.

Constructor & Destructor Documentation

§ Vector4D() [1/4]

template<typename T >
mirtk::Vector4D< T >::Vector4D ( )
inline

Constructor.

Definition at line 158 of file Vector4D.h.

§ Vector4D() [2/4]

template<typename T>
mirtk::Vector4D< T >::Vector4D ( x)
inline

Constructor.

Definition at line 167 of file Vector4D.h.

§ Vector4D() [3/4]

template<typename T>
mirtk::Vector4D< T >::Vector4D ( x,
y,
z,
t 
)
inline

Constructor.

Definition at line 176 of file Vector4D.h.

§ Vector4D() [4/4]

template<typename T>
mirtk::Vector4D< T >::Vector4D ( const Vector4D< T > &  v)
inline

Copy Constructor.

Definition at line 185 of file Vector4D.h.

Member Function Documentation

§ DotProduct()

template<typename T >
double mirtk::Vector4D< T >::DotProduct ( const Vector4D< T > &  v1,
const Vector4D< T > &  v2 
)
inlinestatic

Takes the dot-product of two vectors.

Definition at line 429 of file Vector4D.h.

§ Length()

template<typename T >
double mirtk::Vector4D< T >::Length ( ) const
inline

Returns the length of the vector.

Definition at line 423 of file Vector4D.h.

§ Normalize()

template<typename T >
void mirtk::Vector4D< T >::Normalize ( )
inline

Normalizes the vector.

Definition at line 411 of file Vector4D.h.

§ operator!=()

template<typename T >
bool mirtk::Vector4D< T >::operator!= ( const Vector4D< T > &  v) const
inline

Operator for testing non-equality of two vector.

Definition at line 358 of file Vector4D.h.

§ operator*()

template<typename T>
template<typename S >
Vector4D mirtk::Vector4D< T >::operator* ( s) const

Operator for multiplying by a scalar.

§ operator*=() [1/2]

template<typename T>
template<typename S >
Vector4D& mirtk::Vector4D< T >::operator*= ( s)

Operator for multiplying by a scalar.

§ operator*=() [2/2]

template<typename T >
Vector4D< T > & mirtk::Vector4D< T >::operator*= ( const Vector4D< T > &  v)
inline

Operator for multiplying by a vector.

Definition at line 290 of file Vector4D.h.

§ operator+() [1/2]

template<typename T>
template<typename S >
Vector4D mirtk::Vector4D< T >::operator+ ( s) const

Operator for adding a scalar to a vector.

§ operator+() [2/2]

template<typename T >
Vector4D< T > mirtk::Vector4D< T >::operator+ ( const Vector4D< T > &  v) const
inline

Operator for adding two vectors.

Definition at line 240 of file Vector4D.h.

§ operator+=() [1/2]

template<typename T>
template<typename S >
Vector4D& mirtk::Vector4D< T >::operator+= ( s)

Operator for adding a scalar.

§ operator+=() [2/2]

template<typename T >
Vector4D< T > & mirtk::Vector4D< T >::operator+= ( const Vector4D< T > &  v)
inline

Operator for adding a vector.

Definition at line 319 of file Vector4D.h.

§ operator-() [1/3]

template<typename T >
Vector4D< T > mirtk::Vector4D< T >::operator- ( ) const
inline

Unary negation operator.

Definition at line 313 of file Vector4D.h.

§ operator-() [2/3]

template<typename T>
template<typename S >
Vector4D mirtk::Vector4D< T >::operator- ( s) const

Operator for subtracting a scalar to a vector.

§ operator-() [3/3]

template<typename T >
Vector4D< T > mirtk::Vector4D< T >::operator- ( const Vector4D< T > &  v) const
inline

Operator for subtraction.

Definition at line 266 of file Vector4D.h.

§ operator-=() [1/2]

template<typename T>
template<typename S >
Vector4D& mirtk::Vector4D< T >::operator-= ( s)

Operator for subtracting a scalar.

§ operator-=() [2/2]

template<typename T >
Vector4D< T > & mirtk::Vector4D< T >::operator-= ( const Vector4D< T > &  v)
inline

Operator for subtracting a vector.

Definition at line 341 of file Vector4D.h.

§ operator/() [1/2]

template<typename T>
Vector4D mirtk::Vector4D< T >::operator/ ( const Vector4D< T > &  v) const

Operator for dividing one vector by another.

§ operator/() [2/2]

template<typename T>
template<typename S >
Vector4D mirtk::Vector4D< T >::operator/ ( s) const

Operator for dividing a vector by a scalar.

§ operator/=() [1/2]

template<typename T>
Vector4D& mirtk::Vector4D< T >::operator/= ( const Vector4D< T > &  v)

Operator for dividing one vector by another.

§ operator/=() [2/2]

template<typename T>
template<typename S >
Vector4D& mirtk::Vector4D< T >::operator/= ( s)

Operator for dividing a vector by a scalar.

§ operator<()

template<typename T >
bool mirtk::Vector4D< T >::operator< ( const Vector4D< T > &  v) const
inline

Operator for comparing sizes of vectors.

Definition at line 364 of file Vector4D.h.

§ operator<=()

template<typename T >
bool mirtk::Vector4D< T >::operator<= ( const Vector4D< T > &  v) const
inline

Operator for comparing sizes of vectors.

Definition at line 382 of file Vector4D.h.

§ operator=() [1/2]

template<typename T>
Vector4D< T > & mirtk::Vector4D< T >::operator= ( s)
inline

Assignment operator

Definition at line 194 of file Vector4D.h.

§ operator=() [2/2]

template<typename T>
Vector4D< T > & mirtk::Vector4D< T >::operator= ( const Vector4D< T > &  v)
inline

Assignment operator

Definition at line 204 of file Vector4D.h.

§ operator==()

template<typename T >
bool mirtk::Vector4D< T >::operator== ( const Vector4D< T > &  v) const
inline

Operator for testing equality of two vectors.

Definition at line 352 of file Vector4D.h.

§ operator>()

template<typename T >
bool mirtk::Vector4D< T >::operator> ( const Vector4D< T > &  v) const
inline

Operator for comparing sizes of vectors.

Definition at line 373 of file Vector4D.h.

§ operator>=()

template<typename T >
bool mirtk::Vector4D< T >::operator>= ( const Vector4D< T > &  v) const
inline

Operator for comparing sizes of vectors.

Definition at line 388 of file Vector4D.h.


The documentation for this struct was generated from the following files: