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

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

basic sampling strategies

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();
[162]20 
21  Preprocessor *p =
22    new SamplingPreprocessor();
23
[170]24  char buff[128];
25  environment->GetStringValue("Scene.filename", buff);
26  string filename(buff);
27
28  p->LoadScene(filename);
[162]29  p->BuildKdTree();
30  p->KdTreeStatistics(cout);
31
32  //  p->mSceneGraph->Export("soda.x3d");
[176]33  if (0) {
[170]34    p->Export(filename + "-out.x3d", true, false);
35    p->Export(filename + "-kdtree.x3d", false, true);
36  }
37 
[162]38  //  p->LoadViewcells("viewcells.wrl");
[176]39  if (1) {
40    p->ComputeVisibility();
41    p->ExportPreprocessedData("scene.vis");
42  }
[170]43 
[176]44  if (0) {
[170]45    Camera camera;
46    camera.LookAtBox(p->mKdTree->GetBox());
[191]47    camera.SnapImage("camera.jpg", p->mKdTree);
48
[170]49   
50    camera.LookInBox(p->mKdTree->GetBox());
51    camera.SetPosition(camera.mPosition - Vector3(0,100,0));
52    camera.SnapImage("camera2.png", p->mKdTree);
53  }
[162]54
55 
56  return 0;
57}
58
Note: See TracBrowser for help on using the repository browser.