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