This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IndoorMap/mapview/model/MMFloorOutlinePolygon.h
2016-05-24 16:55:19 +02:00

54 lines
1.3 KiB
C++

#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