Public Member Functions | Public Attributes

lssr::Normal< CoordType > Class Template Reference

A normal implementation. Basically a vertex with normalization functionality. More...

#include <Normal.hpp>

Inheritance diagram for lssr::Normal< CoordType >:
Inheritance graph
[legend]
Collaboration diagram for lssr::Normal< CoordType >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Normal ()
 Default constructor. All elements are set to zero.
 Normal (CoordType x, CoordType y, CoordType z)
 Constructs a new normal from the given components. Applies normalization.
template<typename T >
 Normal (const Vertex< T > &other)
 Copy constructor for vertices. Applies normalization.
template<typename T >
 Normal (const Normal &other)
 Constructs from another normal. Implemented to avoid unnecessary normalizations.
virtual ~Normal ()
void normalize ()
 Normalizes the components.
Normal< CoordType > operator+ (const Normal &n) const
virtual Normal< CoordType > operator- (const Normal &n) const
void operator+= (const Normal &n)
void operator-= (const Normal &n)
CoordType length ()
 Return the current length of the vector.
Vertex< CoordType > cross (const Vertex &other) const
 Calculates the cross product between this and the given vector. Returns a new Vertex instance.
void rotate (const Matrix4< CoordType > &m)
 Applies the given matrix. Translational components are ignored (matrix must be row major).
void rotateCM (const Matrix4< CoordType > &m)
 Applies the given matrix. Translational components are ignored.
void rotateRM (const Matrix4< CoordType > &m)
 Applies the given matrix. Translational components are ignored.
void transform (const Matrix4< CoordType > &m)
 Transforms the vertex according to the given matrix (Default: matrix is row major).
void transformRM (const Matrix4< CoordType > &m)
 Transforms the vertex according to the given matrix (Row major format).
void transformCM (const Matrix4< CoordType > &m)
 Transforms the vertex according to the given matrix (Column major format).
virtual void crossTo (const Vertex &other)
 Calculates the cross product with the other given Vertex and assigns the result to the current instance.
virtual CoordType operator* (const Vertex &other) const
 Multiplication operator (dot product).
virtual Vertex< CoordType > operator* (const CoordType &scale) const
 Multiplication operator (scaling).
virtual Vertex< CoordType > operator+ (const Vertex &other) const
virtual Vertex< CoordType > operator- (const Vertex &other) const
 Coordinate subtraction.
virtual void operator-= (const Vertex &other)
 Coordinate substraction.
virtual void operator+= (const Vertex< CoordType > &other)
 Coordinate addition.
virtual void operator*= (const CoordType &scale)
 Scaling.
virtual void operator/= (const CoordType &scale)
 Scaling.
virtual bool operator== (const Vertex &other) const
 Compares two vertices.
virtual bool operator!= (const Vertex &other) const
 Compares two vertices.
virtual CoordType operator[] (const int &index) const
 Indexed coordinate access (reading).
virtual CoordType & operator[] (const int &index)
 Indexed coordinate access (writing).

Public Attributes

CoordType m_x
 The x-coordinate of the vertex.
CoordType m_y
 The y-coordinate of the vertex.
CoordType m_z
 The z-coordinate of the vertex.

Detailed Description

template<typename CoordType>
class lssr::Normal< CoordType >

A normal implementation. Basically a vertex with normalization functionality.

Definition at line 21 of file Normal.hpp.


Constructor & Destructor Documentation

template<typename CoordType>
lssr::Normal< CoordType >::Normal (  )  [inline]

Default constructor. All elements are set to zero.

Definition at line 30 of file Normal.hpp.

template<typename CoordType>
lssr::Normal< CoordType >::Normal ( CoordType  x,
CoordType  y,
CoordType  z 
) [inline]

Constructs a new normal from the given components. Applies normalization.

Definition at line 36 of file Normal.hpp.

Here is the call graph for this function:

template<typename CoordType>
template<typename T >
lssr::Normal< CoordType >::Normal ( const Vertex< T > &  other  )  [inline]

Copy constructor for vertices. Applies normalization.

Definition at line 47 of file Normal.hpp.

Here is the call graph for this function:

template<typename CoordType>
template<typename T >
lssr::Normal< CoordType >::Normal ( const Normal< CoordType > &  other  )  [inline]

Constructs from another normal. Implemented to avoid unnecessary normalizations.

Definition at line 57 of file Normal.hpp.

template<typename CoordType>
virtual lssr::Normal< CoordType >::~Normal (  )  [inline, virtual]

Definition at line 64 of file Normal.hpp.


Member Function Documentation

template<typename CoordType>
Vertex<CoordType> lssr::Vertex< CoordType >::cross ( const Vertex< CoordType > &  other  )  const [inherited]

Calculates the cross product between this and the given vector. Returns a new Vertex instance.

Parameters:
other The second cross product vector
template<typename CoordType>
virtual void lssr::Vertex< CoordType >::crossTo ( const Vertex< CoordType > &  other  )  [virtual, inherited]

Calculates the cross product with the other given Vertex and assigns the result to the current instance.

template<typename CoordType>
CoordType lssr::Vertex< CoordType >::length (  )  [inherited]

Return the current length of the vector.

template<typename CoordType>
void lssr::Normal< CoordType >::normalize (  ) 

Normalizes the components.

Here is the caller graph for this function:

template<typename CoordType>
virtual bool lssr::Vertex< CoordType >::operator!= ( const Vertex< CoordType > &  other  )  const [inline, virtual, inherited]

Compares two vertices.

Definition at line 181 of file Vertex.hpp.

template<typename CoordType>
virtual Vertex<CoordType> lssr::Vertex< CoordType >::operator* ( const CoordType &  scale  )  const [virtual, inherited]

Multiplication operator (scaling).

template<typename CoordType>
virtual CoordType lssr::Vertex< CoordType >::operator* ( const Vertex< CoordType > &  other  )  const [virtual, inherited]

Multiplication operator (dot product).

template<typename CoordType>
virtual void lssr::Vertex< CoordType >::operator*= ( const CoordType &  scale  )  [virtual, inherited]

Scaling.

template<typename CoordType>
Normal<CoordType> lssr::Normal< CoordType >::operator+ ( const Normal< CoordType > &  n  )  const [inline]

Definition at line 71 of file Normal.hpp.

template<typename CoordType>
virtual Vertex<CoordType> lssr::Vertex< CoordType >::operator+ ( const Vertex< CoordType > &  other  )  const [virtual, inherited]
template<typename CoordType>
void lssr::Normal< CoordType >::operator+= ( const Normal< CoordType > &  n  )  [inline]

Definition at line 81 of file Normal.hpp.

template<typename CoordType>
virtual void lssr::Vertex< CoordType >::operator+= ( const Vertex< CoordType > &  other  )  [virtual, inherited]

Coordinate addition.

template<typename CoordType>
virtual Vertex<CoordType> lssr::Vertex< CoordType >::operator- ( const Vertex< CoordType > &  other  )  const [virtual, inherited]

Coordinate subtraction.

template<typename CoordType>
virtual Normal<CoordType> lssr::Normal< CoordType >::operator- ( const Normal< CoordType > &  n  )  const [inline, virtual]

Definition at line 76 of file Normal.hpp.

template<typename CoordType>
virtual void lssr::Vertex< CoordType >::operator-= ( const Vertex< CoordType > &  other  )  [virtual, inherited]

Coordinate substraction.

template<typename CoordType>
void lssr::Normal< CoordType >::operator-= ( const Normal< CoordType > &  n  )  [inline]

Definition at line 86 of file Normal.hpp.

template<typename CoordType>
virtual void lssr::Vertex< CoordType >::operator/= ( const CoordType &  scale  )  [virtual, inherited]

Scaling.

template<typename CoordType>
virtual bool lssr::Vertex< CoordType >::operator== ( const Vertex< CoordType > &  other  )  const [virtual, inherited]

Compares two vertices.

template<typename CoordType>
virtual CoordType lssr::Vertex< CoordType >::operator[] ( const int &  index  )  const [virtual, inherited]

Indexed coordinate access (reading).

template<typename CoordType>
virtual CoordType& lssr::Vertex< CoordType >::operator[] ( const int &  index  )  [virtual, inherited]

Indexed coordinate access (writing).

template<typename CoordType>
void lssr::Vertex< CoordType >::rotate ( const Matrix4< CoordType > &  m  )  [inherited]

Applies the given matrix. Translational components are ignored (matrix must be row major).

Parameters:
A 4x4 rotation matrix.
template<typename CoordType>
void lssr::Vertex< CoordType >::rotateCM ( const Matrix4< CoordType > &  m  )  [inherited]

Applies the given matrix. Translational components are ignored.

Parameters:
A 4x4 rotation matrix (column major).
template<typename CoordType>
void lssr::Vertex< CoordType >::rotateRM ( const Matrix4< CoordType > &  m  )  [inherited]

Applies the given matrix. Translational components are ignored.

Parameters:
A 4x4 rotation matrix (row major).
template<typename CoordType>
void lssr::Vertex< CoordType >::transform ( const Matrix4< CoordType > &  m  )  [inherited]

Transforms the vertex according to the given matrix (Default: matrix is row major).

Parameters:
A 4x4 tranformation matrix.
template<typename CoordType>
void lssr::Vertex< CoordType >::transformCM ( const Matrix4< CoordType > &  m  )  [inherited]

Transforms the vertex according to the given matrix (Column major format).

Parameters:
A 4x4 tranformation matrix.
template<typename CoordType>
void lssr::Vertex< CoordType >::transformRM ( const Matrix4< CoordType > &  m  )  [inherited]

Transforms the vertex according to the given matrix (Row major format).

Parameters:
A 4x4 tranformation matrix.

Member Data Documentation

template<typename CoordType>
CoordType lssr::Vertex< CoordType >::m_x [inherited]

The x-coordinate of the vertex.

Definition at line 198 of file Vertex.hpp.

template<typename CoordType>
CoordType lssr::Vertex< CoordType >::m_y [inherited]

The y-coordinate of the vertex.

Definition at line 201 of file Vertex.hpp.

template<typename CoordType>
CoordType lssr::Vertex< CoordType >::m_z [inherited]

The z-coordinate of the vertex.

Definition at line 204 of file Vertex.hpp.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Defines