Changeset 492 for trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
- Timestamp:
- 01/03/06 23:33:45 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r487 r492 13 13 #include "ViewCell.h" 14 14 #include "SceneGraph.h" 15 #include "PreprocessorThread.h" 16 17 #include <QApplication> 18 #include <QtOpenGL> 19 #include "GlRenderer.h" 15 20 16 21 #define USE_EXE_PATH false 17 22 18 23 24 25 26 19 27 int 20 main(int argc, c onst char **argv)28 main(int argc, char **argv) 21 29 { 22 30 Debug.open("debug.log"); … … 24 32 environment->Parse(argc, argv, USE_EXE_PATH); 25 33 MeshKdTree::ParseEnvironment(); 26 34 27 35 char buff[128]; 28 36 environment->GetStringValue("Preprocessor.type", buff); … … 48 56 } 49 57 58 preprocessor = p; 50 59 51 environment->GetStringValue("Scene.filename", buff); 52 string filename(buff); 53 54 p->LoadScene(filename); 55 56 p->BuildKdTree(); 57 p->KdTreeStatistics(cout); 58 59 // parse view cells related options 60 p->PrepareViewCells(); 60 environment->GetStringValue("Scene.filename", buff); 61 string filename(buff); 62 p->LoadScene(filename); 63 64 p->BuildKdTree(); 65 p->KdTreeStatistics(cout); 66 67 // parse view cells related options 68 p->PrepareViewCells(); 69 70 71 // create a preprocessor thread 72 PreprocessorThread *pt = new PreprocessorThread(p); 61 73 62 74 // p->mSceneGraph->Export("soda.x3d"); … … 65 77 p->Export(filename + "-kdtree.x3d", false, true, false); 66 78 } 79 80 if (p->mUseGlRenderer) { 81 QApplication a(argc, argv); 82 83 if (!QGLFormat::hasOpenGL() || !QGLPbuffer::hasPbuffers()) { 84 QMessageBox::information(0, "OpenGL pbuffers", 85 "This system does not support OpenGL/pbuffers.", 86 QMessageBox::Ok); 87 return -1; 88 } 89 90 renderer = new GlRenderer(p->mSceneGraph, p->mViewCellsManager); 91 // renderer->resize(640, 480); 92 renderer->resize(1024, 768); 93 renderer->show(); 94 95 96 pt->start(QThread::LowPriority); 97 98 return a.exec(); 99 } else { 100 // just call the mail method -> will be executed in the main thread 101 pt->Main(); 102 } 67 103 68 69 if (1) {70 p->ComputeVisibility();71 p->ExportPreprocessedData("scene.vis");72 }73 74 Camera camera;75 if (0) {76 //camera.LookAtBox(p->mKdTree->GetBox());77 camera.LookInBox(p->mKdTree->GetBox());78 camera.SetPosition(camera.mPosition + Vector3(0,300,0));79 camera.SnapImage("camera.jpg", p->mKdTree);80 }81 if (0) {82 camera.LookInBox(p->mKdTree->GetBox());83 camera.SetPosition(camera.mPosition - Vector3(0,100,0));84 camera.SnapImage("camera2.jpg", p->mKdTree);85 }86 87 if (0) {88 camera.SetPosition( p->mKdTree->GetBox().Center() - Vector3(0,-100,0) );89 camera.SetDirection(Vector3(1, 0, 0));90 camera.SnapImage("camera3.jpg", p->mKdTree);91 }92 93 104 // clean up 94 DEL_PTR(p);95 DEL_PTR(environment);105 // DEL_PTR(p); 106 // DEL_PTR(environment); 96 107 97 108 return 0;
Note: See TracChangeset
for help on using the changeset viewer.