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

Revision 234, 1.4 KB checked in by mattausch, 19 years ago (diff)

added bsp tree stuff

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#ifdef DEST_BSP_VIEWCELLS
33  p->GenerateViewcells();
34  p->BspTreeStatistics(cout);
35#endif
36
37  //  p->mSceneGraph->Export("soda.x3d");
38  if (0) {
39    p->Export(filename + "-out.x3d", true, false);
40    p->Export(filename + "-kdtree.x3d", false, true);
41  }
42 
43  //  p->LoadViewcells("viewcells.wrl");
44  if (1) {
45    p->ComputeVisibility();
46    p->ExportPreprocessedData("scene.vis");
47  }
48 
49  if (0) {
50    Camera camera;
51    camera.LookAtBox(p->mKdTree->GetBox());
52    camera.SnapImage("camera.jpg", p->mKdTree);
53
54   
55    camera.LookInBox(p->mKdTree->GetBox());
56    camera.SetPosition(camera.mPosition - Vector3(0,100,0));
57    camera.SnapImage("camera2.png", p->mKdTree);
58  }
59
60 
61  return 0;
62}
63
Note: See TracBrowser for help on using the repository browser.