[492] | 1 | #include "PreprocessorThread.h"
|
---|
[1457] | 2 | #include "Camera.h"
|
---|
| 3 | #include "KdTree.h"
|
---|
| 4 | #include "SceneGraph.h"
|
---|
| 5 | #include "Preprocessor.h"
|
---|
[492] | 6 |
|
---|
| 7 |
|
---|
[863] | 8 | namespace GtpVisibilityPreprocessor {
|
---|
[492] | 9 |
|
---|
[860] | 10 |
|
---|
[1867] | 11 | vector<PreprocessorThread *> PreprocessorThread::sThreads;
|
---|
| 12 |
|
---|
[1145] | 13 | PreprocessorThread::PreprocessorThread(Preprocessor *p):
|
---|
| 14 | mPreprocessor(p)
|
---|
[492] | 15 | {
|
---|
[1145] | 16 | }
|
---|
[556] | 17 |
|
---|
[878] | 18 |
|
---|
[556] | 19 | PreprocessorThread::~PreprocessorThread()
|
---|
| 20 | {
|
---|
| 21 | }
|
---|
[860] | 22 |
|
---|
[1457] | 23 | void
|
---|
| 24 | PreprocessorThread::Main()
|
---|
| 25 | {
|
---|
| 26 | Camera camera;
|
---|
| 27 |
|
---|
[1583] | 28 | if (0)
|
---|
[1457] | 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));
|
---|
[1154] | 36 |
|
---|
[1457] | 37 | camera.SnapImage("camera.jpg", mPreprocessor->mKdTree, mPreprocessor->mSceneGraph);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
[1583] | 40 | if (0) {
|
---|
[1457] | 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 |
|
---|
[1583] | 46 | if (0) {
|
---|
[1457] | 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 | }
|
---|