53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#ifndef MMFLOORUNDERLAY_H
|
|
#define MMFLOORUNDERLAY_H
|
|
|
|
#include "MMFloorUnderlayImage.h"
|
|
|
|
#include "../elements/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) {
|
|
elements.push_back(new MMFloorUnderlayImage(this, floor, img));
|
|
}
|
|
|
|
}
|
|
|
|
//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);
|
|
elements.push_back(img);
|
|
img->setAnchor(center);
|
|
img->setScale(0.1, 0.1);
|
|
|
|
}
|
|
|
|
virtual std::string getLayerName() const override {return "underlay";}
|
|
|
|
};
|
|
|
|
|
|
#endif // MMFLOORUNDERLAY_H
|