#ifndef MV3DELEMENTFLOOROUTLINEPOLYGON_H #define MV3DELEMENTFLOOROUTLINEPOLYGON_H #include #include "misc/Cube.h" #include "MV3DElement.h" class MV3DElementFloorOutlinePolygon : public MV3DElement { Floorplan::Floor* f; Floorplan::FloorOutlinePolygon* poly; public: /** ctor */ MV3DElementFloorOutlinePolygon(Floorplan::Floor* f, Floorplan::FloorOutlinePolygon* poly) : f(f), poly(poly) { ; } protected: /** repaint me */ void paintGL() override { glDisable(GL_CULL_FACE); switch (poly->method) { case Floorplan::OutlineMethod::ADD: glColor3f(1,1,1); break; case Floorplan::OutlineMethod::REMOVE: glColor3f(0.2, 0.2, 0.2); 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(); glEnable(GL_CULL_FACE); } }; #endif // MV3DELEMENTFLOOROUTLINEPOLYGON_H