current TeX
minor code changes for GFX
This commit is contained in:
100
plots/Plotty.h
100
plots/Plotty.h
@@ -118,6 +118,7 @@ public:
|
||||
bool stairs = true;
|
||||
bool obstacles = true;
|
||||
bool outline = true;
|
||||
bool outlineColorCustom = false;
|
||||
K::GnuplotColor outlineColor = K::GnuplotColor::fromRGB(128,128,128);
|
||||
float minZ = -9999;
|
||||
float maxZ = +9999;
|
||||
@@ -168,34 +169,89 @@ public:
|
||||
}
|
||||
|
||||
void addBBoxes(const BBoxes3& boxes, const K::GnuplotColor& c) {
|
||||
for (const BBox3& bb : boxes.get()) {
|
||||
addBBoxPoly(bb, c);
|
||||
for (BBox3 bb : boxes.get()) {
|
||||
//&&addBBoxPoly(bb, c);
|
||||
//bb.shrink(0.98);
|
||||
addBBoxPoly2(bb, c);
|
||||
}
|
||||
}
|
||||
|
||||
void addBBoxPoly2(const BBox3& bb, const K::GnuplotColor& color) {
|
||||
|
||||
|
||||
K::GnuplotFill filler = K::GnuplotFill(K::GnuplotFillStyle::SOLID, color);
|
||||
K::GnuplotStroke stroke(K::GnuplotDashtype::NONE, 1, color);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol1 = new K::GnuplotObjectPolygon(filler, stroke);
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol1->close();
|
||||
gpol1->setZIndex(bb.getMin().z - 0.1);
|
||||
splot.getObjects().add(gpol1);
|
||||
|
||||
K::GnuplotColor color2 = K::GnuplotColor::fromRGB(128,128,128);
|
||||
K::GnuplotStroke stroke2(K::GnuplotDashtype::NONE, 1, color2);
|
||||
K::GnuplotFill noFiller = K::GnuplotFill(K::GnuplotFillStyle::EMPTY_BORDER, color2);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol2 = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol2->close();
|
||||
gpol2->setZIndex(bb.getMin().z + 3.1);
|
||||
splot.getObjects().add(gpol2);
|
||||
|
||||
K::GnuplotObjectPolygon* gpol3a = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3a->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3a->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3a->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3a);
|
||||
K::GnuplotObjectPolygon* gpol3b = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3b->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3b->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMin().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3b->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3b);
|
||||
K::GnuplotObjectPolygon* gpol3c = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3c->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3c->add(K::GnuplotCoordinate3(bb.getMin().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3c->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3c);
|
||||
K::GnuplotObjectPolygon* gpol3d = new K::GnuplotObjectPolygon(noFiller, stroke2);
|
||||
gpol3d->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMin().z, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3d->add(K::GnuplotCoordinate3(bb.getMax().x, bb.getMax().y, bb.getMax().z-2, K::GnuplotCoordinateSystem::FIRST));
|
||||
gpol3d->setZIndex(bb.getMin().z + 1.1);
|
||||
splot.getObjects().add(gpol3d);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void addBBox(const BBox3& bb) {
|
||||
|
||||
// floor
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMin().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// ceil
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
// // floor
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMin().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMin().z});
|
||||
// mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// up
|
||||
mapBBoxes.addSegment({bb.getMin().x, bb.getMin().y, bb.getMin().z}, {bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMax().x, bb.getMin().y, bb.getMin().z}, {bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMin().x, bb.getMax().y, bb.getMin().z}, {bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
mapBBoxes.addSegment({bb.getMax().x, bb.getMax().y, bb.getMin().z}, {bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
// // ceil
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.add({bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.splitFace(); mapBBoxes.splitFace();
|
||||
|
||||
// // up
|
||||
// mapBBoxes.addSegment({bb.getMin().x, bb.getMin().y, bb.getMin().z}, {bb.getMin().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMax().x, bb.getMin().y, bb.getMin().z}, {bb.getMax().x, bb.getMin().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMin().x, bb.getMax().y, bb.getMin().z}, {bb.getMin().x, bb.getMax().y, bb.getMax().z});
|
||||
// mapBBoxes.addSegment({bb.getMax().x, bb.getMax().y, bb.getMin().z}, {bb.getMax().x, bb.getMax().y, bb.getMax().z});
|
||||
|
||||
}
|
||||
|
||||
@@ -492,7 +548,7 @@ public:
|
||||
const float v = 140 + vo;
|
||||
|
||||
// drawing outlines as polygon is a hack for correct depth-order in gnuplot
|
||||
K::GnuplotColor color = K::GnuplotColor::fromRGB(v,v,v);
|
||||
K::GnuplotColor color = (settings.outlineColorCustom) ? (settings.outlineColor) : (K::GnuplotColor::fromRGB(v,v,v));
|
||||
K::GnuplotFill filler = K::GnuplotFill(K::GnuplotFillStyle::EMPTY_BORDER, color);
|
||||
K::GnuplotStroke stroke(K::GnuplotDashtype::NONE, 1, color);
|
||||
//K::GnuplotObjectPolygon* gpol = new K::GnuplotObjectPolygon(K::GnuplotFill::NONE(), stroke);
|
||||
|
||||
Reference in New Issue
Block a user