[1387] | 1 | #include <QApplication>
|
---|
| 2 |
|
---|
| 3 | #include "QtPreprocessorThread.h"
|
---|
| 4 | #include "Camera.h"
|
---|
| 5 | #include "KdTree.h"
|
---|
| 6 | #include "SceneGraph.h"
|
---|
| 7 | #include "Preprocessor.h"
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | namespace GtpVisibilityPreprocessor {
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | QtPreprocessorThread::QtPreprocessorThread(Preprocessor *p,
|
---|
| 14 | QObject *parent):PreprocessorThread(p),
|
---|
| 15 | QThread(parent)
|
---|
| 16 |
|
---|
| 17 | {
|
---|
| 18 | if (p->mQuitOnFinish)
|
---|
| 19 | connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void)));
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | void
|
---|
| 23 | QtPreprocessorThread::Main()
|
---|
| 24 | {
|
---|
| 25 |
|
---|
| 26 | Camera camera;
|
---|
| 27 |
|
---|
| 28 | if (0)
|
---|
| 29 | {
|
---|
| 30 | // camera.LookAtBox(mPreprocessor->mKdTree->GetBox());
|
---|
| 31 | // camera.LookInBox(mPreprocessor->mKdTree->GetBox());
|
---|
| 32 | camera.SetPosition(Vector3(3473, 6.778f, -1699.0f));
|
---|
| 33 | camera.SetDirection(Vector3(-0.2432f, 0, 0.97f));
|
---|
| 34 | // camera.SetPosition(Vector3(991.7, 187.8, -271));
|
---|
| 35 | // camera.SetDirection(Vector3(0.9, 0, -0.4));
|
---|
| 36 |
|
---|
| 37 | camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | if (0) {
|
---|
| 41 | camera.LookInBox(mPreprocessor->mKdTree->GetBox());
|
---|
| 42 | camera.SetPosition(camera.mPosition + Vector3(-250,0,-550));
|
---|
| 43 | camera.SnapImage("camera2.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | if (0) {
|
---|
| 47 | camera.SetPosition( mPreprocessor->mKdTree->GetBox().Center() - Vector3(0,-100,0) );
|
---|
| 48 | camera.SetDirection(Vector3(1, 0, 0));
|
---|
| 49 | camera.SnapImage("camera3.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph);
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | if (mPreprocessor->mComputeVisibility) {
|
---|
| 53 | mPreprocessor->ComputeVisibility();
|
---|
| 54 | // mPreprocessor->ExportPreprocessedData("scene.vis");
|
---|
| 55 | mPreprocessor->PostProcessVisibility();
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | cerr << "Preprocessor main finished...\n";
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | QtPreprocessorThread::~QtPreprocessorThread()
|
---|
| 64 | {
|
---|
| 65 | cerr<<"Preprocessor thread destructor...\n";
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | }
|
---|
| 69 |
|
---|