removed gridSize from the template arguments
- not needed and code much cleaner some minor changes new test-cases
This commit is contained in:
44
tests/grid/TestImportance.cpp
Normal file
44
tests/grid/TestImportance.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../Tests.h"
|
||||
|
||||
#include "../../grid/factory/GridImportance.h"
|
||||
#include "../../grid/factory/GridFactory.h"
|
||||
#include "../../floorplan/FloorplanFactorySVG.h"
|
||||
#include "../../nav/dijkstra/Dijkstra.h"
|
||||
#include "../../grid/walk/GridWalkWeighted.h"
|
||||
|
||||
#include "Plot.h"
|
||||
|
||||
TEST(Importance, Doors) {
|
||||
|
||||
|
||||
Grid<GP> g(20);
|
||||
GridFactory<GP> gf(g);
|
||||
|
||||
// load floorplan
|
||||
FloorplanFactorySVG fpf(getDataFile("fp1.svg"), 6);
|
||||
Floor f1 = fpf.getFloor("1");
|
||||
Floor f2 = fpf.getFloor("2");
|
||||
Stairs s1_2 = fpf.getStairs("1_2");
|
||||
|
||||
// build the grid
|
||||
gf.addFloor(f1, 20);
|
||||
//gf.addFloor(f2, 340);
|
||||
gf.addStairs(s1_2, 20, 340);
|
||||
gf.removeIsolated();
|
||||
|
||||
// calculate node importance based on the floorplan (walls, ...)
|
||||
GridImportance gi;
|
||||
gi.addImportance(g, 20);
|
||||
|
||||
|
||||
Plot p;
|
||||
p.gp << "set view 0,0\n";
|
||||
p.build(g);
|
||||
p.addFloor(f1, 20);
|
||||
p.fire();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user