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/MMFloorElevators.h
2018-10-25 12:19:36 +02:00

70 lines
1.6 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* © 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 MMFLOORELEVATORS_H
#define MMFLOORELEVATORS_H
#include "MapLayer.h"
#include "MMFloorElevator.h"
#include <Indoor/floorplan/v2/Floorplan.h>
/**
* layer containing one floor's elevators
*/
class MMFloorElevators : public MapLayer {
private:
Floorplan::IndoorMap* map;
Floorplan::Floor* floor;
public:
/** ctor with the underlying model */
MMFloorElevators(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_ELEVATORS), map(map), floor(floor) {
// add all elevators
for (Floorplan::Elevator* elevator : floor->elevators) {
addElement(new MMFloorElevator(this, map, floor, elevator));
}
}
bool isVisible() const override {
return floor->elevators.enabled;
}
void setVisible(const bool visible) override {
this-> floor->elevators.enabled = visible;
onVisibilityChanged(visible);
}
std::string getLayerName() const override {return "Elevators";}
//TODO: check
MMFloorElevator* create(Floorplan::Elevator* elevator) {
// add to underlying model
floor->elevators.push_back(elevator);
// add to myself as element
MMFloorElevator* mm = new MMFloorElevator(this, map, floor, elevator);
addElement(mm);
return mm;
}
};
#endif // MMFLOORELEVATORS_H