This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IndoorMap/mapview/3D/MapView3D.h
2016-06-06 22:08:53 +02:00

73 lines
1.1 KiB
C++

#ifndef MAPVIEW3D_H
#define MAPVIEW3D_H
#include <QtWidgets>
#include <QtOpenGL>
#include <Indoor/geo/Point3.h>
class MapModel;
class GridModel;
class MapView3D : public QGLWidget {
Q_OBJECT
public:
MapView3D(QWidget* parent = 0);
/** set the underlying data-model */
void setModel(MapModel* mdl) {
this->model = mdl;
update();
}
/** get the underlying data-model */
MapModel* getModel() {return model;}
/** show 3D rendered floorplan */
void showFloorplan();
/** show 3D rendered grid derived from the floorplan */
void showGrid();
private:
/** the underlying data-model */
MapModel* model = nullptr;
GridModel* gridModel = nullptr;
Point3 rot;
Point3 center;
Point3 scale;
struct Mouse {
int btn;
float x;
float y;
} mouse;
struct Viewport {
Point2 size;
} viewport;
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void mousePressEvent(QMouseEvent* e);
void mouseMoveEvent(QMouseEvent* e);
void mouseReleaseEvent(QMouseEvent* e);
void wheelEvent(QWheelEvent* e);
private:
void draw();
};
#endif // MAPVIEW3D_H