Files Classes Functions Hierarchy
#include <regionD2linkedtest.h>
Public Member Functions | |
| void | test02 (int argc, char **argv) |
| Display a house. | |
| void | test03 (int argc, char **argv) |
| Display the letter H. | |
Static Public Member Functions | |
| static void | keyboard01 (unsigned char key, int x, int y) |
| Default keyboard handler - ESC to quit. | |
| static void | display01 () |
| Displays the gobj::global with double buffering. | |
| static void | test01 () |
| Print a house. | |
Definition at line 6 of file regionD2linkedtest.h.
| void regionD2linkedtest::display01 | ( | ) | [static] |
Displays the gobj::global with double buffering.
Definition at line 59 of file regionD2linkedtest.cpp.
References gobjContainer::draw(), glerrordisplay(), and gobj::global.
Referenced by test02(), and test03().
00060 { 00061 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00062 00063 gobj::global->draw(); 00064 00065 00066 glerrordisplay(); 00067 00068 glutSwapBuffers(); 00069 }
| void regionD2linkedtest::keyboard01 | ( | unsigned char | key, | |
| int | x, | |||
| int | y | |||
| ) | [static] |
Default keyboard handler - ESC to quit.
Definition at line 45 of file regionD2linkedtest.cpp.
Referenced by test02(), and test03().
| void regionD2linkedtest::test01 | ( | ) | [static] |
Print a house.
Definition at line 16 of file regionD2linkedtest.cpp.
References regionD2tess< Vreg, Vpts, Indx >::print(), pts, and regionD2tess< Vreg, Vpts, Indx >::verify().
Referenced by main().
00017 { 00018 typedef point2<double> pt2; 00019 typedef regionD2linked< uint > region; 00020 00021 vector<pt2> pts(1); 00022 00023 pts.push_back( pt2(0.0,0.0) ); 00024 pts.push_back( pt2(1.0,0.0) ); 00025 pts.push_back( pt2(1.0,1.0) ); 00026 pts.push_back( pt2(0.0,1.0) ); 00027 pts.push_back( pt2(0.5,1.3) ); 00028 00029 vector< region > vi(1); 00030 vi.push_back( region(1,2,3,4,0,0,2,0) ); 00031 vi.push_back( region(3,5,4,0,0,1) ); 00032 00033 regionD2tess< vector<region> &, vector<pt2> &, uint > 00034 tess(vi,pts); 00035 00036 tess.print(); 00037 00038 assert(tess.verify()); 00039 00040 00041 }
| void regionD2linkedtest::test02 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Display a house.
Definition at line 73 of file regionD2linkedtest.cpp.
References display01(), regionD2tessdisplaypoints< TS, Indx >::draw(), keyboard01(), pts, gobjContainer::set(), and zpr::update().
00074 { 00075 glutInit(&argc,argv); 00076 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00077 glutInitWindowSize(800,600); 00078 glutCreateWindow(""); 00079 glutDisplayFunc(display01); 00080 glutKeyboardFunc(keyboard01); 00081 00082 OpenGLinitialisation(); 00083 00084 glEnable(GL_DEPTH_TEST); 00085 glEnable(GL_CULL_FACE); 00086 glEnable(GL_NORMALIZE); 00087 00088 xGraphics.set(); 00089 00090 commandline cmd(argc,argv); 00091 00092 typedef point2<double> pt2; 00093 typedef regionD2linked< uint > region; 00094 00095 vector<pt2> pts(1); 00096 00097 pts.push_back( pt2(0.0,0.0) ); 00098 pts.push_back( pt2(1.0,0.0) ); 00099 pts.push_back( pt2(1.0,1.0) ); 00100 pts.push_back( pt2(0.0,1.0) ); 00101 pts.push_back( pt2(0.5,1.3) ); 00102 00103 vector< region > vi(1); 00104 vi.push_back( region(1,2,3,4,0,0,2,0) ); 00105 vi.push_back( region(3,5,4,0,0,1) ); 00106 00107 typedef regionD2tess< vector<region> &, vector<pt2> &, uint > 00108 tessregion; 00109 tessregion tess(vi,pts); 00110 00111 tess.printnumbered(); 00112 assert(tess.verify()); 00113 00114 regionD2tessdisplaymesh<tessregion,uint> tessdisp(xGraphics,tess); 00115 00116 tessdisp.draw(); 00117 00118 regionD2tessdisplaypoints<tessregion,uint> tesspoints(xGraphics,tess); 00119 tesspoints.draw(); 00120 00121 zpr zz; 00122 zz.update(); 00123 glutMainLoop(); 00124 }
| void regionD2linkedtest::test03 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Display the letter H.
Definition at line 128 of file regionD2linkedtest.cpp.
References display01(), regionD2tessdisplaypoints< TS, Indx >::draw(), keyboard01(), pts, and gobjContainer::set().
00129 { 00130 glutInit(&argc,argv); 00131 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00132 glutInitWindowSize(800,600); 00133 glutCreateWindow(""); 00134 glutDisplayFunc(display01); 00135 glutKeyboardFunc(keyboard01); 00136 00137 OpenGLinitialisation(); 00138 00139 glEnable(GL_DEPTH_TEST); 00140 glEnable(GL_CULL_FACE); 00141 glEnable(GL_NORMALIZE); 00142 00143 xGraphics.set(); 00144 00145 commandline cmd(argc,argv); 00146 00147 typedef point2<double> pt2; 00148 00149 vector<pt2> pts(17); 00150 00151 pts[0] = pt2(0.0,0.0); 00152 pts[1] = pt2(1.0,3.0); 00153 pts[2] = pt2(2.0,3.0); 00154 pts[3] = pt2(3.0,2.0); 00155 pts[4] = pt2(3.0,1.0); 00156 pts[5] = pt2(2.0,0.0); 00157 pts[6] = pt2(1.0,0.0); 00158 pts[7] = pt2(0.0,0.0); 00159 pts[8] = pt2(0.0,1.0); 00160 pts[9] = pt2(0.0,2.0); 00161 pts[10] = pt2(0.0,3.0); 00162 pts[11] = pt2(1.0,2.0); 00163 pts[12] = pt2(2.0,2.0); 00164 pts[13] = pt2(2.0,1.0); 00165 pts[14] = pt2(1.0,1.0); 00166 pts[15] = pt2(3.0,3.0); 00167 pts[16] = pt2(3.0,0.0); 00168 00169 00170 typedef regionD2linked< uint > region; 00171 00172 vector< region > vi(1); 00173 vi.push_back( region(1,10,9,11,0,0,2,0) ); 00174 vi.push_back( region(3,12,11,9,8,14,13,4, 00175 5,0,1,0,3,0,4,0) ); 00176 vi.push_back( region(14,8,7,6,2,0,0,0) ); 00177 vi.push_back( region(4,13,5,16,2,0,0,0) ); 00178 vi.push_back( region(3,15,2,12,0,0,0,2) ); 00179 00180 typedef regionD2tess< vector<region> &, vector<pt2> &, uint > 00181 tessregion; 00182 tessregion tess(vi,pts); 00183 00184 tess.printnumbered(); 00185 assert(tess.verify()); 00186 00187 regionD2tessdisplaymesh<tessregion,uint> tessdisp(xGraphics,tess); 00188 00189 tessdisp.draw(); 00190 00191 regionD2tessdisplaypoints<tessregion,uint> tesspoints(xGraphics,tess); 00192 tesspoints.draw(); 00193 00194 zpr zz; 00195 glutMainLoop(); 00196 }
1.5.8