71 lines
1.8 KiB
C++
71 lines
1.8 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 MMFLOORGROUNDTRUTHPOINTS_H
|
||
#define MMFLOORGROUNDTRUTHPOINTS_H
|
||
|
||
#include "MapLayer.h"
|
||
#include "MMFloorGroundTruthPoint.h"
|
||
|
||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||
|
||
/**
|
||
* layer that contains all of one floor's GroundTruthPoints
|
||
*/
|
||
class MMFloorGroundTruthPoints : public MapLayer {
|
||
|
||
Floorplan::Floor* floor;
|
||
|
||
public:
|
||
|
||
/** ctor with the floor */
|
||
MMFloorGroundTruthPoints(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_GROUND_TRUTH_POINTS), floor(floor) {
|
||
|
||
// the POIs
|
||
for (Floorplan::GroundTruthPoint* gtp : floor->gtpoints) {
|
||
addElement(new MMFloorGroundTruthPoint(this, floor, gtp));
|
||
}
|
||
|
||
}
|
||
|
||
bool isVisible() const override {
|
||
return floor->gtpoints.enabled;
|
||
}
|
||
|
||
void setVisible(const bool visible) override {
|
||
this-> floor->gtpoints.enabled = visible;
|
||
onVisibilityChanged(visible);
|
||
}
|
||
|
||
/** get the corresponding floor from the underlying model */
|
||
Floorplan::Floor* getFloor() {return floor;}
|
||
|
||
//TODO: check
|
||
MMFloorGroundTruthPoint* createGroundTruthPoint(Floorplan::GroundTruthPoint* gtp) {
|
||
|
||
// add to underlying model
|
||
floor->gtpoints.push_back(gtp);
|
||
|
||
// add to myself as element
|
||
//addElement(new MMFloorGroundTruthPoint(this, floor, gtp));
|
||
|
||
// add to myself as element
|
||
MMFloorGroundTruthPoint* mm = new MMFloorGroundTruthPoint(this, floor, gtp);
|
||
addElement(mm);
|
||
return mm;
|
||
|
||
}
|
||
|
||
std::string getLayerName() const override {return "GroundTruthPoints";}
|
||
|
||
};
|
||
|
||
#endif // MMFLOORGROUNDTRUTHPOINTS_H
|