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

59 lines
1.3 KiB
C++

#ifndef MMFLOOROUTLINE_H
#define MMFLOOROUTLINE_H
#include "MapLayer.h"
#include "MMFloorOutlinePolygon.h"
#include "../3D/MV3DElementFloorOutline.h"
#include <Indoor/floorplan/v2/Floorplan.h>
/**
* layer containing all elements describing a floor's outline
*/
class MMFloorOutline : public MapLayer, public MapModelElement {
private:
/** the underlying model */
Floorplan::Floor* floor;
MV3DElementFloorOutline mv3d;
public:
/** ctor with the underlying model */
MMFloorOutline(MapLayer* parent, Floorplan::Floor* floor) :
MapLayer(parent, MapLayerType::FLOOR_GROUND), MapModelElement(parent), floor(floor), mv3d(floor, &floor->outline) {
// the outline
for (Floorplan::FloorOutlinePolygon* poly : floor->outline) {
elements.push_back(new MMFloorOutlinePolygon(this, floor, poly));
}
}
MV3DElement* getMV3D() const override {return (MV3DElement*) &mv3d;}
/** get the corresponding floor from the underlying model */
Floorplan::Floor* getFloor() {return floor;}
//TODO: check
void create(Floorplan::FloorOutlinePolygon* poly) {
// add to underlying model
floor->outline.push_back(poly);
// add to myself as element
elements.push_back(new MMFloorOutlinePolygon(this, floor, poly));
}
std::string getLayerName() const override {return "outline";}
};
#endif // MMFLOOROUTLINE_H