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

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

added some bsp stuff

RevLine 
[162]1#include "SamplingPreprocessor.h"
2#include "ExactPreprocessor.h"
3#include "Parser.h"
4#include "UnigraphicsParser.h"
[170]5#include "X3dParser.h"
[162]6#include "Environment.h"
7#include "Camera.h"
[170]8#include "MeshKdTree.h"
[162]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);
[170]19  MeshKdTree::ParseEnvironment();
[235]20  BspTree::ParseEnvironment();
21
[162]22  Preprocessor *p =
23    new SamplingPreprocessor();
24
[170]25  char buff[128];
26  environment->GetStringValue("Scene.filename", buff);
27  string filename(buff);
28
29  p->LoadScene(filename);
[235]30
[162]31  p->BuildKdTree();
32  p->KdTreeStatistics(cout);
[235]33#ifdef TEST_BSP_VIEWCELLS
[234]34  p->GenerateViewcells();
[235]35  p->BspTreeStatistics(Debug);
[234]36#endif
37
[162]38  //  p->mSceneGraph->Export("soda.x3d");
[176]39  if (0) {
[170]40    p->Export(filename + "-out.x3d", true, false);
41    p->Export(filename + "-kdtree.x3d", false, true);
42  }
43 
[162]44  //  p->LoadViewcells("viewcells.wrl");
[176]45  if (1) {
46    p->ComputeVisibility();
47    p->ExportPreprocessedData("scene.vis");
48  }
[235]49
[176]50  if (0) {
[170]51    Camera camera;
52    camera.LookAtBox(p->mKdTree->GetBox());
[191]53    camera.SnapImage("camera.jpg", p->mKdTree);
54
[170]55   
56    camera.LookInBox(p->mKdTree->GetBox());
57    camera.SetPosition(camera.mPosition - Vector3(0,100,0));
58    camera.SnapImage("camera2.png", p->mKdTree);
59  }
[162]60
61 
62  return 0;
63}
64
Note: See TracBrowser for help on using the repository browser.