source: trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp @ 170

Revision 170, 1.3 KB checked in by bittner, 19 years ago (diff)

mesh kd tree added

Line 
1#include "SamplingPreprocessor.h"
2#include "ExactPreprocessor.h"
3#include "Parser.h"
4#include "UnigraphicsParser.h"
5#include "X3dParser.h"
6#include "Environment.h"
7#include "Camera.h"
8#include "MeshKdTree.h"
9
10#define USE_EXE_PATH false
11
12
13int
14main(int argc, const char **argv)
15{
16  Debug.open("debug.log");
17  environment = new Environment;
18  environment->Parse(argc, argv, USE_EXE_PATH);
19  MeshKdTree::ParseEnvironment();
20 
21  Preprocessor *p =
22    new SamplingPreprocessor();
23
24  char buff[128];
25  environment->GetStringValue("Scene.filename", buff);
26  string filename(buff);
27
28  p->LoadScene(filename);
29  p->BuildKdTree();
30  p->KdTreeStatistics(cout);
31
32  //  p->mSceneGraph->Export("soda.x3d");
33  if (1) {
34    p->Export(filename + "-out.x3d", true, false);
35    p->Export(filename + "-kdtree.x3d", false, true);
36  }
37 
38  //  p->LoadViewcells("viewcells.wrl");
39  p->ComputeVisibility();
40  p->ExportPreprocessedData("scene.vis");
41 
42  if (1) {
43    Camera camera;
44    camera.LookAtBox(p->mKdTree->GetBox());
45    camera.SnapImage("camera.png", p->mKdTree);
46   
47    camera.LookInBox(p->mKdTree->GetBox());
48    camera.SetPosition(camera.mPosition - Vector3(0,100,0));
49    camera.SnapImage("camera2.png", p->mKdTree);
50  }
51
52 
53  return 0;
54}
55
Note: See TracBrowser for help on using the repository browser.