many changes :P

This commit is contained in:
kazu
2016-06-06 22:08:53 +02:00
parent db6b479d86
commit 6243165084
56 changed files with 4399 additions and 245 deletions

View File

@@ -0,0 +1,38 @@
#ifndef GRIDMODEL_H
#define GRIDMODEL_H
#include <Indoor/floorplan/v2/Floorplan.h>
#include <Indoor/grid/Grid.h>
#include <Indoor/grid/factory/v2/GridFactory.h>
#include "MyNode.h"
/**
* used for 3D grid rendering
*/
class GridModel {
private:
int gridSize_cm = 40;
Grid<MyNode> grid;
Floorplan::IndoorMap* im;
public:
GridModel() : grid(gridSize_cm) {
;
}
Grid<MyNode>* getGrid() {return &grid;}
void rebuild(Floorplan::IndoorMap* im) {
GridFactory<MyNode> fac(grid);
fac.build(im);
int i = 0;(void) i;
}
};
#endif // GRIDMODEL_H

View File

@@ -0,0 +1,40 @@
#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

10
mapview/3DGrid/MyNode.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MYNODE_H
#define MYNODE_H
#include <Indoor/grid/Grid.h>
struct MyNode : public GridNode, public GridPoint {
MyNode(float x, float y, float z) : GridPoint(x,y,z) {;}
};
#endif // MYNODE_H