Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gmtl::Point Class Template Reference
[Abstract Data Types: Matrix, Vec, Quat, Coord, Sphere, Plane]

Point Use points when you need to represent a position. More...

#include <Point.h>

Inheritance diagram for gmtl::Point:

Inheritance graph
[legend]
Collaboration diagram for gmtl::Point:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DATA_TYPE DataType
 The datatype used for the components of this VecBase. More...

typedef VecBase< DATA_TYPE,
SIZE > 
BaseType
 Placeholder for the base type. More...

enum  Params { Size = SIZE }
 The number of components this VecBase has. More...


Public Methods

 Point ()
 Default constructor. More...

Value constructors
Construct with copy of rVec

 Point (const Point< DATA_TYPE, SIZE > &rVec)
 Point (const VecBase< DATA_TYPE, SIZE > &rVec)
 Point (const DATA_TYPE &val0, const DATA_TYPE &val1)
 Construct a 2-D point with 2 given values. More...

 Point (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2)
 Construct a 3-D point with 2 given values. More...

 Point (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2, const DATA_TYPE &val3)
 Construct a 4-D point with 2 given values. More...


Detailed Description

template<class DATA_TYPE, unsigned SIZE>
class gmtl::Point< DATA_TYPE, SIZE >

Point Use points when you need to represent a position.

Don't use points to represent a Vector. One difference you should note is that ceratain matrix operations are different between Point and Vec such as xform and operator *. A Vec xform by matrix is simply a rotation, while a Point xformed by a matrix is a full matrix transform (rotation, skew, translation, scale).

See also:
Point3f , Point4f , Point3d , Point4f

Definition at line 58 of file Point.h.


Member Typedef Documentation

template<class DATA_TYPE, unsigned SIZE>
typedef VecBase<DATA_TYPE, SIZE> gmtl::Point::BaseType
 

Placeholder for the base type.

Definition at line 65 of file Point.h.

Referenced by gmtl::Point< DATA_TYPE, 3 >::Point.

template<class DATA_TYPE, unsigned SIZE>
typedef DATA_TYPE gmtl::Point::DataType
 

The datatype used for the components of this VecBase.

Reimplemented from gmtl::VecBase.

Definition at line 61 of file Point.h.


Member Enumeration Documentation

template<class DATA_TYPE, unsigned SIZE>
enum gmtl::Point::Params
 

The number of components this VecBase has.

Enumeration values:
Size 

Reimplemented from gmtl::VecBase.

Definition at line 62 of file Point.h.

00062 { Size = SIZE };


Constructor & Destructor Documentation

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point   [inline]
 

Default constructor.

Definition at line 70 of file Point.h.

00071    {
00072       for (unsigned i = 0; i < SIZE; ++i)
00073          this->mData[i] = (DATA_TYPE)0;
00074    }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point const Point< DATA_TYPE, SIZE > &    rVec [inline]
 

Definition at line 80 of file Point.h.

00081       : BaseType(static_cast<BaseType>(rVec))
00082    {;}

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point const VecBase< DATA_TYPE, SIZE > &    rVec [inline]
 

Definition at line 83 of file Point.h.

00084       : BaseType(rVec)
00085    {;}

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point const DATA_TYPE &    val0,
const DATA_TYPE &    val1
[inline]
 

Construct a 2-D point with 2 given values.

Definition at line 90 of file Point.h.

00091    : BaseType(val0, val1)
00092    {
00093       // @todo need compile time assert
00094       gmtlASSERT( SIZE == 2 && "out of bounds element access in Point" );
00095    }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point const DATA_TYPE &    val0,
const DATA_TYPE &    val1,
const DATA_TYPE &    val2
[inline]
 

Construct a 3-D point with 2 given values.

Definition at line 100 of file Point.h.

00101    : BaseType(val0, val1, val2)
00102    {
00103       // @todo need compile time assert
00104       gmtlASSERT( SIZE == 3 && "out of bounds element access in Point" );
00105    }

template<class DATA_TYPE, unsigned SIZE>
gmtl::Point< DATA_TYPE, SIZE >::Point const DATA_TYPE &    val0,
const DATA_TYPE &    val1,
const DATA_TYPE &    val2,
const DATA_TYPE &    val3
[inline]
 

Construct a 4-D point with 2 given values.

Definition at line 110 of file Point.h.

00111    : BaseType(val0, val1, val2, val3)
00112    {
00113       // @todo need compile time assert
00114       gmtlASSERT( SIZE == 4 && "out of bounds element access in Point" );
00115    }


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 15:29:30 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002