initial commit
This commit is contained in:
53
mapview/model/MMFloorOutlinePolygon.h
Normal file
53
mapview/model/MMFloorOutlinePolygon.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef MAPELEMENTFLOORGROUND_H
|
||||
#define MAPELEMENTFLOORGROUND_H
|
||||
|
||||
#include "IHasName.h"
|
||||
#include "MapModelElement.h"
|
||||
|
||||
#include "../elements/MV2DElementFloorOutlinePolygon.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
|
||||
/**
|
||||
* describes one polygon within a floor's outline
|
||||
*/
|
||||
class MMFloorOutlinePolygon : public MapModelElement, public IHasName {
|
||||
|
||||
private:
|
||||
|
||||
Floorplan::Floor* mf;
|
||||
Floorplan::FloorOutlinePolygon* fo;
|
||||
MV2DElementFloorOutlinePolygon mv2d;
|
||||
|
||||
public:
|
||||
|
||||
/** ctor */
|
||||
MMFloorOutlinePolygon(MapLayer* parent, Floorplan::Floor* mf, Floorplan::FloorOutlinePolygon* fo) : MapModelElement(parent), mf(mf), fo(fo), mv2d(*fo) {
|
||||
;
|
||||
}
|
||||
|
||||
Floorplan::FloorOutlinePolygon* getPolygon() {return fo;}
|
||||
|
||||
Floorplan::OutlineMethod getMethod() const {return fo->method;}
|
||||
void setMethod(const Floorplan::OutlineMethod m) {this->fo->method = m;}
|
||||
|
||||
void setName(const std::string& name) override {fo->name = name;}
|
||||
const std::string& getName() const override {return fo->name;}
|
||||
|
||||
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
||||
|
||||
void deleteMe() const override {
|
||||
|
||||
// delete from the parent
|
||||
parent->removeElement(this);
|
||||
|
||||
// delete from the underlying model
|
||||
mf->outline.erase(std::remove(mf->outline.begin(), mf->outline.end(), fo), mf->outline.end());
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // MAPELEMENTFLOORGROUND_H
|
||||
Reference in New Issue
Block a user