/* * © Copyright 2014 – Urheberrechtshinweis * Alle Rechte vorbehalten / All Rights Reserved * * Programmcode ist urheberrechtlich geschuetzt. * Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner. * Keine Verwendung ohne explizite Genehmigung. * (vgl. § 106 ff UrhG / § 97 UrhG) */ #ifndef MMFLOORBEACONS_H #define MMFLOORBEACONS_H #include "MapLayer.h" #include "MMFloorBeacon.h" #include /** * layer containing all of the floor's beaconss */ class MMFloorBeacons : public MapLayer { private: Floorplan::Floor* floor; public: /** ctor with the underlying model */ MMFloorBeacons(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_BEACONS), floor(floor) { // add all Beacons for (Floorplan::Beacon* b : floor->beacons) { addElement(new MMFloorBeacon(this, floor, b)); } } bool isVisible() const override { return floor->beacons.enabled; } void setVisible(const bool visible) override { this-> floor->beacons.enabled = visible; onVisibilityChanged(visible); } std::string getLayerName() const override {return "Beacons";} //TODO: check MMFloorBeacon* createBeacon(Floorplan::Beacon* b) { // add to underlying model floor->beacons.push_back(b); // // add to myself as element // addElement(new MMFloorBeacon(this, floor, b)); // add to myself as element MMFloorBeacon* mm = new MMFloorBeacon(this, floor, b); addElement(mm); return mm; } }; #endif // MMFLOORBEACONS_H