Files Classes Functions Hierarchy
#include <graphmisctest.h>
Public Member Functions | |
| graphmisctest () | |
| Constructor. | |
| void | test002 (int argc, char **argv) |
| Display a grid. | |
Static Public Member Functions | |
| static void | test001 () |
Definition at line 7 of file graphmisctest.h.
| graphmisctest::graphmisctest | ( | ) | [inline] |
| void graphmisctest::test001 | ( | ) | [static] |
Definition at line 41 of file graphmisctest.cpp.
References SHOW.
Referenced by main().
00042 { 00043 double imax = 9; 00044 double dx = 1/(imax-1); 00045 00046 colorfunction f; 00047 00048 point3<double> w; 00049 double z; 00050 00051 for ( unsigned int i=0; i<imax; ++i) 00052 { 00053 cout << i*dx << endl; 00054 z = i*dx; 00055 f(w,z); 00056 cout << w << endl; 00057 } 00058 00059 cout << endl << endl << "Verifying Color function" << endl; 00060 double vz[9] = { 0.0, 0.125, 0.25, 0.375, 0.5, 0.625,0.75,0.875,1.0 }; 00061 vector<double> v(vz,vz+9); 00062 for (unsigned int i=0; i<v.size(); ++i) 00063 { 00064 f(w,v[i]); 00065 cout << SHOW(v[i]) << " " << w << endl; 00066 } 00067 }
| void graphmisctest::test002 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Display a grid.
Definition at line 69 of file graphmisctest.cpp.
References gobjpush, gobjContainer::set(), and zpr::update().
00070 { 00071 glutInit(&argc,argv); 00072 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00073 glutInitWindowSize(800,600); 00074 glutCreateWindow(""); 00075 glutDisplayFunc(display01); 00076 glutKeyboardFunc(keyboard01); 00077 00078 OpenGLinitialisation(); 00079 00080 glEnable(GL_DEPTH_TEST); 00081 glEnable(GL_CULL_FACE); 00082 glEnable(GL_NORMALIZE); 00083 00084 xGraphics.set(); 00085 00086 gobjpush(new gobjglColor3ub(34,139,34)); 00087 //gridsquare * gs = new gridsquare(1,0x0101,5,5,1.0,1.0); 00088 gridsquare * gs = new gridsquare(1,0xaaaa,5,5,1.0,1.0); 00089 00090 gobjpush(gs); 00091 00092 zpr zz; 00093 zz.update(); 00094 glutMainLoop(); 00095 }
1.5.8