Files Classes Functions Hierarchy
#include <d2simplextest.h>
Public Member Functions | |
| d2simplextest (int &argc, char **argv) | |
| ~d2simplextest () | |
| void | test01 () |
| void | intersection () |
| The intersection is tested and updated. | |
| void | keyboard (unsigned char key, int x, int y) |
| Derived classes define keyboard. | |
| void | display () |
| Derived classes define display. | |
Public Attributes | |
| zpr | zz |
| d2simplexSeparateAxis | A |
| d2simplexSeparateAxis | B |
| d2simplexintersection | si |
| d2simplextestmenu01 * | menu |
| gobjContainer | xGraphics |
Definition at line 16 of file d2simplextest.h.
| d2simplextest::d2simplextest | ( | int & | argc, | |
| char ** | argv | |||
| ) |
Definition at line 23 of file d2simplextest.cpp.
References myglutgui::globalSet(), menu, gobjContainer::push(), gobjContainer::set(), si, and xGraphics.
00024 : myglutgui(argc,argv), si(A,B) 00025 { 00026 OpenGLinitialisation(); 00027 00028 glEnable(GL_DEPTH_TEST); 00029 glEnable(GL_CULL_FACE); 00030 00031 globalSet(); 00032 menu = new d2simplextestmenu01(this); 00033 00034 xGraphics.set(); 00035 xGraphics.push( menu ); 00036 xGraphics.push( & si ); 00037 }
| d2simplextest::~d2simplextest | ( | ) |
| void d2simplextest::display | ( | ) | [virtual] |
Derived classes define display.
Implements myglutgui.
Definition at line 104 of file d2simplextest.cpp.
References gobjContainer::draw(), glerrordisplay(), and xGraphics.
00105 { 00106 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00107 00108 //menu.draw(); 00109 //si.draw(); 00110 00111 xGraphics.draw(); 00112 00113 glerrordisplay(); 00114 glutSwapBuffers(); 00115 }
| void d2simplextest::intersection | ( | ) |
The intersection is tested and updated.
Definition at line 117 of file d2simplextest.cpp.
References A, B, d2simplexintersection::intersection, d2simplexSeparateAxis::intersects(), and si.
Referenced by d2simplextestmenu01::readImmediate().
00118 { 00119 si.intersection = A.intersects(B); 00120 //cout << SHOW(si.intersection) << endl; 00121 }
| void d2simplextest::keyboard | ( | unsigned char | key, | |
| int | x, | |||
| int | y | |||
| ) | [virtual] |
Derived classes define keyboard.
Reimplemented from myglutgui.
Definition at line 18 of file d2simplextest.cpp.
References menu, and menusystem::read().
| void d2simplextest::test01 | ( | ) |
Definition at line 39 of file d2simplextest.cpp.
References A, B, d2simplex::translate(), zpr::update(), d2simplex::v, and zz.
00040 { 00041 glMatrixMode(GL_MODELVIEW); 00042 glLoadIdentity(); 00043 gluLookAt 00044 ( 00045 2.0,0.0,3.0, 00046 2.0,0.0,0.0, 00047 0.0,1.0,0.0 00048 ); 00049 00050 zz.update(); 00051 00052 00053 /* 00054 glMatrixMode(GL_PROJECTION); 00055 glLoadIdentity(); 00056 00057 //glFrustum(2.0,10.5,-1.0,6.0,1.5,20.1); 00058 00059 double z0=0.4; 00060 double z1=10.1; 00061 cout << SHOW(z1/z0) << endl; 00062 glFrustum(500.5,15.5,-2.5,6.0,z0,z1); 00063 00064 glMatrixMode(GL_MODELVIEW); 00065 00066 */ 00067 00068 00069 //zpr::readProjection(); 00070 //zpr::printInfo(); 00071 00072 00073 //zpr::setViewVolume(-0.5,3.5,-0.5,1.0,0.1,4.1); 00074 //zpr::setViewVolume(2.0,3.5,-1.0,8.0,0.9,4.0); 00075 00076 //cout << SHOW(zpr::zNear) << endl; 00077 //cout << SHOW(zpr::zFar) << endl; 00078 00079 A.v[0] = pt2(0.0,0.0); 00080 A.v[1] = pt2(1.0,0.0); 00081 A.v[2] = pt2(0.5,0.5); 00082 00083 B.v[0] = pt2(.2,.23); 00084 B.v[1] = pt2(.4,.23); 00085 B.v[2] = pt2(.4,.5); 00086 00087 B.translate( pt2(2.0,0.0) ); 00088 00089 00090 //zpr::printInfo(); 00091 00092 glutPostRedisplay(); 00093 00094 glutMainLoop(); 00095 }
Definition at line 22 of file d2simplextest.h.
Referenced by intersection(), d2simplextestmenu01::readImmediate(), and test01().
Definition at line 23 of file d2simplextest.h.
Referenced by intersection(), d2simplextestmenu01::readImmediate(), and test01().
Definition at line 26 of file d2simplextest.h.
Referenced by d2simplextest(), keyboard(), and ~d2simplextest().
1.5.8