worked on mapview 3d stuff
This commit is contained in:
@@ -18,6 +18,7 @@ DEFINES += WITH_DEBUG_LOG
|
|||||||
|
|
||||||
unix {
|
unix {
|
||||||
LIBS += -lstdc++fs
|
LIBS += -lstdc++fs
|
||||||
|
QMAKE_CXXFLAGS += -Werror=return-type
|
||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "mapview/3D/grid/GridRenderer.h"
|
#include "mapview/3D/grid/GridRenderer.h"
|
||||||
|
|
||||||
#include <Indoor/wifi/estimate/ray3/OBJPool.h>
|
#include <Indoor/floorplan/3D/objects/OBJPool.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ MainController::MainController() {
|
|||||||
|
|
||||||
//Ray3D::OBJPool::get().init("/mnt/vm/paper/diss/code/IndoorMap/res/mdl/");
|
//Ray3D::OBJPool::get().init("/mnt/vm/paper/diss/code/IndoorMap/res/mdl/");
|
||||||
//Ray3D::OBJPool::get().init("/apps/paper/diss/code/IndoorMap/res/mdl/");
|
//Ray3D::OBJPool::get().init("/apps/paper/diss/code/IndoorMap/res/mdl/");
|
||||||
Ray3D::OBJPool::get().init({
|
Floorplan3D::OBJPool::get().init({
|
||||||
"/mnt/vm/paper/diss/code/IndoorMap/res/mdl/",
|
"/mnt/vm/paper/diss/code/IndoorMap/res/mdl/",
|
||||||
"/apps/paper/diss/code/IndoorMap/res/mdl/",
|
"/apps/paper/diss/code/IndoorMap/res/mdl/",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "MapViewElementHelper.h"
|
#include "MapViewElementHelper.h"
|
||||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||||
#include <Indoor/wifi/estimate/ray3/OBJPool.h>
|
#include <Indoor/floorplan/3D/objects/OBJPool.h>
|
||||||
|
|
||||||
#include "../../UIHelper.h"
|
#include "../../UIHelper.h"
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ void MV2DElementFloorObstacleObject::paint(Painter& p) {
|
|||||||
// for (const Cache::Line& l : e.lines) {
|
// for (const Cache::Line& l : e.lines) {
|
||||||
// p.drawLine(l.p1, l.p2);
|
// p.drawLine(l.p1, l.p2);
|
||||||
// }
|
// }
|
||||||
const Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(fo->file).rotated_deg(fo->rot).translated(fo->pos);
|
const Floorplan3D::Obstacle3D obs = Floorplan3D::OBJPool::get().getObject(fo->file).rotated_deg(fo->rot).translated(fo->pos);
|
||||||
for (const Triangle3& tria : obs.triangles) {
|
for (const Triangle3& tria : obs.triangles) {
|
||||||
if (tria.p1.xy() != tria.p2.xy()) {
|
if (tria.p1.xy() != tria.p2.xy()) {
|
||||||
p.drawLine( tria.p1.xy(), tria.p2.xy() );
|
p.drawLine( tria.p1.xy(), tria.p2.xy() );
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ MapView3D::MapView3D(QWidget *parent) : QOpenGLWidget(parent) {
|
|||||||
floorplanRendererModel->getMesh().exportOBJsimple("/tmp/map.obj");
|
floorplanRendererModel->getMesh().exportOBJsimple("/tmp/map.obj");
|
||||||
floorplanRendererModel->getMesh().exportOBJcomplex("/tmp/map_complex", "map_complex");
|
floorplanRendererModel->getMesh().exportOBJcomplex("/tmp/map_complex", "map_complex");
|
||||||
floorplanRendererModel->getMesh().exportPLY("/tmp/map.ply");
|
floorplanRendererModel->getMesh().exportPLY("/tmp/map.ply");
|
||||||
|
QMessageBox::information(this, "Export", "3D Model exported to /tmp/* as .obj and .ply");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "../misc/Shader.h"
|
#include "../misc/Shader.h"
|
||||||
#include "../misc/TriangleData.h"
|
#include "../misc/TriangleData.h"
|
||||||
|
|
||||||
#include <Indoor/wifi/estimate/ray3/ModelFactory.h>
|
#include <Indoor/floorplan/3D/Builder.h>
|
||||||
|
|
||||||
#include "RenderTriangle.h"
|
#include "RenderTriangle.h"
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <Indoor/navMesh/NavMesh.h>
|
#include <Indoor/navMesh/NavMesh.h>
|
||||||
#include <Indoor/navMesh/NavMeshFactory.h>
|
#include <Indoor/navMesh/NavMeshFactory.h>
|
||||||
#include <Indoor/navMesh/NavMeshFactoryListener.h>
|
#include <Indoor/navMesh/NavMeshFactoryListener.h>
|
||||||
#include <Indoor/wifi/estimate/ray3/ModelFactory.h>
|
#include <Indoor/floorplan/3D/Builder.h>
|
||||||
|
|
||||||
#include "RenderTriangle.h"
|
#include "RenderTriangle.h"
|
||||||
|
|
||||||
@@ -37,18 +37,18 @@ const std::vector<Material> mats = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int FloorplanRendererModel::getMaterial(const Ray3D::Obstacle3D& o) const {
|
int FloorplanRendererModel::getMaterial(const Floorplan3D::Obstacle3D& o) const {
|
||||||
|
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::ERROR) {return 0;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::ERROR) {return 0;}
|
||||||
|
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::GROUND_OUTDOOR) {return 1;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::GROUND_OUTDOOR) {return 1;}
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::GROUND_INDOOR) {return 2;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::GROUND_INDOOR) {return 2;}
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::STAIR) {return 3;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::STAIR) {return 3;}
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::HANDRAIL) {return 4;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::HANDRAIL) {return 4;}
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::OBJECT) {return 12;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::OBJECT) {return 12;}
|
||||||
|
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::DOOR && o.mat == Floorplan::Material::GLASS) {return 5;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::DOOR && o.mat == Floorplan::Material::GLASS) {return 5;}
|
||||||
if (o.type == Ray3D::Obstacle3D::Type::DOOR) {return 6;}
|
if (o.type == Floorplan3D::Obstacle3D::Type::DOOR) {return 6;}
|
||||||
|
|
||||||
if (o.mat == Floorplan::Material::CONCRETE) {return 7;}
|
if (o.mat == Floorplan::Material::CONCRETE) {return 7;}
|
||||||
if (o.mat == Floorplan::Material::GLASS) {return 8;}
|
if (o.mat == Floorplan::Material::GLASS) {return 8;}
|
||||||
@@ -66,7 +66,7 @@ FloorplanRendererModel::FloorplanRendererModel() {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ray3D::FloorplanMesh& FloorplanRendererModel::getMesh() {
|
Floorplan3D::FloorplanMesh& FloorplanRendererModel::getMesh() {
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,10 +91,10 @@ void FloorplanRendererModel::rebuild(Floorplan::IndoorMap* im) {
|
|||||||
|
|
||||||
// rebuild the mesh
|
// rebuild the mesh
|
||||||
try {
|
try {
|
||||||
Ray3D::ModelFactory fac(im);
|
Floorplan3D::Builder fac(im);
|
||||||
fac.exportDoors = showDoors;
|
fac.exportDoors = showDoors;
|
||||||
mesh = fac.getMesh();
|
mesh = fac.getMesh();
|
||||||
for (const Ray3D::Obstacle3D& obs : mesh.elements) {
|
for (const Floorplan3D::Obstacle3D& obs : mesh.elements) {
|
||||||
const int matID = getMaterial(obs);
|
const int matID = getMaterial(obs);
|
||||||
const Material& mat = mats[matID];
|
const Material& mat = mats[matID];
|
||||||
for (const Triangle3& tria : obs.triangles) {
|
for (const Triangle3& tria : obs.triangles) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define FLOORPLANRENDERERMODEL_H
|
#define FLOORPLANRENDERERMODEL_H
|
||||||
|
|
||||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||||
#include <Indoor/wifi/estimate/ray3/FloorplanMesh.h>
|
#include <Indoor/floorplan/3D/FloorplanMesh.h>
|
||||||
|
|
||||||
#include "RenderTriangle.h"
|
#include "RenderTriangle.h"
|
||||||
|
|
||||||
@@ -14,12 +14,12 @@ class FloorplanRendererModel {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Floorplan::IndoorMap* im;
|
Floorplan::IndoorMap* im;
|
||||||
Ray3D::FloorplanMesh mesh;
|
Floorplan3D::FloorplanMesh mesh;
|
||||||
|
|
||||||
RenderTriangle triaSolid;
|
RenderTriangle triaSolid;
|
||||||
RenderTriangle triaTransp;
|
RenderTriangle triaTransp;
|
||||||
|
|
||||||
int getMaterial(const Ray3D::Obstacle3D& o) const;
|
int getMaterial(const Floorplan3D::Obstacle3D& o) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -29,7 +29,7 @@ public:
|
|||||||
/** ctor */
|
/** ctor */
|
||||||
FloorplanRendererModel();
|
FloorplanRendererModel();
|
||||||
|
|
||||||
Ray3D::FloorplanMesh& getMesh();
|
Floorplan3D::FloorplanMesh& getMesh();
|
||||||
|
|
||||||
const RenderTriangle& getTriaSolid();
|
const RenderTriangle& getTriaSolid();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user