#ifndef PAPERPLOT_H #define PAPERPLOT_H #include #include #include #include #include #include #include class PaperPlot { public: K::Gnuplot gp; K::GnuplotSplot plot; K::GnuplotSplotElementLines floors; K::GnuplotSplotElementColorPoints nodes; public: PaperPlot() { floors.setLineWidth(2); plot.add(&nodes); plot.add(&floors); gp << "set ticslevel 0\n"; //gp << "set zrange [0:0]\n"; } void show() { gp.draw(plot); gp.flush();; } /** add all obstacles of the given floor to the provided height */ void addFloor(const Floor& f, const LengthF height) { // add each wall for (const Line2& l : f.getObstacles()) { const K::GnuplotPoint3 p1(l.p1.x, l.p1.y, height.cm()); const K::GnuplotPoint3 p2(l.p2.x, l.p2.y, height.cm()); floors.addSegment(p1, p2); } } /** add the grid to the plot */ template void addGrid(Grid& grid) { // std::set used; // get the min/max value float max = -999999; float min = +999999; for (const T& n1 : grid) { const float val = n1.imp; //const float val = n1.distToTarget; if (val > max) {max = val;} if (val < min) {min = val;} } gp << "set cbrange["<