added support to toggle doors

This commit is contained in:
2018-05-12 10:58:22 +02:00
parent bb957e119a
commit 5da0277b5a
3 changed files with 22 additions and 6 deletions

View File

@@ -113,7 +113,10 @@ MainController::MainController() {
//mapModel->load("/mnt/vm/paper/diss/data/maps/test_in_out_overlap.xml");
mapModel->load("/mnt/vm/paper/diss/data/maps/walkmodel_stairs3.xml");
//mapModel->load("/mnt/vm/paper/diss/data/maps/walkmodel_stairs3.xml");
mapModel->load("/mnt/vm/paper/diss/data/maps/walkmodel_2D_1.xml");
//mapModel->load("/mnt/vm/paper/diss/data/maps/SHL42_nm.xml");
//mapModel->load("/apps/paper/diss/data/maps/SHL41_nm.xml");

View File

@@ -65,9 +65,19 @@ MapView3D::MapView3D(QWidget *parent) : QOpenGLWidget(parent) {
emit update();
});
QPushButton* btnDoor = new QPushButton(UIHelper::getIcon("door"), "", this);
btnDoor->setCheckable(true);
btnDoor->setStyleSheet(style);
btnDoor->setGeometry(16, 16+8+32+8+32+8+32, 32, 32);
connect(btnDoor, &QPushButton::clicked, [this] () {
this->floorplanRendererModel->showDoors = !this->floorplanRendererModel->showDoors;
layerChange();
emit update();
});
QPushButton* btnExp3D = new QPushButton(UIHelper::getIcon("save"), "", this);
btnExp3D->setStyleSheet(style);
btnExp3D->setGeometry(16, 16+8+32+8+32+8+32, 32, 32);
btnExp3D->setGeometry(16, 16+8+32+8+32+8+32+8+32, 32, 32);
connect(btnExp3D, &QPushButton::clicked, [this] () {
floorplanRendererModel->getMesh().exportOBJsimple("/tmp/map.obj");
floorplanRendererModel->getMesh().exportOBJcomplex("/tmp/map_complex", "map_complex");
@@ -175,7 +185,7 @@ void MapView3D::mouseReleaseEvent(QMouseEvent* e) {
void MapView3D::wheelEvent(QWheelEvent* e) {
float f = e->delta() / 120.0f;
scale *= (f > 0) ? (2) : (0.5);
scale *= (f > 0) ? (1.5) : (0.75);
update();
}

View File

@@ -31,18 +31,18 @@ private:
Material(0,128,0,255), // ground outdoor
Material(64,64,64,255), // ground outdoor
Material(255,96,96,255), // stair
Material(120,120,120,255), // stair
Material(220,220,220,255), // handrail
Material(200,200,255,96), // door (glass)
Material(200,160,150,255), // door (wood)
Material(140,140,140,255), // door (wood)
Material(128,128,128,255), // concrete
Material(200,200,255,96), // glass
Material(170,120,60,255), // wood
Material(200,200,200,255), // drywall
Material(250,250,250,255), // default
Material(255,255,255,255), // default
};
@@ -68,6 +68,8 @@ private:
public:
bool showDoors = false;
/** ctor */
FloorplanRendererModel() {
;
@@ -89,6 +91,7 @@ public:
// rebuild the mesh
Ray3D::ModelFactory fac(im);
fac.exportDoors = showDoors;
mesh = fac.getMesh();
triaTransp.clear();