diff --git a/IndoorMap.pro b/IndoorMap.pro index 7103d93..51964b2 100644 --- a/IndoorMap.pro +++ b/IndoorMap.pro @@ -43,7 +43,10 @@ SOURCES += \ params/MetaEditModel.cpp \ mapview/2D/MapView2D.cpp \ misc/LINTView.cpp \ - mapview/3DNavMesh/QNavMeshSettings.cpp + mapview/3DNavMesh/QNavMeshSettings.cpp \ + mapview/3D/misc/Cube.cpp \ + mapview/3D/misc/Shader.cpp \ + mapview/3D/misc/Window.cpp HEADERS += MainWindow.h \ @@ -170,7 +173,12 @@ HEADERS += MainWindow.h \ mapview/3DNavMesh/NavMeshView.h \ mapview/3DNavMesh/NavMeshRenderer.h \ mapview/3DNavMesh/NavMeshModel.h \ - mapview/3DNavMesh/QNavMeshSettings.h + mapview/3DNavMesh/QNavMeshSettings.h \ + fixC11.h \ + mapview/3D/misc/Shader.h \ + mapview/3D/misc/Camera.h \ + mapview/3D/misc/Renderable3D.h \ + mapview/3D/misc/Window.h FORMS += MainWindow.ui diff --git a/MainController.cpp b/MainController.cpp index 7843b7d..6841ed4 100644 --- a/MainController.cpp +++ b/MainController.cpp @@ -1,3 +1,5 @@ +#include "fixC11.h" + #include "MainController.h" #include "MainWindow.h" @@ -102,7 +104,8 @@ MainController::MainController() { //mapModel->load("/apps/map24b.xml"); //mapModel->load("/apps/SHL41.xml"); - mapModel->load("/mnt/vm/paper/diss/data/maps/SHL41_nm.xml"); + //mapModel->load("/mnt/vm/paper/diss/data/maps/SHL41_nm.xml"); + mapModel->load("/apps/paper/diss/data/maps/SHL41_nm.xml"); //mapModel->load("/apps/paper/diss/data/maps/map_elevator2.xml"); //mapModel->load("/apps/paper/diss/data/maps/map_issue6.xml"); diff --git a/MainController.h b/MainController.h index 6a1acd2..28cdbd4 100644 --- a/MainController.h +++ b/MainController.h @@ -1,6 +1,8 @@ #ifndef MAINCONTROLLER_H #define MAINCONTROLLER_H +#include "fixC11.h" + #include #include #include "MainWindow.h" diff --git a/MainWindow.cpp b/MainWindow.cpp index 224f3c4..8598fab 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -1,3 +1,5 @@ +#include "fixC11.h" + #include "MainWindow.h" #include "ui_MainWindow.h" diff --git a/MainWindow.h b/MainWindow.h index 2314a1f..35fe496 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -1,6 +1,8 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#include "fixC11.h" + #include class MapView2D; diff --git a/UIHelper.h b/UIHelper.h index 6bf0f0f..909c7e7 100644 --- a/UIHelper.h +++ b/UIHelper.h @@ -1,6 +1,8 @@ #ifndef UIHELPER_H #define UIHELPER_H +#include "fixC11.h" + #include #include #include diff --git a/fixC11.h b/fixC11.h new file mode 100644 index 0000000..1db03ca --- /dev/null +++ b/fixC11.h @@ -0,0 +1,60 @@ +#ifndef FIXC11_H +#define FIXC11_H + +#ifdef ANDROID + +#include +#include +#include + +namespace std { + + //template T sqrt(const T val) {return ::sqrt(val);} + + + //} + + template inline string to_string(const T val) { + stringstream ss; + ss << val; + return ss.str(); + } + + template inline T round(const T val) { + return ::round(val); + } + + // http://stackoverflow.com/questions/19478687/no-member-named-stoi-in-namespace-std + inline int stoi(const std::string& str) { + std::istringstream is(str); + int val; is >> val; return val; + } + + // analog zu oben + inline float stof(const std::string& str) { + std::istringstream is(str); + float val; is >> val; return val; + } + + // analog zu oben + inline double stod(const std::string& str) { + std::istringstream is(str); + double val; is >> val; return val; + } + + // analog zu oben + inline uint64_t stol(const std::string& str) { + std::istringstream is(str); + uint64_t val; is >> val; return val; + } + +// inline int sprintf(char* str, const char * format, ...) { +// //return ::sprintf(str, format, ...); +// return 0; +// } + +} + +#endif + +#endif // FIXC11_H diff --git a/main.cpp b/main.cpp index 2dc80b9..e57c1a0 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,5 @@ +#include "fixC11.h" + #include "MainController.h" #include diff --git a/mapview/2D/MapView2D.cpp b/mapview/2D/MapView2D.cpp index 9a2d2ac..7c47337 100644 --- a/mapview/2D/MapView2D.cpp +++ b/mapview/2D/MapView2D.cpp @@ -1,3 +1,5 @@ +#include "../../fixC11.h" + #include "MapView2D.h" #include diff --git a/mapview/2D/MapView2D.h b/mapview/2D/MapView2D.h index e05e21e..bd9cbd0 100644 --- a/mapview/2D/MapView2D.h +++ b/mapview/2D/MapView2D.h @@ -4,6 +4,8 @@ #include #include +#include "../../fixC11.h" + #include "Scaler.h" class MapModel; class MV2DElement; diff --git a/mapview/2D/tools/Tool.h b/mapview/2D/tools/Tool.h index f74cc04..f8fb2ad 100644 --- a/mapview/2D/tools/Tool.h +++ b/mapview/2D/tools/Tool.h @@ -5,6 +5,8 @@ #include #include +#include "../../../fixC11.h" + #include "../Painter.h" class MapView2D; diff --git a/mapview/2D/tools/Tools.h b/mapview/2D/tools/Tools.h index caa8332..4d3a1df 100644 --- a/mapview/2D/tools/Tools.h +++ b/mapview/2D/tools/Tools.h @@ -2,6 +2,7 @@ #define TOOLS_H #include +#include "../../../fixC11.h" #include "Tool.h" /** diff --git a/mapview/3D/MV3DElement.h b/mapview/3D/MV3DElement.h index b27f14b..3cc62ec 100644 --- a/mapview/3D/MV3DElement.h +++ b/mapview/3D/MV3DElement.h @@ -2,12 +2,13 @@ #define MV3DELEMENT_H #include "MapView3D.h" +#include "misc/Renderable3D.h" /** * represents one drawable * element shown within the MapView3D */ -class MV3DElement { +class MV3DElement : public Renderable3D { public: @@ -16,8 +17,8 @@ public: public: - /** repaint me */ - virtual void paintGL() = 0; + /** OLD: repaint me */ + //virtual void paintGL() = 0; /** is this a transparent element? */ virtual bool isTransparent() const = 0; diff --git a/mapview/3D/MV3DElementAccessPoint.h b/mapview/3D/MV3DElementAccessPoint.h index 0634e7d..03b8aba 100644 --- a/mapview/3D/MV3DElementAccessPoint.h +++ b/mapview/3D/MV3DElementAccessPoint.h @@ -22,11 +22,11 @@ protected: /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { Cube cube(ap->getPos(f), 0.25); - glColor3f(0,0,1); - cube.paintGL(); + cube.setColor(0,0,1); + cube.render(rs); } diff --git a/mapview/3D/MV3DElementElevator.h b/mapview/3D/MV3DElementElevator.h index 0ece148..e9f001f 100644 --- a/mapview/3D/MV3DElementElevator.h +++ b/mapview/3D/MV3DElementElevator.h @@ -24,18 +24,16 @@ public: } /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { const Point3 pos(e->center.x, e->center.y, f->getStartingZ() + e->height_m/2); const Point3 size(e->width/2, e->depth/2, e->height_m/2.0001); // z-fighting const Point3 rot(0,0,e->rotation * 180 / M_PI); - // fill color - glColor3f(0.2, 0.2, 0.2); - // build Cube cube(pos, size, rot); - cube.paintGL(); + cube.setColor(0.2, 0.2, 0.2); + cube.render(rs); } diff --git a/mapview/3D/MV3DElementFingerprintLocation.h b/mapview/3D/MV3DElementFingerprintLocation.h index 9b15232..ff8eda3 100644 --- a/mapview/3D/MV3DElementFingerprintLocation.h +++ b/mapview/3D/MV3DElementFingerprintLocation.h @@ -23,11 +23,11 @@ protected: /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { Cube cube(fpl->getPosition(*f), 0.15); - glColor3f(1,0,1); - cube.paintGL(); + cube.setColor(1,0,1); + cube.render(rs); } diff --git a/mapview/3D/MV3DElementFloorObstacleDoor.h b/mapview/3D/MV3DElementFloorObstacleDoor.h index 82ea3bf..e9add59 100644 --- a/mapview/3D/MV3DElementFloorObstacleDoor.h +++ b/mapview/3D/MV3DElementFloorObstacleDoor.h @@ -23,7 +23,7 @@ public: } /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { const Point2 from = fo->from; const Point2 to = fo->to; @@ -44,12 +44,10 @@ public: const Point3 size(sx, sy, sz); const Point3 rot(0,0,deg); - // fill color - glColor3f(0.395, 0.263, 0.129); - // build Cube cube(pos, size, rot); - cube.paintGL(); + cube.setColor(0.395, 0.263, 0.129); + cube.render(rs); //glColor3f(0.4, 0.4, 0.4); //Plane p(fo->from, fo->to, f->atHeight, fo->height); diff --git a/mapview/3D/MV3DElementFloorObstacleWall.h b/mapview/3D/MV3DElementFloorObstacleWall.h index 7080f62..a3435f2 100644 --- a/mapview/3D/MV3DElementFloorObstacleWall.h +++ b/mapview/3D/MV3DElementFloorObstacleWall.h @@ -5,6 +5,8 @@ #include #include "misc/Cube.h" +#include "misc/Window.h" + #include "MV3DElement.h" @@ -37,7 +39,7 @@ protected: Wall(const Point2 from, const Point2 to, const float thickness_m, const Floorplan::Material mat, float atHeight, float height) : from(from), to(to), thickness_m(thickness_m), mat(mat), atHeight(atHeight), height(height) {;} - void paintGL() { + void render(const RenderSettings& rs) { const float rad = -std::atan2(to.y - from.y, to.x - from.x); const float deg = rad * 180 / M_PI; @@ -50,154 +52,27 @@ protected: const Point3 pos(cen2.x, cen2.y, atHeight + height/2); // div by 2.01 to prevent overlapps and z-fi - const float sx = from.getDistance(to) / 2.01f; - const float sy = thickness_m / 2.01f; - const float sz = height / 2.01f; // prevent overlaps + const float sx = from.getDistance(to) / 2.02f; + const float sy = thickness_m / 2.02f; + const float sz = height / 2.02f; // prevent overlaps const Point3 size(sx, sy, sz); const Point3 rot(0,0,deg); - // fill color - if (mat == Floorplan::Material::CONCRETE) { - glColor3f(0.5, 0.5, 0.5); - } else { - glColor3f(0.75, 0.75, 0.75); - } - // build Cube cube(pos, size, rot); - cube.paintGL(); - - - /* - float y1 = atHeight; - float y2 = atHeight + height; - - - const Point2 p01 = from + dirPerp * w; - const Point2 p02 = from - dirPerp * w; - const Point2 p03 = to - dirPerp * w; - const Point2 p04 = to + dirPerp * w; - - // fill the wall if (mat == Floorplan::Material::CONCRETE) { - glColor3f(0.5, 0.5, 0.5); + cube.setColor(0.5, 0.5, 0.5); } else { - glColor3f(0.75, 0.75, 0.75); + cube.setColor(0.75, 0.75, 0.75); } + cube.render(rs); - auto renderQuad = [&] (const Point2 p1, const Point2 p2) { - glVertex3f(p1.x, y1, p1.y); - glVertex3f(p2.x, y1, p2.y); - glVertex3f(p2.x, y2, p2.y); - glVertex3f(p1.x, y2, p1.y); - }; - - glDisable(GL_CULL_FACE); - glBegin(GL_QUADS); - //glNormal3f(n.x, n.y, n.z); - - // short - renderQuad(p01, p02); - renderQuad(p03, p04); - - // long - renderQuad(p02, p03); - renderQuad(p04, p01); - - //glVertex3f(p1.x, p1.y, p1.z); - //glVertex3f(p2.x, p2.y, p2.z); - //glVertex3f(p3.x, p3.y, p3.z); - //glVertex3f(p4.x, p4.y, p4.z); - glEnd(); - glBegin(GL_CULL_FACE); - - - */ - - -/* - // polygon edges - Point3 p1 = Point3(from.x, y1, from.y); - Point3 p2 = Point3(to.x, y1, to.y); - Point3 p3 = Point3(to.x, y2, to.y); - Point3 p4 = Point3(from.x, y2, from.y); - - // calculate normal -// Point3 v1 = p2-p1; -// Point3 v2 = p3-p1; -// Point3 n = cross(v1, v2); -// n/=n.length(); - Point3 n = Math::normal(p2-p1, p3-p1); - - // align normals to virtual viewport - Point3 view(99,99,99); - if ((view-n).length() > (view+n).length()) {n = -n;} - - - - glDisable(GL_CULL_FACE); - glBegin(GL_QUADS); - glNormal3f(n.x, n.y, n.z); - glVertex3f(p1.x, p1.y, p1.z); - glVertex3f(p2.x, p2.y, p2.z); - glVertex3f(p3.x, p3.y, p3.z); - glVertex3f(p4.x, p4.y, p4.z); - glEnd(); - glEnable(GL_CULL_FACE); - - */ } }; - struct Window { - - Point2 from; - Point2 to; - float atHeight; - float height; - - Window(const Point2 from, const Point2 to, float atHeight, float height) : - from(from), to(to), atHeight(atHeight), height(height) {;} - - void paintGL() { - - float y1 = atHeight; - float y2 = atHeight + height; - - // polygon edges - Point3 p1 = Point3(from.x, y1, from.y); - Point3 p2 = Point3(to.x, y1, to.y); - Point3 p3 = Point3(to.x, y2, to.y); - Point3 p4 = Point3(from.x, y2, from.y); - - // calculate normal - Point3 n = Math::normal(p2-p1, p3-p1); - - // align normals to virtual viewport - Point3 view(99,99,99); - if ((view-n).length() > (view+n).length()) {n = -n;} - - glColor4f(0.75, 0.85, 1.0, 0.35); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_CULL_FACE); - glBegin(GL_QUADS); - glNormal3f(n.x, n.y, n.z); - glVertex3f(p1.x, p1.y, p1.z); - glVertex3f(p2.x, p2.y, p2.z); - glVertex3f(p3.x, p3.y, p3.z); - glVertex3f(p4.x, p4.y, p4.z); - glEnd(); - glEnable(GL_CULL_FACE); - glDisable(GL_BLEND); - - } - - }; - - struct Handrail { + struct Handrail : public Renderable3D { Point2 from; Point2 to; @@ -207,7 +82,7 @@ protected: Handrail(const Point2 from, const Point2 to, float atHeight, float height) : from(from), to(to), atHeight(atHeight), height(height) {;} - void paintGL() { + void render(const RenderSettings& rs) override { float y1 = atHeight; float y2 = atHeight + height; @@ -219,6 +94,10 @@ protected: Point3 p3 = Point3(from.x, y2, from.y); Point3 p4 = Point3(to.x, y2, to.y); + /* + + TODO_GL + glDisable(GL_LIGHTING); glBegin(GL_LINES); @@ -252,27 +131,29 @@ protected: glEnd(); glEnable(GL_LIGHTING); + */ + } }; /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { if (fo->material == Floorplan::Material::GLASS) { Window win(fo->from, fo->to, f->atHeight, f->height); - win.paintGL(); + win.render(rs); } else if (fo->type == Floorplan::ObstacleType::WALL) { Wall wall(fo->from, fo->to, fo->thickness_m, fo->material, f->atHeight, f->height); - wall.paintGL(); + wall.render(rs); } else if (fo->type == Floorplan::ObstacleType::HANDRAIL) { Handrail rail(fo->from, fo->to, f->atHeight, 1.0); - rail.paintGL(); + rail.render(rs); } diff --git a/mapview/3D/MV3DElementFloorOutline.h b/mapview/3D/MV3DElementFloorOutline.h index 5ed6747..82a1d26 100644 --- a/mapview/3D/MV3DElementFloorOutline.h +++ b/mapview/3D/MV3DElementFloorOutline.h @@ -9,6 +9,7 @@ #include "../../lib/gpc/gpc.h" #include "misc/Polygon.h" +#include "misc/Shader.h" class MV3DElementFloorOutline : public MV3DElement { @@ -37,15 +38,60 @@ protected: /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { rebuildIfNeeded(); + rs.shader->bind(); + + glDisable(GL_CULL_FACE); + + QMatrix4x4 mat; + rs.shader->setModelMatrix(mat); + for (auto& it : elements) { //Polygon& pol = it.second->pol; std::vector>& trias = it.second->trias; + if (it.first == "outdoor") { + rs.shader->setColor(0.0, 0.5, 0.0); + } else { + rs.shader->setColor(0.2, 0.2, 0.2); + } + + std::vector values; + std::vector normals; + + for (const std::vector& tria : trias) { + for (int i = 2; i < tria.size(); ++i) { + + const Point3 p1 = tria[i-2]; + const Point3 p2 = tria[i-1]; + const Point3 p3 = tria[i-0]; + + values.push_back(p1.x); values.push_back(p1.y); values.push_back(p1.z); + values.push_back(p2.x); values.push_back(p2.y); values.push_back(p2.z); + values.push_back(p3.x); values.push_back(p3.y); values.push_back(p3.z); + + normals.push_back(0); normals.push_back(1); normals.push_back(0); + normals.push_back(0); normals.push_back(1); normals.push_back(0); + normals.push_back(0); normals.push_back(1); normals.push_back(0); + + } + } + + rs.shader->setVertices(values.data()); + rs.shader->setNormals(normals.data()); + + glDrawArrays(GL_TRIANGLES, 0, values.size() / 3); + rs.shader->unsetVertices(); + rs.shader->unsetNormals(); + + /* + + TODO_GL + if (it.first == "outdoor") { glColor3f(0.0, 0.5, 0.0); } else { @@ -63,8 +109,14 @@ protected: } glEnable(GL_CULL_FACE); + */ + } + glEnable(GL_CULL_FACE); + + rs.shader->release(); + } void rebuildIfNeeded() { diff --git a/mapview/3D/MV3DElementRegistrationPoint.h b/mapview/3D/MV3DElementRegistrationPoint.h index 612f477..ab746ec 100644 --- a/mapview/3D/MV3DElementRegistrationPoint.h +++ b/mapview/3D/MV3DElementRegistrationPoint.h @@ -21,11 +21,11 @@ protected: /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { Cube cube(reg->posOnMap_m, 0.5); - glColor3f(0,0,0); - cube.paintGL(); + cube.setColor(0,0,0); + cube.render(rs); } diff --git a/mapview/3D/MV3DElementStair.h b/mapview/3D/MV3DElementStair.h index d6b327c..76e8036 100644 --- a/mapview/3D/MV3DElementStair.h +++ b/mapview/3D/MV3DElementStair.h @@ -22,10 +22,12 @@ protected: /** repaint me */ - void paintGL() override { + void render(const RenderSettings& rs) override { glDisable(GL_CULL_FACE); + /* + TODO_GL //glColor3f(1.0, 0.55, 0.55); glColor3f(0.3, 0.3, 0.3); glBegin(GL_QUADS); @@ -55,7 +57,7 @@ protected: glEnd(); glEnable(GL_CULL_FACE); - + */ } bool isTransparent() const override { diff --git a/mapview/3D/MapView3D.cpp b/mapview/3D/MapView3D.cpp index 245503d..e896613 100644 --- a/mapview/3D/MapView3D.cpp +++ b/mapview/3D/MapView3D.cpp @@ -1,5 +1,6 @@ -#include "MapView3D.h" +#include "../../fixC11.h" +#include "MapView3D.h" #include "../model/MapModelElement.h" #include "../model/MapModel.h" @@ -10,11 +11,11 @@ #include "../3DNavMesh/NavMeshModel.h" #include "../3DNavMesh/NavMeshRenderer.h" -MapView3D::MapView3D(QWidget *parent) : QGLWidget(parent) { +MapView3D::MapView3D(QWidget *parent) : QOpenGLWidget(parent) { - rot.x = 45; + rot.x = 0; rot.y = 0; - rot.z = 45; + rot.z = 0; center.x = 0; center.y = 0; @@ -33,9 +34,10 @@ void MapView3D::initializeGL() { //setFormat(QGLFormat(QGL::SampleBuffers)); - QGLWidget::initializeGL(); + QOpenGLWidget::initializeGL(); glCullFace(GL_FRONT); + glFrontFace(GL_CCW); //glDisable(GL_CULL_FACE); glEnable(GL_CULL_FACE); @@ -46,6 +48,10 @@ void MapView3D::initializeGL() { // glEnable(GL_MULTISAMPLE); // glEnable(GL_LINE_SMOOTH); + /* + + TODO_GL + glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_LIGHT1); @@ -73,8 +79,11 @@ void MapView3D::initializeGL() { // glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); // glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + */ + // background color - qglClearColor(Qt::white); + //glClearColor(Qt::white); + glClearColor(1,1,1,1); } @@ -82,14 +91,14 @@ void MapView3D::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + /* + + TODO_GL + glLoadIdentity(); - - - glScalef(+1, -1, +1); - // 3) scale glScalef(scale.x, scale.y, scale.z); @@ -113,6 +122,8 @@ void MapView3D::paintGL() { // // 1) translate into center // glTranslatef(tra.x, tra.y, tra.z); + */ + draw(); @@ -123,7 +134,12 @@ void MapView3D::resizeGL(int width, int height) { //int side = qMin(width, height); //glViewport((width - side) / 2, (height - side) / 2, side, side); - glViewport(0, 0, width, height); + + + //glViewport(0, 0, width, height); + + /* + TODO_GL glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -138,9 +154,9 @@ void MapView3D::resizeGL(int width, int height) { //glFrustum(+w, -w, -h, +h, -20, +20); - - glMatrixMode(GL_MODELVIEW); + */ + } @@ -155,13 +171,12 @@ void MapView3D::mouseMoveEvent(QMouseEvent* e) { float dx = mouse.x - e->x(); float dy = mouse.y - e->y(); if (mouse.btn == 1) { - //rot.z += dx/2.0f; // upward - //rot.x -= dy/2.0f; - rot.z += dx/2.0f; // upward - rot.x += dy/2.0f; + rot.z -= dx/2.0f; + rot.x -= dy/2.0f; } else if (mouse.btn == 4) { //Point3 vec(-dx / width() * 2 * viewport.size.x, 0, +dy / height() * 2 * viewport.size.y); - Point3 vec(-dx / width() * 2 * viewport.size.x, 0, -dy / height() * 2 * viewport.size.y); + Point3 vec(-dx / width() * 2 * viewport.size.x, 0, +dy / height() * 2 * viewport.size.y); + //Point3 vec(-dx * 2 / width() , 0, +dy * 2 / height()); vec = vec.rot(rot.x/180*M_PI, rot.y/180*M_PI, rot.z/180*M_PI); vec /= scale; center += vec; @@ -235,14 +250,57 @@ void MapView3D::setShowNavMesh(bool show) { } +#include "misc/Shader.h" + void MapView3D::draw() { + static RenderSettings rs = RenderSettings(new Shader()); + + glViewport(0, 0, width(), height()); + + //glCullFace(GL_FRONT); + //glFrontFace(GL_CCW); + glEnable(GL_CULL_FACE); + glEnable(GL_DEPTH_TEST); + + + // view + QMatrix4x4 V; + V.scale(scale.x, scale.y, scale.z); + V.rotate(rot.x, 1.0, 0.0, 0.0); + V.rotate(rot.y, 0.0, 1.0, 0.0); + V.rotate(rot.z, 0.0, 0.0, 1.0); + V.translate(center.x, center.z, center.y); + V.translate(0,0,-50); +// V.lookAt(QVector3D(30,-25,25), QVector3D(30,10,0), QVector3D(0,1,0)); + + + // projection + QMatrix4x4 P; + float aspect = (float) width() / (float) height(); + float w = 2.0f; + float h = 2.0f * height() / width(); + viewport.size.x = w; + viewport.size.y = h; + //P.ortho(-w, +w, +h, -h, 0.1f, +30); // glOrtho(-w, +w, -h, +h, -20, +20); + P.perspective(45.0f, aspect, 0.01, 100); + + + rs.shader->bind(); + rs.shader->setViewMatrix(V); + rs.shader->setProjectionMatrix(P); + + Cube cube(Point3(0,0,0), 1); + cube.setColor(1,0,0); + cube.render(rs); + + /* // solid floorplan parts if (showFloorplan) { std::vector elements = getModel()->getVisibleElements(); for (MapModelElement* el : elements) { - if (el->getMV3D() && !el->getMV3D()->isTransparent()) {el->getMV3D()->paintGL();} + if (el->getMV3D() && !el->getMV3D()->isTransparent()) {el->getMV3D()->render(rs);} } } @@ -260,9 +318,11 @@ void MapView3D::draw() { std::vector elements = getModel()->getVisibleElements(); for (MapModelElement* el : elements) { - if (el->getMV3D() && el->getMV3D()->isTransparent()) {el->getMV3D()->paintGL();} + if (el->getMV3D() && el->getMV3D()->isTransparent()) {el->getMV3D()->render(rs);} } } + */ + } diff --git a/mapview/3D/MapView3D.h b/mapview/3D/MapView3D.h index dc17011..a208675 100644 --- a/mapview/3D/MapView3D.h +++ b/mapview/3D/MapView3D.h @@ -1,6 +1,8 @@ #ifndef MAPVIEW3D_H #define MAPVIEW3D_H +#include "../../fixC11.h" + #include #include @@ -12,7 +14,7 @@ class GridRenderer; class NavMeshRenderer; class NavMeshModel; -class MapView3D : public QGLWidget { +class MapView3D : public QOpenGLWidget { Q_OBJECT diff --git a/mapview/3D/misc/Camera.h b/mapview/3D/misc/Camera.h new file mode 100644 index 0000000..a9941e9 --- /dev/null +++ b/mapview/3D/misc/Camera.h @@ -0,0 +1,23 @@ +#ifndef CAMERA_H +#define CAMERA_H + +#include +#include + +class Camera { + + QMatrix4x4 V; + QMatrix4x4 P; + +public: + + Camera() { + + } + + QMatrix4x4 getV() const {return V;} + QMatrix4x4 getP() const {return P;} + +}; + +#endif // CAMERA_H diff --git a/mapview/3D/misc/Cube.cpp b/mapview/3D/misc/Cube.cpp new file mode 100644 index 0000000..b3b3aae --- /dev/null +++ b/mapview/3D/misc/Cube.cpp @@ -0,0 +1,259 @@ +#include "Cube.h" +#include "Shader.h" +#include + +//static float cube_vertices[] = { +//1 -1.0000, -1.0000, -1.0000, +//2 -1.0000, 1.0000, -1.0000, +//3 1.0000, 1.0000, -1.0000, +//4 1.0000, -1.0000, -1.0000, +//5 -1.0000, -1.0000, 1.0000, +//6 1.0000, -1.0000, 1.0000, +//7 1.0000, 1.0000, 1.0000, +//8 -1.0000, 1.0000, 1.0000, +//}; + +//static int cube_vertex_indices[] = { +// 1, 2, 3, +// 3, 4, 1, +// 5, 6, 7, +// 7, 8, 5, +// 1, 4, 6, +// 6, 5, 1, +// 4, 3, 7, +// 7, 6, 4, +// 3, 2, 8, +// 8, 7, 3, + +// 2, 1, 5, +// 5, 8, 2, +//}; + +static float cube_vertices[] = { + + + -1, -1, 0, + +1, -1, 0, + 0, +1, 0, + +// -1.0000, -1.0000, -1.0000, -1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, +// 1.0000, 1.0000, -1.0000, 1.0000, -1.0000, -1.0000, -1.0000, -1.0000, -1.0000, + +// -1.0000, -1.0000, 1.0000, 1.0000, -1.0000, 1.0000, 1.0000, 1.0000, 1.0000, +// 1.0000, 1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, -1.0000, 1.0000, + +// -1.0000, -1.0000, -1.0000, 1.0000, -1.0000, -1.0000, 1.0000, -1.0000, 1.0000, +// 1.0000, -1.0000, 1.0000, -1.0000, -1.0000, 1.0000, -1.0000, -1.0000, -1.0000, + +// 1.0000, -1.0000, -1.0000, 1.0000, 1.0000, -1.0000, 1.0000, 1.0000, 1.0000, +// 1.0000, 1.0000, 1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, -1.0000, + +// 1.0000, 1.0000, -1.0000, -1.0000, 1.0000, -1.0000, -1.0000, 1.0000, 1.0000, +// -1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, -1.0000, + +// -1.0000, 1.0000, -1.0000, -1.0000, -1.0000, -1.0000, -1.0000, -1.0000, 1.0000, +// -1.0000, -1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, 1.0000, -1.0000, + +}; + +//static float cube_normals[] = { +// 0.0000, 0.0000, -1.0000, +// 0.0000, 0.0000, 1.0000, +// 0.0000, -1.0000, 0.0000, +// 1.0000, 0.0000, 0.0000, +// 0.0000, 1.0000, 0.0000, +// -1.0000, 0.0000, 0.0000, +//}; + +static float cube_normals[] = { + 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, + 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, + + 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, + 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, + + 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, + 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, 0.0000, -1.0000, 0.0000, + + 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, + 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, + + 0.0000, 1.0000, 0.0000,0.0000, 1.0000, 0.0000,0.0000, 1.0000, 0.0000, + 0.0000, 1.0000, 0.0000,0.0000, 1.0000, 0.0000,0.0000, 1.0000, 0.0000, + + -1.0000, 0.0000, 0.0000,-1.0000, 0.0000, 0.0000,-1.0000, 0.0000, 0.0000, + -1.0000, 0.0000, 0.0000,-1.0000, 0.0000, 0.0000,-1.0000, 0.0000, 0.0000, +}; + +//static int cube_normal_indices[] = { +// 1, 1, 1, +// 1, 1, 1, +// 2, 2, 2, +// 2, 2, 2, +// 3, 3, 3, +// 3, 3, 3, +// 4, 4, 4, +// 4, 4, 4, +// 5, 5, 5, +// 5, 5, 5, +// 6, 6, 6, +// 6, 6, 6, +//}; + + + +//static float cube_vertices[] = { + +// // bottom +// +1, -1, -1, +// +1, -1, +1, +// -1, -1, +1, + +// -1, -1, +1, +// -1, -1, -1, +// +1, -1, -1, + +// // top +// -1, +1, -1, +// -1, +1, +1, +// +1, +1, +1, + +// +1, +1, +1, +// +1, +1, -1, +// -1, +1, -1, + +// // left +// -1, -1, -1, +// -1, -1, +1, +// -1, +1, +1, + +// -1, +1, +1, +// -1, +1, -1, +// -1, -1, -1, + +// // right +// +1, +1, -1, +// +1, +1, +1, +// +1, -1, +1, + +// +1, -1, +1, +// +1, -1, -1, +// +1, +1, -1, + +// // front +// +1, +1, +1, +// -1, +1, +1, +// -1, -1, +1, + +// -1, -1, +1, +// +1, -1, +1, +// +1, +1, +1, + +// // rear +// +1, -1, -1, +// -1, -1, -1, +// -1, +1, -1, + +// -1, +1, -1, +// +1, +1, -1, +// +1, -1, -1, + +//}; + +//static float cube_normals[] = { + +// // bottom +// 0,-1,0, +// 0,-1,0, +// 0,-1,0, +// 0,-1,0, +// 0,-1,0, +// 0,-1,0, + +// // top +// 0,+1,0, +// 0,+1,0, +// 0,+1,0, +// 0,+1,0, +// 0,+1,0, +// 0,+1,0, + +// // left +// -1,0,0, +// -1,0,0, +// -1,0,0, +// -1,0,0, +// -1,0,0, +// -1,0,0, + +// // right +// +1,0,0, +// +1,0,0, +// +1,0,0, +// +1,0,0, +// +1,0,0, +// +1,0,0, + +// // front +// 0,0,+1, +// 0,0,+1, +// 0,0,+1, +// 0,0,+1, +// 0,0,+1, +// 0,0,+1, + +// // rear +// 0,0,-1, +// 0,0,-1, +// 0,0,-1, +// 0,0,-1, +// 0,0,-1, +// 0,0,-1, + +//}; + +static Shader* shader = nullptr; + +Cube::Cube(Point3 pos, float size) : pos(pos), size(size,size,size), rot(0,0,0) { + +} + +Cube::Cube(Point3 pos, Point3 size, Point3 rot) : pos(pos), size(size), rot(rot) { + +} + +void Cube::setColor(float r, float g, float b) { + this->color = Point3(r,g,b); +} + +void Cube::render(const RenderSettings& rs) { + + + + rs.shader->bind(); + + QMatrix4x4 mat; + mat.translate(pos.x, pos.y, pos.z); + mat.rotate(rot.x, 1, 0, 0); + mat.rotate(rot.y, 0, 1, 0); + mat.rotate(rot.z, 0, 0, 1); + mat.scale(size.x, size.y, size.z); + + +// mat.scale(0.1, 0.1, 0.1); + rs.shader->setModelMatrix(mat); +// shader->setViewMatrix(V); +// shader->setProjectionMatrix(P); + + rs.shader->setColor(color.x, color.y, color.z); + + rs.shader->setVertices(cube_vertices); + rs.shader->setNormals(cube_normals); + glDrawArrays(GL_TRIANGLES, 0, 1*3); + //glDrawElements(GL_TRIANGLES, 12, GL_INT, cube_vertex_indices); + rs.shader->unsetVertices(); + rs.shader->unsetNormals(); + + rs.shader->release(); + +}; diff --git a/mapview/3D/misc/Cube.h b/mapview/3D/misc/Cube.h index 79ce094..cda6a84 100644 --- a/mapview/3D/misc/Cube.h +++ b/mapview/3D/misc/Cube.h @@ -2,9 +2,11 @@ #define CUBE_H #include -#include +#include "Renderable3D.h" -class Cube { +class Shader; + +class Cube : public Renderable3D { private: @@ -12,20 +14,28 @@ private: Point3 size; Point3 rot; + Point3 color; public: - Cube(Point3 pos, float size) : pos(pos), size(size,size,size), rot(0,0,0) { + Cube(Point3 pos, float size); - } + Cube(Point3 pos, Point3 size, Point3 rot); - Cube(Point3 pos, Point3 size, Point3 rot) : pos(pos), size(size), rot(rot) { + void setColor(float r, float g, float b); - } + void render(const RenderSettings& rs) override; - void paintGL() { - float s = 1; + + + /* + + void paintGL(Shader* shader); + + TODO_GL + + glColor3f(color.x, color.y, color.z); glPushMatrix(); @@ -90,7 +100,7 @@ public: glPopMatrix(); - } + */ }; diff --git a/mapview/3D/misc/Renderable3D.h b/mapview/3D/misc/Renderable3D.h new file mode 100644 index 0000000..21d071d --- /dev/null +++ b/mapview/3D/misc/Renderable3D.h @@ -0,0 +1,20 @@ +#ifndef RENDERABLE3D_H +#define RENDERABLE3D_H + +class Shader; + +struct RenderSettings { + Shader* shader = nullptr; + RenderSettings(Shader* shader) : shader(shader) {;} +}; + + +class Renderable3D { + +public: + + virtual void render(const RenderSettings& rs) = 0; + +}; + +#endif // RENDERABLE3D_H diff --git a/mapview/3D/misc/Shader.cpp b/mapview/3D/misc/Shader.cpp new file mode 100644 index 0000000..042d670 --- /dev/null +++ b/mapview/3D/misc/Shader.cpp @@ -0,0 +1,88 @@ +#include "Shader.h" +#include + +Shader::Shader() { + + addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, R"( + attribute highp vec3 a_vertex; + attribute highp vec3 a_normal; + uniform highp mat4 M; + uniform highp mat4 V; + uniform highp mat4 P; + varying highp vec3 normal; + void main() { + gl_Position = vec4(a_vertex, 1.0); + normal = normalize( V*M*vec4(a_normal, 0.0) ); + } + )"); + + addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, R"( + uniform vec4 color; + varying highp vec3 normal; + void main() { + float intensity = dot( normal, normalize(vec3(-1,-1,-3)) ); + gl_FragColor.rgb = color.rgb * intensity; + gl_FragColor.a = color.a; + } + )"); + + //bindAttributeLocation("vertices", 0); + if (!link()) { + std::cout << log().toStdString() << std::endl; + throw std::runtime_error("shader link error"); + } + +} + + +void Shader::setModelMatrix(const QMatrix4x4& m) { + //setUniformValue(getUniform("M"), m); +} + +void Shader::setViewMatrix(const QMatrix4x4& m) { + //setUniformValue(getUniform("V"), m); +} + +void Shader::setProjectionMatrix(const QMatrix4x4& m) { + //setUniformValue(getUniform("P"), m); +} + +int Shader::getUniform(const char* name) { + int loc = uniformLocation(name); + if (loc == -1) {throw std::runtime_error("error");} + return loc; +} + +int Shader::getAttribute(const char* name) { + int loc = attributeLocation(name); + if (loc == -1) {throw std::runtime_error("error");} + return loc; +} + + +void Shader::setColor(const float r, const float g, const float b) { + setUniformValue(getUniform("color"), QVector4D(r,g,b,1)); +} +void Shader::setColor(const float r, const float g, const float b, const float a) { + setUniformValue(getUniform("color"), QVector4D(r,g,b,a)); +} + +void Shader::setVertices(const float* values) { + const int loc = getAttribute("a_vertex"); + enableAttributeArray(loc); + setAttributeArray(loc, GL_FLOAT, values, 3); +} +void Shader::unsetVertices() { + const int loc = getAttribute("a_vertex"); + disableAttributeArray(loc); +} + +void Shader::setNormals(const float* values) { + const int loc = getAttribute("a_normal"); + enableAttributeArray(loc); + setAttributeArray(loc, GL_FLOAT, values, 3); +} +void Shader::unsetNormals() { + const int loc = getAttribute("a_normal"); + disableAttributeArray(loc); +} diff --git a/mapview/3D/misc/Shader.h b/mapview/3D/misc/Shader.h new file mode 100644 index 0000000..79f3a2d --- /dev/null +++ b/mapview/3D/misc/Shader.h @@ -0,0 +1,33 @@ +#ifndef SHADER_H +#define SHADER_H + +#include + +class Shader : public QOpenGLShaderProgram { + +public: + + Shader(); + + void setModelMatrix(const QMatrix4x4& m); + + void setViewMatrix(const QMatrix4x4& m); + + void setProjectionMatrix(const QMatrix4x4& m); + + void setColor(const float r, const float g, const float b); + void setColor(const float r, const float g, const float b, const float a); + + void setVertices(const float*); + void unsetVertices(); + + void setNormals(const float*); + void unsetNormals(); + + int getUniform(const char*); + int getAttribute(const char*); + + +}; + +#endif // SHADER_H diff --git a/mapview/3D/misc/Window.cpp b/mapview/3D/misc/Window.cpp new file mode 100644 index 0000000..c98826c --- /dev/null +++ b/mapview/3D/misc/Window.cpp @@ -0,0 +1,87 @@ +#include "Window.h" +#include "Shader.h" + +#include +#include + +static float window_vertices[] = { + + +1, 0, +1, + -1, 0, +1, + -1, 0, -1, + + -1, 0, -1, + +1, 0, -1, + +1, 0, +1, + + -1, 0, +1, + +1, 0, +1, + -1, 0, -1, + + +1, 0, -1, + -1, 0, -1, + +1, 0, +1, + +}; + +static float window_normals[] = { + + 0,-1,0, + 0,-1,0, + 0,-1,0, + + 0,-1,0, + 0,-1,0, + 0,-1,0, + + 0,+1,0, + 0,+1,0, + 0,+1,0, + + 0,+1,0, + 0,+1,0, + 0,+1,0, + +}; + +Window::Window(const Point2 from, const Point2 to, float atHeight, float height) : + from(from), to(to), atHeight(atHeight), height(height) { + + const Point2 cen = (from+to)/2; + + const float sx = from.getDistance(to) / 2.0f; + const float sz = height / 2.0f; + + const float rad = -std::atan2(to.y - from.y, to.x - from.x); + const float deg = rad * 180 / M_PI; + + mat.translate(cen.x, cen.y, atHeight + height/2); + mat.rotate(deg, 0, 0, 1); + mat.scale(sx, 1, sz); + +} + +void Window::render(const RenderSettings& rs) { + + rs.shader->bind(); + + rs.shader->setColor(0.75, 0.85, 1.0, 0.35); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //glDisable(GL_CULL_FACE); + + rs.shader->setModelMatrix(mat); + + rs.shader->setVertices(window_vertices); + rs.shader->setNormals(window_normals); + glDrawArrays(GL_TRIANGLES, 0, 12); + rs.shader->unsetVertices(); + rs.shader->unsetNormals(); + + //glEnable(GL_CULL_FACE); + glDisable(GL_BLEND); + + rs.shader->release(); + +} diff --git a/mapview/3D/misc/Window.h b/mapview/3D/misc/Window.h new file mode 100644 index 0000000..e833c31 --- /dev/null +++ b/mapview/3D/misc/Window.h @@ -0,0 +1,26 @@ +#ifndef WINDOW_H +#define WINDOW_H + +#include "Renderable3D.h" +#include + +#include + +class Window : public Renderable3D { + + Point2 from; + Point2 to; + float atHeight; + float height; + + QMatrix4x4 mat; + +public: + + Window(const Point2 from, const Point2 to, float atHeight, float height); + + virtual void render(const RenderSettings& rs) override; + +}; + +#endif // WINDOW_H diff --git a/mapview/3DGrid/GridRenderer.h b/mapview/3DGrid/GridRenderer.h index 2cd3e76..5733dba 100644 --- a/mapview/3DGrid/GridRenderer.h +++ b/mapview/3DGrid/GridRenderer.h @@ -50,6 +50,10 @@ public: /** render the given grid using GL commands */ void paintGL(Grid* grid) { + /* + + TODO_GL + glDisable(GL_LIGHTING); const float sz = 1.0f; // scale-z: more/less z-spacing @@ -100,6 +104,8 @@ public: } glEnd(); + + // std::vector vec = lint(); // glPointSize(4.0f); // glBegin(GL_POINTS); @@ -114,6 +120,8 @@ public: glEnable(GL_LIGHTING); + */ + } // std::vector lint() { diff --git a/mapview/3DNavMesh/NavMeshRenderer.h b/mapview/3DNavMesh/NavMeshRenderer.h index c555368..930f497 100644 --- a/mapview/3DNavMesh/NavMeshRenderer.h +++ b/mapview/3DNavMesh/NavMeshRenderer.h @@ -57,15 +57,14 @@ public: if (navMesh == nullptr) {return;} -// QPainter qp; -// qp.begin(dst); + /* + + TODO_GL glDisable(GL_LIGHTING); const float s = 2; - - glBegin(GL_TRIANGLES); for (const NM::NavMeshTriangle* tria : *navMesh) { @@ -153,6 +152,10 @@ public: // dst->renderText(0,0, "2342342342342423423423423423423432"); // dst->renderText(0.1, 0.1, 0.1, "lsdfsdfsdfsdfsdfsdfsdfol"); + + + */ + } // std::vector lint() { diff --git a/mapview/model/MapModel.h b/mapview/model/MapModel.h index 51e49cb..f0e551f 100644 --- a/mapview/model/MapModel.h +++ b/mapview/model/MapModel.h @@ -3,6 +3,8 @@ #include +#include "../../fixC11.h" + #include "MapLayer.h" #include "MapModelElement.h" #include "MapModelListener.h" diff --git a/misc/GnuplotExport.h b/misc/GnuplotExport.h index 07a4a14..5bb0cf8 100644 --- a/misc/GnuplotExport.h +++ b/misc/GnuplotExport.h @@ -1,6 +1,8 @@ #ifndef GNUPLOTEXPORT_H #define GNUPLOTEXPORT_H +#include "fixC11.h" + #include #include diff --git a/misc/LINTView.cpp b/misc/LINTView.cpp index 0af598f..fb0af70 100644 --- a/misc/LINTView.cpp +++ b/misc/LINTView.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "LINTView.h" #include diff --git a/misc/LINTView.h b/misc/LINTView.h index ec2e733..b3bd0f2 100644 --- a/misc/LINTView.h +++ b/misc/LINTView.h @@ -1,6 +1,8 @@ #ifndef LINTVIEW_H #define LINTVIEW_H +#include "fixC11.h" + #include class QStringListModel; #include diff --git a/params/ActionWidget.h b/params/ActionWidget.h index 059e112..6ed19e0 100644 --- a/params/ActionWidget.h +++ b/params/ActionWidget.h @@ -1,6 +1,8 @@ #ifndef ACTIONWIDGET_H #define ACTIONWIDGET_H +#include "fixC11.h" + #include class ActionWidget : public QWidget { diff --git a/params/EditFields.h b/params/EditFields.h index dfeaa5f..d3a383e 100644 --- a/params/EditFields.h +++ b/params/EditFields.h @@ -1,6 +1,8 @@ #ifndef EDITFIELDS_H #define EDITFIELDS_H +#include "fixC11.h" + #include #include #include diff --git a/params/ElementParamWidget.cpp b/params/ElementParamWidget.cpp index c3fa772..d1c624e 100644 --- a/params/ElementParamWidget.cpp +++ b/params/ElementParamWidget.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "ElementParamWidget.h" #include "../mapview/model/MapModelElement.h" diff --git a/params/ElementParamWidget.h b/params/ElementParamWidget.h index aa8fe4b..cf0e49c 100644 --- a/params/ElementParamWidget.h +++ b/params/ElementParamWidget.h @@ -1,6 +1,8 @@ #ifndef PARAMWIDGET_H #define PARAMWIDGET_H +#include "fixC11.h" + #include #include "../mapview/model/MapModelElement.h" diff --git a/params/LayerParamWidget.cpp b/params/LayerParamWidget.cpp index 0806fb8..d255901 100644 --- a/params/LayerParamWidget.cpp +++ b/params/LayerParamWidget.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "LayerParamWidget.h" #include diff --git a/params/LayerParamWidget.h b/params/LayerParamWidget.h index 214bb00..53dc266 100644 --- a/params/LayerParamWidget.h +++ b/params/LayerParamWidget.h @@ -1,6 +1,8 @@ #ifndef LAYERPARAMWIDGET_H #define LAYERPARAMWIDGET_H +#include "fixC11.h" + #include class MapLayer; diff --git a/params/LayerTree.cpp b/params/LayerTree.cpp index df6ede8..7b117db 100644 --- a/params/LayerTree.cpp +++ b/params/LayerTree.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "LayerTree.h" #include diff --git a/params/LayerTree.h b/params/LayerTree.h index 0044940..c8af327 100644 --- a/params/LayerTree.h +++ b/params/LayerTree.h @@ -1,6 +1,8 @@ #ifndef LAYERTREE_H #define LAYERTREE_H +#include "fixC11.h" + #include class QTreeView; diff --git a/params/MetaEditModel.cpp b/params/MetaEditModel.cpp index 0667c9c..20d568b 100644 --- a/params/MetaEditModel.cpp +++ b/params/MetaEditModel.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "MetaEditModel.h" diff --git a/params/MetaEditModel.h b/params/MetaEditModel.h index 22f9fb1..5cae633 100644 --- a/params/MetaEditModel.h +++ b/params/MetaEditModel.h @@ -1,6 +1,8 @@ #ifndef METAEDITMODEL_H #define METAEDITMODEL_H +#include "fixC11.h" + #include #include diff --git a/params/MetaEditWidget.cpp b/params/MetaEditWidget.cpp index a574113..bd478d0 100644 --- a/params/MetaEditWidget.cpp +++ b/params/MetaEditWidget.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "MetaEditWidget.h" #include "MetaEditModel.h" diff --git a/params/MetaEditWidget.h b/params/MetaEditWidget.h index 6e4d6ec..e4af586 100644 --- a/params/MetaEditWidget.h +++ b/params/MetaEditWidget.h @@ -1,9 +1,13 @@ #ifndef METAEDITWIDGET_H #define METAEDITWIDGET_H +#include "fixC11.h" + #include #include +#include "../fixC11.h" + class MetaEditModel; class QTableView; diff --git a/params/StairBuilder.h b/params/StairBuilder.h index 862eddc..a529cb7 100644 --- a/params/StairBuilder.h +++ b/params/StairBuilder.h @@ -1,6 +1,8 @@ #ifndef STAIRBUILDER_H #define STAIRBUILDER_H +#include "fixC11.h" + #include class StairBuilder : public QWidget @@ -14,4 +16,4 @@ signals: public slots: }; -#endif // STAIRBUILDER_H \ No newline at end of file +#endif // STAIRBUILDER_H diff --git a/params/ToolBox.cpp b/params/ToolBox.cpp index 78f2d31..bed5d01 100644 --- a/params/ToolBox.cpp +++ b/params/ToolBox.cpp @@ -1,3 +1,5 @@ +#include "../fixC11.h" + #include "ToolBoxWidget.h" #include diff --git a/params/ToolBoxWidget.h b/params/ToolBoxWidget.h index 59014d4..ef81aa4 100644 --- a/params/ToolBoxWidget.h +++ b/params/ToolBoxWidget.h @@ -1,6 +1,8 @@ #ifndef TOOLBOX_H #define TOOLBOX_H +#include "fixC11.h" + #include class MapLayer; diff --git a/tree/MapTreeModel.h b/tree/MapTreeModel.h index 9ff442a..bc8a6af 100644 --- a/tree/MapTreeModel.h +++ b/tree/MapTreeModel.h @@ -1,6 +1,8 @@ #ifndef MAPTREE_H #define MAPTREE_H +#include "../fixC11.h" + #include #include "../mapview/model/MapModel.h"