worked on grid generation

minor editor changes
This commit is contained in:
2016-07-13 19:04:01 +02:00
parent 2935f468fc
commit 86c76b1284
14 changed files with 90 additions and 51 deletions

View File

@@ -21,7 +21,7 @@ class GridModel {
private:
int gridSize_cm = 31;
int gridSize_cm = 20;
Grid<MyNode> grid;
Floorplan::IndoorMap* im;
@@ -82,7 +82,7 @@ public:
Listener l;
GridFactory<MyNode> fac(grid);
fac.build(im, true, &l);
fac.build(im, &l);
Importance::addImportance(grid, 0);
//Importance::addImportance(grid, 400);

View File

@@ -79,8 +79,8 @@ public:
float sy1 = p.s.yms(my1);
float sx2 = p.s.xms(mx2);
float sy2 = p.s.yms(my2);
float sw = abs(sx1-sx2);
float sh = abs(sy1-sy2);
float sw = std::abs(sx1-sx2);
float sh = std::abs(sy1-sy2);
bbox = BBox2();
bbox.add(Point2(mx1, my1));

View File

@@ -97,8 +97,8 @@ public:
QLinearGradient gradient(p.s.xms(part.start.x), p.s.yms(part.start.y), p.s.xms(part.end.x), p.s.yms(part.end.y));
const float p1 = 0.1 + clamp01( part.start.z / floor->height) * 0.8;
const float p2 = 0.1 + clamp01( part.end.z / floor->height) * 0.8;
gradient.setColorAt(0, QColor(p1*255, p1*255, p1*255));
gradient.setColorAt(1, QColor(p2*255, p2*255, p2*255));
gradient.setColorAt(0, QColor(p1*255, p1*255, p1*255, 128));
gradient.setColorAt(1, QColor(p2*255, p2*255, p2*255, 128));
p.setBrush(gradient);
p.setPen(QColor(0,0,0,128));
@@ -107,6 +107,24 @@ public:
const std::vector<Point3> points = {quad.p1, quad.p2, quad.p3, quad.p4};
p.drawPolygon(points);
QPen pen;
pen.setWidth(5);
pen.setColor(QColor(255,0,0));
p.setPen(pen);
// LINT
if (i == 0) {
if (quad.p1.z != floor->getStartingZ()) {
p.drawLine(quad.p1, quad.p2);
}
}
if (i == (int) parts.size() - 1) {
if (quad.p3.z != floor->getEndingZ()) {
p.drawLine(quad.p3, quad.p4);
}
}
}
if (hasFocus()) {