#ifndef TRIANGLEINDEXED_H
#define TRIANGLEINDEXED_H

#include <vector>
using namespace std;



/*!
\brief Indexed triangles.

Let the indexed triangle be a triangle with an anti clockwise winding.
  Integers index into the points.
*/
template< typename T >
class triangleindexed
{
public:

  /** The triangles. */
  vector< uint > vi;
  /** The triangles index into the points. */
  vector< T > points;

};

/*!
\brief Indexed triangle and variables as references.
*/
template< typename T >
class triangleindexedref
{
public:

  /** The triangles. */
  vector< uint > & vi;
  /** The triangles index into the points. */
  vector< T > & points;

  /** Set the references. */
  triangleindexedref
  (
    vector< uint > & vi_,
    vector< T > & points_
  )
    : vi(vi_), points(points_) {}
};


/*!
\brief Indexed triangles with normals at each point.
*/
template< typename T >
class triangleindexedN
{
public:

  /** The triangles. */
  vector< uint > vi;
  /** The triangles index into the points. */
  vector< T > points;
  /** The normals are at the same index as their associated point. */
  vector< T > normals;

};
  
/*!
\brief Indexed triangles with normals at each point and variables as references.
*/
template< typename T >
class triangleindexedNref
{
public:
 
  /** The triangles. */
  vector< uint >& vi;
  /** The triangles index into the points. */
  vector< T >& points;
  /** The normals are at the same index as their associated point. */
  vector< T >& normals;

  /** Set the references. */
  triangleindexedNref
  (
    vector< uint > & vi_,
    vector< T > & points_,
    vector< T> & normals_
  )
    : vi(vi_), points(points_), normals(normals_) {}

};






#endif



