many changes :P
This commit is contained in:
46
mapview/model/MMFloorPOIs.h
Normal file
46
mapview/model/MMFloorPOIs.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef MMFLOORPOIS_H
|
||||
#define MMFLOORPOIS_H
|
||||
|
||||
#include "MapLayer.h"
|
||||
#include "MMFloorPOI.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
/**
|
||||
* layer that contains all of one floor's POIs
|
||||
*/
|
||||
class MMFloorPOIs : public MapLayer {
|
||||
|
||||
Floorplan::Floor* floor;
|
||||
|
||||
public:
|
||||
|
||||
/** ctor with the floor */
|
||||
MMFloorPOIs(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_POIS), floor(floor) {
|
||||
|
||||
// the POIs
|
||||
for (Floorplan::POI* poi : floor->pois) {
|
||||
elements.push_back(new MMFloorPOI(this, floor, poi));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** get the corresponding floor from the underlying model */
|
||||
Floorplan::Floor* getFloor() {return floor;}
|
||||
|
||||
//TODO: check
|
||||
void createPOI(Floorplan::POI* poi) {
|
||||
|
||||
// add to underlying model
|
||||
floor->pois.push_back(poi);
|
||||
|
||||
// add to myself as element
|
||||
elements.push_back(new MMFloorPOI(this, floor, poi));
|
||||
|
||||
}
|
||||
|
||||
std::string getLayerName() const override {return "POIs";}
|
||||
|
||||
};
|
||||
|
||||
#endif // MMFLOORPOIS_H
|
||||
Reference in New Issue
Block a user