proj home

Files   Classes   Functions   Hierarchy  

tetrahedrondisplaycentroid< TET > Class Template Reference

Display the average of the four points by constructing lines through the mid points. More...

#include <tetrahedrondisplay.h>

Inheritance diagram for tetrahedrondisplaycentroid< TET >:
Collaboration diagram for tetrahedrondisplaycentroid< TET >:

List of all members.

Public Member Functions

 tetrahedrondisplaycentroid (gobjContainer &_gx, TET const &_tr)
 The graphics output and tetrahedron.
void draw ()
 Write the graphics as gobj objects.


Detailed Description

template<typename TET>
class tetrahedrondisplaycentroid< TET >

Display the average of the four points by constructing lines through the mid points.

Definition at line 85 of file tetrahedrondisplay.h.


Constructor & Destructor Documentation

template<typename TET >
tetrahedrondisplaycentroid< TET >::tetrahedrondisplaycentroid ( gobjContainer _gx,
TET const &  _tr 
) [inline]

The graphics output and tetrahedron.

Definition at line 95 of file tetrahedrondisplay.h.

00098     : gx(_gx), tr(_tr) {}


Member Function Documentation

template<typename TET >
void tetrahedrondisplaycentroid< TET >::draw (  )  [inline, virtual]

Write the graphics as gobj objects.

Implements gobj.

Definition at line 296 of file tetrahedrondisplay.h.

References gobjContainer::push(), and gobjQuadric::radius.

00297 {
00298   gx.push( new gobjglColor3ub(0,255,0) );
00299 
00300   gobjQuadric * gd = new gobjQuadric();
00301   gd->radius=.02;
00302   gx.push( gd );
00303 
00304   typename TET::PTtype c;
00305   tr.centroid(c);
00306 
00307   typename TET::PTtype c0 = (tr.pi[1]+tr.pi[2]+tr.pi[3])/3.0;
00308   typename TET::PTtype c1 = (tr.pi[0]+tr.pi[2]+tr.pi[3])/3.0;
00309   typename TET::PTtype c2 = (tr.pi[1]+tr.pi[0]+tr.pi[3])/3.0;
00310   typename TET::PTtype c3 = (tr.pi[1]+tr.pi[0]+tr.pi[2])/3.0;
00311 
00312   gx.push( new gobjMySphereDraw(c,gd) );
00313 
00314   gx.push( new gobjglBegin(GL_LINES) );
00315   gx.push( new gobjglVertex3f(tr.pi[0]) );
00316   gx.push( new gobjglVertex3f(c0) );
00317   gx.push( new gobjglVertex3f(tr.pi[1]) );
00318   gx.push( new gobjglVertex3f(c1) );
00319   gx.push( new gobjglVertex3f(tr.pi[2]) );
00320   gx.push( new gobjglVertex3f(c2) );
00321   gx.push( new gobjglVertex3f(tr.pi[3]) );
00322   gx.push( new gobjglVertex3f(c3) );
00323   gx.push( new gobjglEnd() );
00324 
00325 }


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

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