util::Point< T > Class Template Reference

A 3D point/vector class. More...

#include <point.h>

Inheritance diagram for util::Point< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

const T * c_data () const
 Return the data as a C-style array.
Point< T > cross (const Point< T > &p) const
distance (const Point< T > &p) const
distance_sq (const Point< T > &p) const
length () const
length_sq () const
void normalise (T l)
void normalise ()
Pointoperator*= (const T &p)
 In-place multiplication by a scalar.
Point operator+ (const Point &p) const
Pointoperator+= (const Point &p)
Point operator- () const
 Vector negation.
Point operator- (const Point &p) const
Pointoperator-= (const Point &p)
Point operator/ (const T &p) const
 Division by a scalar.
Pointoperator/= (const T &p)
 In-place division by a scalar.
 Point (const T &x=T(), const T &y=T(), const T &z=T())
 Point (const Vector< 3, T > &v)
 Constructor.
Point< T > proj (const Point< T > &p) const
 Vector projection.
proj_length (const Point< T > &p) const
 Vector projection length.
virtual ~Point ()
 Destructor.

Detailed Description

template<class T>
class util::Point< T >

A 3D point/vector class.

The Point class is a utility class tp handle operations on three-dimensional xyz-points and vectors. For some functions, T must be reducible to a floating point type to satisfy the functions used in the math library.

Definition at line 25 of file point.h.


Constructor & Destructor Documentation

template<class T>
util::Point< T >::Point ( const Vector< 3, T > &  v  )  [inline]

Constructor.

Definition at line 28 of file point.h.

00028 : Vector<3,T>( v ) {}

template<class T>
virtual util::Point< T >::~Point (  )  [inline, virtual]

Destructor.

Definition at line 32 of file point.h.

00032 {}


Member Function Documentation

template<class T>
const T* util::Point< T >::c_data (  )  const [inline]

Return the data as a C-style array.

Reimplemented from util::Vector< 3, T >.

Definition at line 53 of file point.h.

00053 {return this->elems;}

template<class T>
Point& util::Point< T >::operator*= ( const T &  scalar  )  [inline]

In-place multiplication by a scalar.

Reimplemented from util::Vector< 3, T >.

Definition at line 46 of file point.h.

00046 { this->Vector<3,T>::operator*=( p ); return *this; }

template<class T>
Point util::Point< T >::operator- ( void   )  const [inline]

Vector negation.

Reimplemented from util::Vector< 3, T >.

Definition at line 51 of file point.h.

00051 { return this->Vector<3,T>::operator-(); }

template<class T>
Point util::Point< T >::operator/ ( const T &  scalar  )  const [inline]

Division by a scalar.

Reimplemented from util::Vector< 3, T >.

Definition at line 50 of file point.h.

00050 { return this->Vector<3,T>::operator/( p ); }

template<class T>
Point& util::Point< T >::operator/= ( const T &  scalar  )  [inline]

In-place division by a scalar.

Reimplemented from util::Vector< 3, T >.

Definition at line 47 of file point.h.

00047 { this->Vector<3,T>::operator/=( p ); return *this; }

template<class T >
Point< T > util::Point< T >::proj ( const Point< T > &  p  )  const [inline]

Vector projection.

Parameters:
p The vector projected onto.

Definition at line 83 of file point.h.

00083                                                  {
00084     return ((*this * p) / p.length_sq()) * p;
00085   }

template<class T >
T util::Point< T >::proj_length ( const Point< T > &  p  )  const [inline]

Vector projection length.

Parameters:
p The vector projected onto.

Definition at line 92 of file point.h.

00092                                                  {
00093     return fabs(*this * p) / p.length();
00094   }


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:35 2013 for VVE by  doxygen 1.6.3