source: GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp @ 871

Revision 871, 1.6 KB checked in by bittner, 18 years ago (diff)

RenderSampler?

  • Property svn:executable set to *
Line 
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
10namespace GtpVisibilityPreprocessor {
11
12
13PreprocessorThread::PreprocessorThread(Preprocessor *p,
14                                                                           QObject *parent):QThread(parent)
15{
16  mPreprocessor = p;
17  if (p->mQuitOnFinish)
18        connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void)));
19}
20
21void
22PreprocessorThread::Main()
23{
24 
25  if (mPreprocessor->mComputeVisibility) {
26    mPreprocessor->ComputeVisibility();
27        //      mPreprocessor->ExportPreprocessedData("scene.vis");
28        mPreprocessor->PostProcessVisibility();
29  }
30 
31  Camera camera;
32
33  if (0) {
34    // camera.LookAtBox(mPreprocessor->mKdTree->GetBox());
35        //      camera.LookInBox(mPreprocessor->mKdTree->GetBox());
36        camera.SetPosition(Vector3(3473, 6.778, -1699));
37        camera.SetDirection(Vector3(-0.2432, 0, 0.97));
38    camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph);
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
53  cerr << "Preprocessor main finished...\n";
54 
55}
56
57PreprocessorThread::~PreprocessorThread()
58{
59  cerr<<"Preprocessor thread destructor...\n";
60}
61
62}
Note: See TracBrowser for help on using the repository browser.