41 lines
566 B
C++
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
|