openGL work and other parts

This commit is contained in:
2016-09-11 12:11:54 +02:00
parent 69dfbe6693
commit d910e88220
43 changed files with 4813 additions and 261 deletions

View File

@@ -6,22 +6,57 @@
#include <QOpenGLShaderProgram>
#include <QBasicTimer>
class Geometry;
#include <Indoor/geo/Point3.h>
#include <Indoor/nav/dijkstra/DijkstraPath.h>
#include "elements/Path.h"
namespace Floorplan {
class IndoorMap;
}
class Renderable;
class Path;
class MapView : public QOpenGLWidget, protected QOpenGLFunctions {
private:
QMatrix4x4 projection;
QOpenGLShaderProgram program;
Geometry* geo;
QMatrix4x4 matProject;
QMatrix4x4 matView;
QVector3D lightPos;
QVector3D eyePos;
QBasicTimer timer;
std::vector<Renderable*> elements;
Path* path;
public:
MapView(QWidget* parent = 0);
/** set the map to display */
void setMap(Floorplan::IndoorMap* map);
/** the position to look at */
void setLookAt(const Point3 pos, const Point3 dir = Point3(-1, -1, 0.1));
/** set the path to disply */
void setPath(const std::vector<Point3>& path);
/** set the path to disply */
template <typename Node> void setPath(const DijkstraPath<Node>& path) {
this->path->set(path);
}
protected:
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;