Files
IPIN2016/code/eval/PaperVisGrid.h
2016-03-01 15:04:46 +01:00

112 lines
2.4 KiB
C++

#ifndef PAPERVISGRID_H
#define PAPERVISGRID_H
#include <Indoor/grid/Grid.h>
#include <Indoor/grid/factory/GridFactory.h>
#include <Indoor/grid/factory/GridImportance.h>
#include <Indoor/floorplan/FloorplanFactorySVG.h>
#include <Indoor/grid/walk/GridWalkLightAtTheEndOfTheTunnel.h>
#include <Indoor/nav/dijkstra/Dijkstra.h>
#include <Indoor/nav/dijkstra/DijkstraPath.h>
#include "PaperPlot.h"
#include "PaperPlot2D.h"
#include "../MyGridNode.h"
#include "../Settings.h"
#include "../Helper.h"
class PaperVisGrid {
public:
static void showStairs() {
// the grid
Grid<MyGridNode> grid(20);
// floors
Helper::FHWSFloors floors = Helper::getFloors();
Helper::buildTheGrid(grid, floors);
// // load the floorplan
// FloorplanFactorySVG fpFac(MiscSettings::floorplan, 2.822222);
// Floor f0 = fpFac.getFloor("floor_0");
// Floor f0 = fpFac.getFloor("floor_1");
// const LengthF h0 = LengthF::cm(0);
// const LengthF h1 = LengthF::cm(400);
// const LengthF h2 = LengthF::cm(400+340);
// const LengthF h3 = LengthF::cm(400+340+340);
// add the floorplan to the grid
// GridFactory<MyGridNode> gridFac(grid);
// gridFac.addFloor(f0, h0.cm());
// gridFac.addFloor(f1, h1.cm());
// gridFac.addFloor(f2, h2.cm());
// gridFac.addFloor(f3, h3.cm());
// remove all isolated nodes not attached to 300,300,floor0
// gridFac.removeIsolated( (MyGridNode&)grid.getNodeFor( GridPoint(300,300,h0.cm()) ) );
PaperPlot plot;
// stairwell low left
{BBox3 bbox;
bbox.add(Point3(1300, 650,000));
bbox.add(Point3(2000,1300,1400));
plot.debugGrid(grid, bbox, true, true);}
// stairwell upper left
{BBox3 bbox;
bbox.add(Point3(1200,4758,000));
bbox.add(Point3(1800,5158,1400));
plot.debugGrid(grid, bbox, true, true);}
// stairwell upper right
{BBox3 bbox;
bbox.add(Point3(6240,4718,000));
bbox.add(Point3(6830,5158,1400));
plot.debugGrid(grid, bbox, true, true);}
// stair left
{BBox3 bbox;
bbox.add(Point3(1200,3200,000));
bbox.add(Point3(1440,4078,1400));
plot.debugGrid(grid, bbox, true, true);}
// stair center
{BBox3 bbox;
bbox.add(Point3(4200,4118,100));
bbox.add(Point3(6120,4438,1400));
plot.debugGrid(grid, bbox, true, true);}
//stair lower right
{BBox3 bbox;
bbox.add(Point3(7360,3358,000));
bbox.add(Point3(7880,4300,500));
plot.debugGrid(grid, bbox, true, true);}
plot.show();
sleep(1000);
}
};
#endif // PAPERVISGRID_H