Public Types | Public Member Functions

gmtl::Point< DATA_TYPE, SIZE > 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< DATA_TYPE, SIZE >:
Inheritance graph
[legend]
Collaboration diagram for gmtl::Point< DATA_TYPE, SIZE >:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Params { Size = SIZE }
 

The number of components this VecB has.

More...
typedef DATA_TYPE DataType
 The datatype used for the components of this VecB.
typedef VecBase< DATA_TYPE, SIZE > BaseType
 Placeholder for the base type.
typedef Point< DATA_TYPE, SIZE > VecType

Public Member Functions

 Point ()
 Default constructor.
template<typename REP2 >
VecTypeoperator= (const VecBase< DATA_TYPE, SIZE, REP2 > &rhs)
 Assign from different rep.
Value constructors

Construct with copy of rVec

template<typename REP2 >
 Point (const VecBase< DATA_TYPE, SIZE, REP2 > &rVec)
 Point (const DATA_TYPE &val0, const DATA_TYPE &val1)
 Construct a 2-D point with 2 given values.
 Point (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2)
 Construct a 3-D point with 2 given values.
 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.

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 30 of file Point.h.


Member Typedef Documentation

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

Placeholder for the base type.

Definition at line 37 of file Point.h.

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

The datatype used for the components of this VecB.

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE >.

Definition at line 33 of file Point.h.

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

Definition at line 38 of file Point.h.


Member Enumeration Documentation

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

The number of components this VecB has.

Enumerator:
Size 

Reimplemented from gmtl::VecBase< DATA_TYPE, SIZE >.

Definition at line 34 of file Point.h.

{ Size = SIZE };


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 43 of file Point.h.

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

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

Definition at line 65 of file Point.h.

      : BaseType( rVec )
   {
   }

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 74 of file Point.h.

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

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 84 of file Point.h.

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

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 94 of file Point.h.

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


Member Function Documentation

template<class DATA_TYPE, unsigned SIZE>
template<typename REP2 >
VecType& gmtl::Point< DATA_TYPE, SIZE >::operator= ( const VecBase< DATA_TYPE, SIZE, REP2 > &  rhs  )  [inline]

Assign from different rep.

Definition at line 111 of file Point.h.

   {
      BaseType::operator=(rhs);
      return *this;
   }


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