added missing code-changes (mainly eval)
This commit is contained in:
@@ -16,35 +16,68 @@ class PaperPlot {
|
||||
|
||||
public:
|
||||
|
||||
struct Size {
|
||||
float w;
|
||||
float h;
|
||||
Size(const float w, const float h) : w(w), h(h) {;}
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
|
||||
std::string file;
|
||||
K::Gnuplot gp;
|
||||
K::GnuplotSplot plot;
|
||||
|
||||
K::GnuplotSplotElementLines floors;
|
||||
K::GnuplotSplotElementColorPoints nodes;
|
||||
K::GnuplotSplotElementLines edges;
|
||||
K::GnuplotSplotElementLines edgesSame;
|
||||
K::GnuplotSplotElementLines edgesStair;
|
||||
|
||||
public:
|
||||
|
||||
PaperPlot(const std::string& file, Size s) : file(file) {
|
||||
toFile(file, s);
|
||||
setup();
|
||||
}
|
||||
|
||||
PaperPlot() {
|
||||
setup();
|
||||
}
|
||||
|
||||
void toFile(const std::string& file, const Size s) {
|
||||
gp << "set output '" << file << "'\n";
|
||||
gp << "set terminal eps size " << s.w << "," << s.h << "\n";
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
||||
floors.setLineWidth(2);
|
||||
|
||||
plot.add(&edges);
|
||||
plot.add(&edgesSame);
|
||||
plot.add(&edgesStair);
|
||||
|
||||
plot.add(&nodes);
|
||||
plot.add(&floors);
|
||||
|
||||
nodes.setPointSize(0.7);
|
||||
edges.setColorHex("#555555");
|
||||
nodes.setPointSize(0.2);
|
||||
|
||||
edgesSame.setColorHex("#555555");
|
||||
edgesStair.setColorHex("#AAAA55");
|
||||
|
||||
|
||||
gp << "set ticslevel 0\n";
|
||||
|
||||
|
||||
//gp << "set zrange [0:0]\n";
|
||||
|
||||
}
|
||||
|
||||
void show() {
|
||||
gp.draw(plot);
|
||||
if (file.length() != 0) {
|
||||
std::string dataFile = file + ".dat";
|
||||
std::ofstream os(dataFile.c_str());
|
||||
os << gp.getBuffer();
|
||||
os.close();
|
||||
}
|
||||
gp.flush();;
|
||||
}
|
||||
|
||||
@@ -95,7 +128,7 @@ public:
|
||||
}
|
||||
|
||||
/** show all nodes (and edges?) within the given region */
|
||||
template <typename T> void debugGrid(Grid<T>& grid, const BBox3& bbox, const bool addNodes, const bool addEdges) {
|
||||
template <typename T> void debugGrid(Grid<T>& grid, const BBox3& bbox, const bool addNodes, const bool addEdges, const bool addAllEdges = false) {
|
||||
|
||||
std::set<uint64_t> used;
|
||||
|
||||
@@ -107,10 +140,11 @@ public:
|
||||
}
|
||||
if (addEdges) {
|
||||
for (const T& n2 : grid.neighbors(n1)) {
|
||||
if (n1.z_cm == n2.z_cm) {continue;} // speedup
|
||||
if (n1.z_cm == n2.z_cm && !addAllEdges) {continue;} // speedup
|
||||
if (used.find(n2.getIdx()) == used.end()) {
|
||||
const K::GnuplotPoint3 p2(n2.x_cm, n2.y_cm, n2.z_cm);
|
||||
edges.addSegment(p1, p2);
|
||||
if (p1.z != p2.z) {edgesStair.addSegment(p1, p2);}
|
||||
else {edgesSame.addSegment(p1, p2);}
|
||||
}
|
||||
}
|
||||
used.insert(n1.getIdx());
|
||||
|
||||
Reference in New Issue
Block a user