#ifndef TRIANGLES3TDISPLAYMULTICOLORED_H
#define TRIANGLES3TDISPLAYMULTICOLORED_H

#include <vector>
using namespace std;

#include <triangles3Tdisplay.h>
#include <random.h>

/*!
\brief Drawing triangles each with a random color, 
       using OpenGL commands.
*/
template< typename T, typename W >
class triangles3Tdisplaymulticolored : 
  public triangles3TdisplayCpertriangle<T,W,GLdouble>
{
public:

  /** Each triangle has a unique color. */
  vector< point3<double> > vcolors;

  /** Pass in the geometry to be displayed. */
  triangles3Tdisplaymulticolored
  (
    uintc visize_, 
    point3<uint> const * vi_,
    point3<W> const * pts_
  )
    : triangles3TdisplayCpertriangle<T,W,GLdouble>(visize_,vi_,pts_,0) 
    {
      random11<double> r;
      for (uint i=0; i<visize_; ++i)
        vcolors.push_back( point3<double>(r(),r(),r()) );

      triangles3TdisplayCpertriangle<T,W,GLdouble>::colors = & vcolors[0];
    } 

};




#endif



