proj home

Files   Classes   Functions   Hierarchy  

gltextmsg Class Reference

#include <graphmisc.h>

Collaboration diagram for gltextmsg:

List of all members.

Public Member Functions

 gltextmsg (string const &msg_, floatc x, floatc y, floatc c0, floatc c1, floatc c2)
template<typename T >
void updatevalue (T const &v, string const &post=string(""))
template<typename T >
void updatevalue (string const &pre, T const &v, string const &post=string(""))
void display () const

Public Attributes

string msg
float pos [2]
float col [3]


Detailed Description

Definition at line 357 of file graphmisc.h.


Constructor & Destructor Documentation

gltextmsg::gltextmsg ( string const &  msg_,
floatc  x,
floatc  y,
floatc  c0,
floatc  c1,
floatc  c2 
) [inline]

Definition at line 367 of file graphmisc.h.

References col, and pos.

00375     : msg(msg_)
00376   {
00377     pos[0] = x;
00378     pos[1] = y;
00379     col[0] = c0;
00380     col[1] = c1;
00381     col[2] = c2;
00382   }


Member Function Documentation

void gltextmsg::display (  )  const [inline]

Definition at line 413 of file graphmisc.h.

References col, msg, and pos.

Referenced by integration< D, F >::draw().

00414   {
00415     myglPushMatrix temp;
00416 
00417     myLightingTurnOff temp2;
00418 
00419     glLoadIdentity();
00420     gluOrtho2D(-1.0, 1.0, -1.0, 1.0);
00421 
00422     glColor3f(col[0],col[1],col[2]);
00423 
00424     glRasterPos2f(pos[0],pos[1]);
00425 
00426     int len = msg.length();
00427     for (int i = 0; i < len; ++i)
00428       glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, msg[i]);
00429   } 

template<typename T >
void gltextmsg::updatevalue ( string const &  pre,
T const &  v,
string const &  post = string("") 
) [inline]

Definition at line 399 of file graphmisc.h.

References msg.

00404   {  
00405     stringstream ss;
00406     ss << v;
00407     msg = pre;
00408     msg += ss.str();
00409     msg += post;
00410   }

template<typename T >
void gltextmsg::updatevalue ( T const &  v,
string const &  post = string("") 
) [inline]

Definition at line 386 of file graphmisc.h.

References msg.

Referenced by animate().

00390   {  
00391     stringstream ss;
00392     ss << v;
00393     msg = ss.str();
00394     msg += post;
00395   }


Member Data Documentation

float gltextmsg::col[3]

Definition at line 364 of file graphmisc.h.

Referenced by display(), and gltextmsg().

Definition at line 362 of file graphmisc.h.

Referenced by display(), and updatevalue().

float gltextmsg::pos[2]

Definition at line 363 of file graphmisc.h.

Referenced by display(), and gltextmsg().


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

Generated on Fri Mar 4 00:49:57 2011 for Chelton Evans Source by  doxygen 1.5.8