proj home

Files   Classes   Functions   Hierarchy  

triangledisplaycentroid< TR > Class Template Reference

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

#include <triangledisplay.h>

Inheritance diagram for triangledisplaycentroid< TR >:
Collaboration diagram for triangledisplaycentroid< TR >:

List of all members.

Public Member Functions

 triangledisplaycentroid (gobjContainer &_gx, TR const &_tr)
 The graphics output and triangle initialized.
void draw ()
 Write the graphics as gobj objects.


Detailed Description

template<typename TR>
class triangledisplaycentroid< TR >

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

Definition at line 179 of file triangledisplay.h.


Constructor & Destructor Documentation

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

The graphics output and triangle initialized.

Definition at line 189 of file triangledisplay.h.

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


Member Function Documentation

template<typename TR >
void triangledisplaycentroid< TR >::draw (  )  [inline, virtual]

Write the graphics as gobj objects.

Implements gobj.

Definition at line 544 of file triangledisplay.h.

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

00545 {
00546   typename TR::PTtype m0;
00547   tr.midpoint(m0,0);
00548   typename TR::PTtype m1;
00549   tr.midpoint(m1,1);
00550   typename TR::PTtype m2;
00551   tr.midpoint(m2,2);
00552 
00553   gx.push( new gobjglColor3ub(0,255,0) );
00554   gx.push( new gobjglBegin(GL_LINES) );
00555   gx.push( new gobjglVertex3f(tr.pi[0]) );
00556   gx.push( new gobjglVertex3f(m0) );
00557   gx.push( new gobjglVertex3f(tr.pi[1]) );
00558   gx.push( new gobjglVertex3f(m1) );
00559   gx.push( new gobjglVertex3f(tr.pi[2]) );
00560   gx.push( new gobjglVertex3f(m2) );
00561   gx.push( new gobjglEnd() );
00562 
00563   typename TR::PTtype mc;
00564   tr.centroid(mc);
00565 
00566   gobjQuadric * gd = new gobjQuadric();
00567   gd->radius=.02;
00568   gx.push( gd );
00569   gx.push( new gobjMySphereDraw(mc,gd) );
00570 }


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

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