many changes :P
This commit is contained in:
72
mapview/3D/MapView3D.h
Normal file
72
mapview/3D/MapView3D.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user