proj home

Files   Classes   Functions   Hierarchy  

triangles3Tdisplay< T, W > Class Template Reference

Base class for drawing triangles as index points using OpenGL commands. More...

#include <triangles3Tdisplay.h>

Inheritance diagram for triangles3Tdisplay< T, W >:
Collaboration diagram for triangles3Tdisplay< T, W >:

List of all members.

Public Member Functions

 triangles3Tdisplay (uintc visize_, point3< uint > const *vi_, point3< W > const *pts_)
 Pass in the geometry to be displayed.
void draw ()
 Draw faceted triangles.

Public Attributes

uint visize
 The number of triangles.
point3< uint > const * vi
 The indexed triangles.
point3< W > const * pts
 The global points.


Detailed Description

template<typename T, typename W>
class triangles3Tdisplay< T, W >

Base class for drawing triangles as index points using OpenGL commands.

The triangles are represented by integer indexes into a global points stack.The order of the triangles is assumed to be anti-clockwise.

Definition at line 23 of file triangles3Tdisplay.h.


Constructor & Destructor Documentation

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

Pass in the geometry to be displayed.

Definition at line 38 of file triangles3Tdisplay.h.

00043     : visize(visize_), vi(vi_), pts(pts_) {}


Member Function Documentation

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

Draw faceted triangles.

Implements gobj.

Reimplemented in triangles3TdisplayN< T, W >, triangles3TdisplayNC< T, W, C >, triangles3TdisplayNCpertriangle< T, W, C >, triangles3TdisplayCpertriangle< T, W, C >, and triangles3TdisplayCpertriangle< T, W, GLdouble >.

Definition at line 46 of file triangles3Tdisplay.h.

00047   {
00048     GOBJDEBUGCODE
00049     point3<uint> const * t;
00050     glBegin(GL_TRIANGLES);
00051     for (uint i=0; i<visize; ++i)
00052     {
00053       t = & vi[i];
00054       point3<W> const & p0( pts[t->x] );
00055       glVertex3T<T>()(p0.x,p0.y,p0.z);
00056       point3<W> const & p1( pts[t->y] );
00057       glVertex3T<T>()(p1.x,p1.y,p1.z);
00058       point3<W> const & p2( pts[t->z] );
00059       glVertex3T<T>()(p2.x,p2.y,p2.z);
00060     }
00061 
00062     glEnd();
00063   }


Member Data Documentation

template<typename T, typename W>
point3<W> const* triangles3Tdisplay< T, W >::pts

The global points.

Definition at line 34 of file triangles3Tdisplay.h.

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

template<typename T, typename W>
point3<uint> const* triangles3Tdisplay< T, W >::vi

The indexed triangles.

Definition at line 31 of file triangles3Tdisplay.h.

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

template<typename T, typename W>
uint triangles3Tdisplay< T, W >::visize

The number of triangles.

Definition at line 28 of file triangles3Tdisplay.h.

Referenced by triangles3Tdisplay< T,W >::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