proj home

Files   Classes   Functions   Hierarchy  

triangles3TdisplayN< T, W > Class Template Reference

Drawing triangles with normals at the points, using OpenGL commands. More...

#include <triangles3Tdisplay.h>

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

List of all members.

Public Member Functions

 triangles3TdisplayN (uintc visize_, point3< uint > const *vi_, point3< W > const *pts_, point3< W > const *normals_)
 Pass in the geometry to be displayed.
void draw ()
 Draw triangles with normals at each point.

Public Attributes

point3< W > const * normals
 The global points.


Detailed Description

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

Drawing triangles with normals at the points, using OpenGL commands.

Definition at line 76 of file triangles3Tdisplay.h.


Constructor & Destructor Documentation

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

Pass in the geometry to be displayed.

Definition at line 85 of file triangles3Tdisplay.h.

00091     : triangles3Tdisplay<T,W>(visize_,vi_,pts_), 
00092     normals(normals_) {}


Member Function Documentation

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

Draw triangles with normals at each point.

Reimplemented from triangles3Tdisplay< T, W >.

Definition at line 95 of file triangles3Tdisplay.h.

References GOBJDEBUGCODE, triangles3TdisplayN< T, W >::normals, point3< T >::x, point3< T >::y, and point3< T >::z.

00096   {
00097     GOBJDEBUGCODE
00098     point3<uint> const * t;
00099     glBegin(GL_TRIANGLES);
00100     for (uint i=0; i<triangles3Tdisplay<T,W>::visize; ++i)
00101     {
00102       t = & triangles3Tdisplay<T,W>::vi[i];
00103 
00104       point3<W> const & n0( normals[t->x] );
00105       glNormal3T<T>()(n0.x,n0.y,n0.z);
00106       point3<W> const & p0( triangles3Tdisplay<T,W>::pts[t->x] );
00107       glVertex3T<T>()(p0.x,p0.y,p0.z);
00108 
00109       point3<W> const & n1( normals[t->y] );
00110       glNormal3T<T>()(n1.x,n1.y,n1.z);
00111       point3<W> const & p1( triangles3Tdisplay<T,W>::pts[t->y] );
00112       glVertex3T<T>()(p1.x,p1.y,p1.z);
00113 
00114       point3<W> const & n2( normals[t->z] );
00115       glNormal3T<T>()(n2.x,n2.y,n2.z);
00116       point3<W> const & p2( triangles3Tdisplay<T,W>::pts[t->z] );
00117       glVertex3T<T>()(p2.x,p2.y,p2.z);
00118     }
00119 
00120     glEnd();
00121   }


Member Data Documentation

template<typename T, typename W>
point3<W> const* triangles3TdisplayN< T, W >::normals

The global points.

Definition at line 81 of file triangles3Tdisplay.h.

Referenced by triangles3TdisplayN< 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