source: GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp @ 1153

Revision 1153, 1.9 KB checked in by mattausch, 18 years ago (diff)

worked on qt dll / boost threads

Line 
1#include "BoostPreprocessorThread.h"
2#include "Camera.h"
3#include "KdTree.h"
4#include "SceneGraph.h"
5#include "Preprocessor.h"
6#include <boost/thread/thread.hpp>
7
8namespace GtpVisibilityPreprocessor {
9
10
11BoostPreprocessorThread::BoostPreprocessorThread(Preprocessor *p):
12PreprocessorThread(p), mThread(NULL)
13{
14}
15
16
17void BoostPreprocessorThread::operator()()
18{
19        Main();
20}
21
22
23void BoostPreprocessorThread::Main()
24{
25        Camera camera;
26
27        cout << "here79\n";
28        if (0)
29        {
30                // camera.LookAtBox(mPreprocessor->mKdTree->GetBox());
31                //      camera.LookInBox(mPreprocessor->mKdTree->GetBox());
32                camera.SetPosition(Vector3(3473, 6.778, -1699));
33                camera.SetDirection(Vector3(-0.2432, 0, 0.97));
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
63BoostPreprocessorThread::~BoostPreprocessorThread()
64{
65        cerr << "Boost Preprocessor thread destructor ... \n";
66        DEL_PTR(mThread);
67}
68
69
70void BoostPreprocessorThread::InitThread()
71{
72        mThread = new boost::thread(*this);
73}
74
75
76void BoostPreprocessorThread::RunThread()
77{
78        mThread->join();
79}
80 
81}
Note: See TracBrowser for help on using the repository browser.