Point3D< T > Class Template Reference

This is a basic class to encode 3D integer coordinates. More...

#include <BeoSub/BeeBrain/Point3D.H>

Collaboration diagram for Point3D< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Point3D ()
 The default constructor initializes the coordinates to (0,0).
 Point3D (const int xx, const int yy, const int zz)
 Initialize the Point2D<int> from horizontal & vertical coordinates.
Point3Doperator+= (const Point3D &p)
 += operator
Point3Doperator-= (const Point3D &p)
 -= operator
Point3Doperator*= (const Point3D &p)
 *= operator
Point3Doperator/= (const Point3D &p)
 /= operator
Point3D operator+ (const Point3D &p) const
 + operator
Point3D operator- (const Point3D &p) const
 
  • operator

Point3D operator* (const Point3D &p) const
 * operator
Point3D operator/ (const Point3D &p) const
 / operator
Point3Doperator+= (const int val)
 += operator
Point3Doperator-= (const int val)
 -= operator
Point3Doperator*= (const int val)
 *= operator
Point3Doperator/= (const int val)
 /= operator
Point3D operator+ (const int val) const
 + operator
Point3D operator- (const int val) const
 
  • operator

Point3D operator* (const int val) const
 * operator
Point3D operator/ (const int val) const
 / operator
bool isValidX () const
 test whether x is positive
bool isValidY () const
 test whether y is positive
bool isValidZ () const
 test whether z is positive
float squdist (const Point3D &p) const
 the square euclidean distance from p
float distance (const Point3D &p) const
 the euclidean distance from p
 Point3D ()
 The default constructor initializes the coordinates to (0,0).
 Point3D (const T xx, const T yy, const T zz)
 Initialize the Point3D from horizontal & vertical coordinates.
 Point3D (const Image< T > &mat)
 Initialize the Point3D from an image.
template<class U >
 Point3D (const Point3D< U > &a)
 Explicit conversion from type T to another type U.
Point3D< T > & operator+= (const Point3D< T > &p)
 += operator
Point3D< T > & operator-= (const Point3D< T > &p)
 -= operator
Point3D< T > & operator*= (const Point3D< T > &p)
 *= operator
Point3D< T > & operator/= (const Point3D< T > &p)
 /= operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator+ (const Point3D< U > &p) const
 + operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator- (const Point3D< U > &p) const
 
  • operator

template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator* (const Point3D< U > &p) const
 * operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator/ (const Point3D< U > &p) const
 / operator
Point3D< T > & operator+= (const T val)
 += operator
Point3D< T > & operator-= (const T val)
 -= operator
Point3D< T > & operator*= (const T val)
 *= operator
Point3D< T > & operator/= (const T val)
 /= operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator+ (const U val) const
 + operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator- (const U val) const
 
  • operator

template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator* (const U val) const
 * operator
template<class U >
Point3D< typename
promote_trait< T, U >::TP > 
operator/ (const U val) const
 / operator
bool isValid () const
 test whether x and y and z are all positive
promote_trait< T, float >::TP squdist (const Point3D< T > &p) const
 the square of the euclidean distance
promote_trait< T, float >::TP distance (const Point3D< T > &p) const
 the euclidean distance from p
promote_trait< T, float >::TP magnitude () const
 the magnitude
Image< T > getImage ()
 Get an image representation used for matrix operations [x,y,z].
 Point3D ()
 The default constructor initializes the coordinates to (0,0).
 Point3D (const int xx, const int yy, const int zz)
 Initialize the Point2D<int> from horizontal & vertical coordinates.
Point3Doperator+= (const Point3D &p)
 += operator
Point3Doperator-= (const Point3D &p)
 -= operator
Point3Doperator*= (const Point3D &p)
 *= operator
Point3Doperator/= (const Point3D &p)
 /= operator
Point3D operator+ (const Point3D &p) const
 + operator
Point3D operator- (const Point3D &p) const
 
  • operator

Point3D operator* (const Point3D &p) const
 * operator
Point3D operator/ (const Point3D &p) const
 / operator
Point3Doperator+= (const int val)
 += operator
Point3Doperator-= (const int val)
 -= operator
Point3Doperator*= (const int val)
 *= operator
Point3Doperator/= (const int val)
 /= operator
Point3D operator+ (const int val) const
 + operator
Point3D operator- (const int val) const
 
  • operator

Point3D operator* (const int val) const
 * operator
Point3D operator/ (const int val) const
 / operator
bool isValidX () const
 test whether x is positive
bool isValidY () const
 test whether y is positive
bool isValidZ () const
 test whether z is positive
float squdist (const Point3D &p) const
 the square euclidean distance from p
float distance (const Point3D &p) const
 the euclidean distance from p
 Point3D (float xval, float yval, float zval)

Public Attributes

int x
 3D coordinates
int y
int z
x
 3D coordinates
y
z
double x
double y
double z
float x
float y
float z

Detailed Description

template<class T>
class Point3D< T >

This is a basic class to encode 3D integer coordinates.

This is a basic class to encode 3D coordinates.

This is a completely public class whose goal is just to provide a shorthand notation for 3D integer coordinates. All methods are inlined, so there is no .C file, just a .H file.

This is a completely public class whose goal is just to provide a shorthand notation for 3D coordinates.

Definition at line 50 of file Point3D.H.


Constructor & Destructor Documentation

template<class T >
Point3D< T >::Point3D (  )  [inline]

The default constructor initializes the coordinates to (0,0).

Definition at line 133 of file Point3D.H.

References Point3D< T >::x.

Referenced by Point3D< T >::operator*(), Point3D< T >::operator+(), Point3D< T >::operator-(), and Point3D< T >::operator/().

template<class T>
Point3D< T >::Point3D ( const int  xx,
const int  yy,
const int  zz 
) [inline]

Initialize the Point2D<int> from horizontal & vertical coordinates.

Definition at line 137 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D< T >::Point3D (  )  [inline]

The default constructor initializes the coordinates to (0,0).

template<class T>
Point3D< T >::Point3D ( const T  xx,
const T  yy,
const T  zz 
) [inline]

Initialize the Point3D from horizontal & vertical coordinates.

Definition at line 180 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D< T >::Point3D ( const Image< T > &  mat  )  [inline]

Initialize the Point3D from an image.

Definition at line 185 of file Point3D.H.

References ASSERT, Image< T >::size(), and Point3D< T >::x.

template<class T >
template<class U >
Point3D< T >::Point3D ( const Point3D< U > &  a  )  [inline, explicit]

Explicit conversion from type T to another type U.

Note that this simply uses clamped_convert, so it will clamp coordinates to the available range of T, and may round down.

Definition at line 194 of file Point3D.H.

template<class T>
Point3D< T >::Point3D (  )  [inline]

The default constructor initializes the coordinates to (0,0).

template<class T>
Point3D< T >::Point3D ( const int  xx,
const int  yy,
const int  zz 
) [inline]

Initialize the Point2D<int> from horizontal & vertical coordinates.


Member Function Documentation

template<class T>
float Point3D< T >::distance ( const Point3D< T > &  p  )  const [inline]

the euclidean distance from p

template<class T>
promote_trait<T,float>::TP Point3D< T >::distance ( const Point3D< T > &  p  )  const [inline]

the euclidean distance from p

template<class T >
float Point3D< T >::distance ( const Point3D< T > &  p  )  const [inline]

the euclidean distance from p

Definition at line 232 of file Point3D.H.

References sqrt(), and Point3D< T >::squdist().

template<class T >
Image< T > Point3D< T >::getImage (  )  [inline]

Get an image representation used for matrix operations [x,y,z].

Definition at line 343 of file Point3D.H.

References NO_INIT, and Point3D< T >::x.

template<class T >
bool Point3D< T >::isValid (  )  const [inline]

test whether x and y and z are all positive

Definition at line 316 of file Point3D.H.

References Point3D< T >::x.

template<class T>
bool Point3D< T >::isValidX (  )  const [inline]

test whether x is positive

template<class T>
bool Point3D< T >::isValidX (  )  const [inline]

test whether x is positive

Definition at line 213 of file Point3D.H.

References Point3D< T >::x.

template<class T>
bool Point3D< T >::isValidY (  )  const [inline]

test whether y is positive

template<class T>
bool Point3D< T >::isValidY (  )  const [inline]

test whether y is positive

Definition at line 217 of file Point3D.H.

template<class T>
bool Point3D< T >::isValidZ (  )  const [inline]

test whether z is positive

template<class T>
bool Point3D< T >::isValidZ (  )  const [inline]

test whether z is positive

Definition at line 221 of file Point3D.H.

template<class T >
promote_trait< T, float >::TP Point3D< T >::magnitude (  )  const [inline]

the magnitude

Definition at line 338 of file Point3D.H.

References sqrt(), and Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator* ( const int  val  )  const [inline]

* operator

template<class T>
Point3D Point3D< T >::operator* ( const Point3D< T > &  p  )  const [inline]

* operator

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator* ( const U  val  )  const [inline]

* operator

Definition at line 284 of file Point3D.H.

References Point3D< T >::x.

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator* ( const Point3D< U > &  p  )  const [inline]

* operator

Definition at line 236 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator* ( const int  val  )  const [inline]

* operator

Definition at line 197 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator* ( const Point3D< T > &  p  )  const [inline]

* operator

Definition at line 165 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D& Point3D< T >::operator*= ( const int  val  )  [inline]

*= operator

template<class T>
Point3D& Point3D< T >::operator*= ( const Point3D< T > &  p  )  [inline]

*= operator

template<class T>
Point3D< T > & Point3D< T >::operator*= ( const T  val  )  [inline]

*= operator

Definition at line 258 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D<T>& Point3D< T >::operator*= ( const Point3D< T > &  p  )  [inline]

*= operator

template<class T>
Point3D & Point3D< T >::operator*= ( const int  val  )  [inline]

*= operator

Definition at line 181 of file Point3D.H.

References Point3D< T >::x.

template<class T >
Point3D & Point3D< T >::operator*= ( const Point3D< T > &  p  )  [inline]

*= operator

Definition at line 149 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator+ ( const int  val  )  const [inline]

+ operator

template<class T>
Point3D Point3D< T >::operator+ ( const Point3D< T > &  p  )  const [inline]

+ operator

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator+ ( const U  val  )  const [inline]

+ operator

Definition at line 270 of file Point3D.H.

References Point3D< T >::x.

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator+ ( const Point3D< U > &  p  )  const [inline]

+ operator

Definition at line 222 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator+ ( const int  val  )  const [inline]

+ operator

Definition at line 189 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator+ ( const Point3D< T > &  p  )  const [inline]

+ operator

Definition at line 157 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D& Point3D< T >::operator+= ( const int  val  )  [inline]

+= operator

template<class T>
Point3D& Point3D< T >::operator+= ( const Point3D< T > &  p  )  [inline]

+= operator

template<class T>
Point3D< T > & Point3D< T >::operator+= ( const T  val  )  [inline]

+= operator

Definition at line 248 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D<T>& Point3D< T >::operator+= ( const Point3D< T > &  p  )  [inline]

+= operator

template<class T>
Point3D & Point3D< T >::operator+= ( const int  val  )  [inline]

+= operator

Definition at line 173 of file Point3D.H.

References Point3D< T >::x.

template<class T >
Point3D & Point3D< T >::operator+= ( const Point3D< T > &  p  )  [inline]

+= operator

Definition at line 141 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator- ( const int  val  )  const [inline]

  • operator

template<class T>
Point3D Point3D< T >::operator- ( const Point3D< T > &  p  )  const [inline]

  • operator

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator- ( const U  val  )  const [inline]

  • operator

Definition at line 277 of file Point3D.H.

References Point3D< T >::x.

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator- ( const Point3D< U > &  p  )  const [inline]

  • operator

Definition at line 229 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator- ( const int  val  )  const [inline]

  • operator

Definition at line 193 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator- ( const Point3D< T > &  p  )  const [inline]

  • operator

Definition at line 161 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D& Point3D< T >::operator-= ( const int  val  )  [inline]

-= operator

template<class T>
Point3D& Point3D< T >::operator-= ( const Point3D< T > &  p  )  [inline]

-= operator

template<class T>
Point3D< T > & Point3D< T >::operator-= ( const T  val  )  [inline]

-= operator

Definition at line 253 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D<T>& Point3D< T >::operator-= ( const Point3D< T > &  p  )  [inline]

-= operator

template<class T>
Point3D & Point3D< T >::operator-= ( const int  val  )  [inline]

-= operator

Definition at line 177 of file Point3D.H.

References Point3D< T >::x.

template<class T >
Point3D & Point3D< T >::operator-= ( const Point3D< T > &  p  )  [inline]

-= operator

Definition at line 145 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator/ ( const int  val  )  const [inline]

/ operator

template<class T>
Point3D Point3D< T >::operator/ ( const Point3D< T > &  p  )  const [inline]

/ operator

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator/ ( const U  val  )  const [inline]

/ operator

Definition at line 291 of file Point3D.H.

References Point3D< T >::x.

template<class T >
template<class U >
Point3D< typename promote_trait< T, U >::TP > Point3D< T >::operator/ ( const Point3D< U > &  p  )  const [inline]

/ operator

Definition at line 243 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator/ ( const int  val  )  const [inline]

/ operator

Definition at line 201 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D Point3D< T >::operator/ ( const Point3D< T > &  p  )  const [inline]

/ operator

Definition at line 169 of file Point3D.H.

References Point3D< T >::Point3D(), and Point3D< T >::x.

template<class T>
Point3D& Point3D< T >::operator/= ( const int  val  )  [inline]

/= operator

template<class T>
Point3D& Point3D< T >::operator/= ( const Point3D< T > &  p  )  [inline]

/= operator

template<class T>
Point3D< T > & Point3D< T >::operator/= ( const T  val  )  [inline]

/= operator

Definition at line 263 of file Point3D.H.

References Point3D< T >::x.

template<class T>
Point3D<T>& Point3D< T >::operator/= ( const Point3D< T > &  p  )  [inline]

/= operator

template<class T>
Point3D & Point3D< T >::operator/= ( const int  val  )  [inline]

/= operator

Definition at line 185 of file Point3D.H.

References Point3D< T >::x.

template<class T >
Point3D & Point3D< T >::operator/= ( const Point3D< T > &  p  )  [inline]

/= operator

Definition at line 153 of file Point3D.H.

References Point3D< T >::x.

template<class T>
float Point3D< T >::squdist ( const Point3D< T > &  p  )  const [inline]

the square euclidean distance from p

template<class T>
promote_trait<T,float>::TP Point3D< T >::squdist ( const Point3D< T > &  p  )  const [inline]

the square of the euclidean distance

template<class T >
float Point3D< T >::squdist ( const Point3D< T > &  p  )  const [inline]

the square euclidean distance from p

Definition at line 225 of file Point3D.H.

References Point3D< T >::x.

Referenced by Point3D< T >::distance().


Member Data Documentation

template<class T>
T Point3D< T >::x

3D coordinates

Definition at line 144 of file Point3D.H.

template<class T>
int Point3D< T >::x

The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:40 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3