proj home

Files   Classes   Functions   Hierarchy  

triangledisplaynapoleanpoint< TR > Class Template Reference

Display the triangle's napolean point. More...

#include <triangledisplay.h>

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

List of all members.

Public Member Functions

 triangledisplaynapoleanpoint (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 triangledisplaynapoleanpoint< TR >

Display the triangle's napolean point.

Construct equilateral triangles about the center triangle, then connect their centroids with the opposite point in the central triangle.

Definition at line 309 of file triangledisplay.h.


Constructor & Destructor Documentation

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

The graphics output and triangle initialized.

Definition at line 319 of file triangledisplay.h.

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


Member Function Documentation

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

Write the graphics as gobj objects.

Implements gobj.

Definition at line 358 of file triangledisplay.h.

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

00359 {
00360   gx.push( new gobjglColor3ub(0,0,139) );
00361 
00362   gobjQuadric * gd = new gobjQuadric();
00363   gd->radius=.02;
00364   gx.push( gd );
00365 
00366   typename TR::PTtype e0;
00367   tr.equilaterali(e0,0);
00368   typename TR::PTtype e1;
00369   tr.equilaterali(e1,1);
00370   typename TR::PTtype e2;
00371   tr.equilaterali(e2,2);
00372 
00373   gx.push( new gobjMySphereDraw(e0,gd) );
00374   gx.push( new gobjMySphereDraw(e1,gd) );
00375   gx.push( new gobjMySphereDraw(e2,gd) );
00376 
00377   gx.push( new gobjglBegin(GL_LINES) );
00378 
00379   gx.push( new gobjglVertex3f(tr.pi[1]) );
00380   gx.push( new gobjglVertex3f(e0) );
00381   gx.push( new gobjglVertex3f(tr.pi[2]) );
00382   gx.push( new gobjglVertex3f(e0) );
00383 
00384   gx.push( new gobjglVertex3f(tr.pi[0]) );
00385   gx.push( new gobjglVertex3f(e1) );
00386   gx.push( new gobjglVertex3f(tr.pi[2]) );
00387   gx.push( new gobjglVertex3f(e1) );
00388 
00389   gx.push( new gobjglVertex3f(tr.pi[0]) );
00390   gx.push( new gobjglVertex3f(e2) );
00391   gx.push( new gobjglVertex3f(tr.pi[1]) );
00392   gx.push( new gobjglVertex3f(e2) );
00393 
00394   gx.push( new gobjglEnd() );
00395 
00396   gx.push( new gobjglColor3ub(0,192,225) );
00397   typename TR::PTtype np;
00398   tr.napoleanpoint(np);
00399   gx.push( new gobjMySphereDraw(np,gd) );
00400 
00401 
00402   typename TR::PTtype c2;
00403   TR(tr.pi[1],tr.pi[0],e2).centroid(c2);
00404   typename TR::PTtype c1;
00405   TR(tr.pi[0],tr.pi[2],e1).centroid(c1);
00406   typename TR::PTtype c0;
00407   TR(tr.pi[2],tr.pi[1],e0).centroid(c0);
00408 
00409   gx.push( new gobjMySphereDraw(c0,gd) );
00410   gx.push( new gobjMySphereDraw(c1,gd) );
00411   gx.push( new gobjMySphereDraw(c2,gd) );
00412 
00413   gx.push( new gobjglBegin(GL_LINES) );
00414 
00415   gx.push( new gobjglVertex3f(tr.pi[0]) );
00416   gx.push( new gobjglVertex3f(c0) );
00417   gx.push( new gobjglVertex3f(tr.pi[1]) );
00418   gx.push( new gobjglVertex3f(c1) );
00419   gx.push( new gobjglVertex3f(tr.pi[2]) );
00420   gx.push( new gobjglVertex3f(c2) );
00421 
00422   gx.push( new gobjglEnd() );
00423 }


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