many changes :P
This commit is contained in:
@@ -4,42 +4,35 @@
|
||||
#include "../../grid/factory/GridFactory.h"
|
||||
#include "../../floorplan/FloorplanFactorySVG.h"
|
||||
|
||||
#include <KLib/misc/gnuplot/Gnuplot.h>
|
||||
#include <KLib/misc/gnuplot/GnuplotSplot.h>
|
||||
#include <KLib/misc/gnuplot/GnuplotSplotElementPoints.h>
|
||||
|
||||
class GP : public GridNode, public GridPoint {
|
||||
public:
|
||||
GP() : GridNode(), GridPoint() {;}
|
||||
GP(int x, int y, int z) : GridNode(), GridPoint(x,y,z) {;}
|
||||
|
||||
};
|
||||
#include "Plot.h"
|
||||
|
||||
TEST(GridFactory, create) {
|
||||
|
||||
Grid<20, GP> g;
|
||||
Grid<20, GP> gInv;
|
||||
|
||||
GridFactory<20, GP> gf(g);
|
||||
FloorplanFactorySVG fpf(getDataFile("test.svg"), 2);
|
||||
FloorplanFactorySVG fpf(getDataFile("fp1.svg"), 4);
|
||||
Floor f1 = fpf.getFloor("1");
|
||||
Floor f2 = fpf.getFloor("2");
|
||||
Stairs s1_2 = fpf.getStairs("1_2");
|
||||
|
||||
gf.addFloor(f1, 0);
|
||||
gf.addFloor(f1, 20);
|
||||
gf.addFloor(f2, 340);
|
||||
gf.addStairs(s1_2, 20, 340);
|
||||
gf.removeIsolated();
|
||||
|
||||
K::Gnuplot gp;
|
||||
K::GnuplotSplot splot;
|
||||
K::GnuplotSplotElementPoints points;
|
||||
GridFactory<20, GP> gfInv(gInv);
|
||||
gfInv.addInverted(g, 20);
|
||||
gfInv.addInverted(g, 340);
|
||||
|
||||
for (int i = 0; i < g.getNumNodes(); ++i) {
|
||||
const GP& node = g[i];
|
||||
points.add(K::GnuplotPoint3(node.x_cm, node.y_cm, node.z_cm));
|
||||
}
|
||||
|
||||
splot.add(&points);
|
||||
gp.draw(splot);
|
||||
gp.flush();
|
||||
|
||||
sleep(10);
|
||||
// plot(gInv);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user