72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
/*
|
||
* © 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 MMFLOORUNDERLAY_H
|
||
#define MMFLOORUNDERLAY_H
|
||
|
||
#include "MMFloorUnderlayImage.h"
|
||
|
||
#include "../2D/MV2DElementFloorUnderlay.h"
|
||
|
||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||
|
||
/**
|
||
* add an external file as underlay (to copy it onto the map)
|
||
*/
|
||
class MMFloorUnderlays : public MapLayer {
|
||
|
||
private:
|
||
|
||
Floorplan::Floor* floor;
|
||
|
||
public:
|
||
|
||
/** ctor */
|
||
MMFloorUnderlays(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_UNDERLAYS), floor(floor) {
|
||
|
||
// the underlays
|
||
for (Floorplan::UnderlayImage* img : floor->underlays) {
|
||
addElement(new MMFloorUnderlayImage(this, floor, img));
|
||
}
|
||
|
||
}
|
||
|
||
bool isVisible() const override {
|
||
return floor->underlays.enabled;
|
||
}
|
||
|
||
void setVisible(const bool visible) override {
|
||
this-> floor->underlays.enabled = visible;
|
||
onVisibilityChanged(visible);
|
||
}
|
||
|
||
//TODO: check
|
||
void createImage(const Point2 center) {
|
||
|
||
Floorplan::UnderlayImage* elem = new Floorplan::UnderlayImage();
|
||
|
||
// add to underlying model
|
||
floor->underlays.push_back(elem);
|
||
|
||
// add to myself as element
|
||
MMFloorUnderlayImage* img = new MMFloorUnderlayImage(this, floor, elem);
|
||
addElement(img);
|
||
img->setAnchor(center);
|
||
img->setScale(0.1, 0.1);
|
||
|
||
}
|
||
|
||
virtual std::string getLayerName() const override {return "underlay";}
|
||
|
||
};
|
||
|
||
|
||
#endif // MMFLOORUNDERLAY_H
|