proj home

Files   Classes   Functions   Hierarchy  

primitivewindow.h

Go to the documentation of this file.
00001 #ifndef PRIMITIVEWINDOW_H
00002 #define PRIMITIVEWINDOW_H
00003 
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 using namespace std;
00008 
00009 
00010 #include <GL/glut.h>
00011 #include <GL/gl.h>
00012 
00013 #include <gobj.h>
00014 #include <graphmisc.h>
00015 #include <point.h>
00016 
00017 
00024 class primitiveWindow : public gobjContainer, public ostream
00025 {
00027   void eval(string const & s);
00028 public:
00029 
00031   point3<double> X0;
00033   point3<double> X;
00035   double columnchange;
00037   void * font;
00038 
00040   primitiveWindow
00041   (
00042     point3<double> const & X0_,
00043     doublec columnchange_,
00044     void * font_ = GLUT_BITMAP_HELVETICA_10
00045   ); 
00046 
00049   void reset()
00050     { nuke(); X=X0; }
00051 
00053   void setfont10()
00054     { font=GLUT_BITMAP_HELVETICA_10; }
00056   void setfont12()
00057     { font=GLUT_BITMAP_HELVETICA_12; }
00058 
00060   void addparagraph(string const & s, uintc len);
00061 
00063   template< typename T >
00064   void eval(T & x)
00065   {
00066     stringstream ss;
00067     ss << x;
00068 
00069     eval(ss.str());
00070 //    return *this;  //--problem with bad cast.
00071   }
00072 
00075   static void interpretString
00076   (
00077     vector<string> & v, 
00078     string const & s
00079   );
00080 
00082   void addline(string const & s)
00083   {
00084     push( new gobjMyBitmapCharacter(s,X,font) );
00085     X.y -= columnchange;
00086   }
00087 
00088 };
00089 
00095 template< typename T >
00096 void operator << ( primitiveWindow & pw, T & x)
00097 {
00098   pw.eval(x);
00099 }
00100 
00101 
00102 #endif
00103 
00104 

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