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 |
|
---|
13 | int
|
---|
14 | main(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 (0) {
|
---|
34 | p->Export(filename + "-out.x3d", true, false);
|
---|
35 | p->Export(filename + "-kdtree.x3d", false, true);
|
---|
36 | }
|
---|
37 |
|
---|
38 | // p->LoadViewcells("viewcells.wrl");
|
---|
39 | if (1) {
|
---|
40 | p->ComputeVisibility();
|
---|
41 | p->ExportPreprocessedData("scene.vis");
|
---|
42 | }
|
---|
43 |
|
---|
44 | if (0) {
|
---|
45 | Camera camera;
|
---|
46 | camera.LookAtBox(p->mKdTree->GetBox());
|
---|
47 | camera.SnapImage("camera.jpg", p->mKdTree);
|
---|
48 |
|
---|
49 |
|
---|
50 | camera.LookInBox(p->mKdTree->GetBox());
|
---|
51 | camera.SetPosition(camera.mPosition - Vector3(0,100,0));
|
---|
52 | camera.SnapImage("camera2.png", p->mKdTree);
|
---|
53 | }
|
---|
54 |
|
---|
55 |
|
---|
56 | return 0;
|
---|
57 | }
|
---|
58 |
|
---|