openGL work and other parts
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user