fixed some issues

This commit is contained in:
2017-03-20 09:07:18 +01:00
parent 62d4a278e9
commit 7ac8e7bac2
7 changed files with 146 additions and 69 deletions

View File

@@ -1,53 +1,60 @@
#ifndef MV3DELEMENTFLOOROUTLINEPOLYGON_H
#define MV3DELEMENTFLOOROUTLINEPOLYGON_H
#include <Indoor/floorplan/v2/Floorplan.h>
//#include <Indoor/floorplan/v2/Floorplan.h>
#include "misc/Cube.h"
#include "MV3DElement.h"
//#include "misc/Cube.h"
//#include "MV3DElement.h"
class MV3DElementFloorOutlinePolygon : public MV3DElement {
//class MV3DElementFloorOutlinePolygon : public MV3DElement {
Floorplan::Floor* f;
Floorplan::FloorOutlinePolygon* poly;
// Floorplan::Floor* f;
// Floorplan::FloorOutlinePolygon* poly;
public:
//public:
/** ctor */
MV3DElementFloorOutlinePolygon(Floorplan::Floor* f, Floorplan::FloorOutlinePolygon* poly) : f(f), poly(poly) {
;
}
// /** ctor */
// MV3DElementFloorOutlinePolygon(Floorplan::Floor* f, Floorplan::FloorOutlinePolygon* poly) : f(f), poly(poly) {
// ;
// }
protected:
//protected:
/** repaint me */
void paintGL() override {
// /** repaint me */
// void paintGL() override {
glDisable(GL_CULL_FACE);
// throw "deprecated!!!";
switch (poly->method) {
case Floorplan::OutlineMethod::ADD:
glColor3f(1,1,1);
break;
case Floorplan::OutlineMethod::REMOVE:
glColor3f(0.3, 0.3, 0.3);
break;
}
// glDisable(GL_CULL_FACE);
//// switch (poly->method) {
//// case Floorplan::OutlineMethod::ADD:
//// glColor3f(1,1,1);
//// break;
//// case Floorplan::OutlineMethod::REMOVE:
//// glColor3f(0.3, 0.3, 0.3);
//// break;
//// }
glBegin(GL_POLYGON);
glNormal3f(0,1,0);
for (Point2 p2 : poly->poly.points) {
Point3 p3(p2.x, p2.y, f->atHeight);
glVertex3f(p3.x, p3.z, p3.y);
}
glEnd();
// if (poly->outdoor) {
// glColor3f(0, 0, 0.5);
// } else {
// glColor3f(0.3, 0.3, 0.3);
// }
glEnable(GL_CULL_FACE);
// glBegin(GL_POLYGON);
// glNormal3f(0,1,0);
// for (Point2 p2 : poly->poly.points) {
// Point3 p3(p2.x, p2.y, f->atHeight);
// glVertex3f(p3.x, p3.z, p3.y);
// }
// glEnd();
}
// glEnable(GL_CULL_FACE);
};
// }
//};
#endif // MV3DELEMENTFLOOROUTLINEPOLYGON_H