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/3DGrid/GridRenderer.h
2016-06-06 22:08:53 +02:00

41 lines
566 B
C++

#ifndef GRIDRENDERER_H
#define GRIDRENDERER_H
#include "../3D/MV3DElement.h"
#include "MyNode.h"
#include <Indoor/grid/Grid.h>
class GridRenderer : public MV3DElement {
private:
Grid<MyNode>* grid;
public:
GridRenderer(Grid<MyNode>* grid) : grid(grid) {
;
}
virtual void paintGL() override {
glDisable(GL_LIGHTING);
glColor3f(0,0,0);
glPointSize(0.1f);
glBegin(GL_POINTS);
for (MyNode& n : *grid) {
glVertex3f(n.x_cm/100.0f, n.z_cm/100.0f*5, n.y_cm/100.0f);
}
glEnd();
glEnable(GL_LIGHTING);
}
};
#endif // GRIDRENDERER_H