proj home

Files   Classes   Functions   Hierarchy  

triangles3TdisplayCpertriangle< T, W, C > Class Template Reference

Drawing triangles each with a color, using OpenGL commands. More...

#include <triangles3Tdisplay.h>

Inheritance diagram for triangles3TdisplayCpertriangle< T, W, C >:
Collaboration diagram for triangles3TdisplayCpertriangle< T, W, C >:

List of all members.

Public Member Functions

 triangles3TdisplayCpertriangle (uintc visize_, point3< uint > const *vi_, point3< W > const *pts_, point3< W > const *colors_)
 Pass in the geometry to be displayed.
void draw ()
 Draw triangles each with a color.

Public Attributes

point3< C > const * colors
 The global colors.


Detailed Description

template<typename T, typename W, typename C>
class triangles3TdisplayCpertriangle< T, W, C >

Drawing triangles each with a color, using OpenGL commands.

Definition at line 270 of file triangles3Tdisplay.h.


Constructor & Destructor Documentation

template<typename T, typename W, typename C>
triangles3TdisplayCpertriangle< T, W, C >::triangles3TdisplayCpertriangle ( uintc  visize_,
point3< uint > const *  vi_,
point3< W > const *  pts_,
point3< W > const *  colors_ 
) [inline]

Pass in the geometry to be displayed.

Definition at line 279 of file triangles3Tdisplay.h.

00285     : triangles3Tdisplay<T,W>(visize_,vi_,pts_), 
00286     colors(colors_) {}


Member Function Documentation

template<typename T, typename W, typename C>
void triangles3TdisplayCpertriangle< T, W, C >::draw (  )  [inline, virtual]

Draw triangles each with a color.

Reimplemented from triangles3Tdisplay< T, W >.

Definition at line 289 of file triangles3Tdisplay.h.

00290   {
00291     GOBJDEBUGCODE
00292     point3<uint> const * t;
00293     glBegin(GL_TRIANGLES);
00294     for (uint i=0; i<triangles3Tdisplay<T,W>::visize; ++i)
00295     {
00296       point3<C> const & c0(colors[i]);
00297       glColor3T<C>()(c0.x,c0.y,c0.z);
00298 
00299       t = & triangles3Tdisplay<T,W>::vi[i];
00300 
00301       point3<W> const & p0( triangles3Tdisplay<T,W>::pts[t->x] );
00302       glVertex3T<T>()(p0.x,p0.y,p0.z);
00303 
00304       point3<W> const & p1( triangles3Tdisplay<T,W>::pts[t->y] );
00305       glVertex3T<T>()(p1.x,p1.y,p1.z);
00306 
00307       point3<W> const & p2( triangles3Tdisplay<T,W>::pts[t->z] );
00308       glVertex3T<T>()(p2.x,p2.y,p2.z);
00309     }
00310 
00311     glEnd();
00312   }


Member Data Documentation

template<typename T, typename W, typename C>
point3<C> const* triangles3TdisplayCpertriangle< T, W, C >::colors

The global colors.

Definition at line 275 of file triangles3Tdisplay.h.

Referenced by triangles3TdisplayCpertriangle< T, W, GLdouble >::draw().


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

Generated on Fri Mar 4 00:50:22 2011 for Chelton Evans Source by  doxygen 1.5.8