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/MMFloorBeacon.h
2018-10-25 12:19:36 +02:00

93 lines
2.5 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* © 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 MAPVIEWELEMENTIBEACON_H
#define MAPVIEWELEMENTIBEACON_H
#include "MapModelElement.h"
#include "IHasParams.h"
#include "../2D/MV2DElementBeacon.h"
#include <Indoor/floorplan/v2/Floorplan.h>
class MMFloorBeacon : public MapModelElement, public IHasParams {
private:
Floorplan::Floor* floor;
Floorplan::Beacon* b;
MV2DElementBeacon mv2d;
public:
MMFloorBeacon(MapLayer* parent, Floorplan::Floor* floor, Floorplan::Beacon* b) : MapModelElement(parent), floor(floor), b(b), mv2d(b) {
;
}
virtual int getNumParams() const override {
return 9;
}
virtual Param getParamDesc(const int idx) const override {
switch(idx) {
case 0: return Param("name", ParamType::STRING);
case 1: return Param("Position", ParamType::POINT3);
case 2: return Param("MAC", ParamType::STRING);
case 3: return Param("major", ParamType::STRING);
case 4: return Param("minor", ParamType::STRING);
case 5: return Param("UUDI", ParamType::STRING);
case 6: return Param("TXP", ParamType::FLOAT);
case 7: return Param("EXP", ParamType::FLOAT);
case 8: return Param("WAF", ParamType::FLOAT);
}
throw 1;
}
virtual ParamValue getParamValue(const int idx) const override {
switch(idx) {
case 0: return b->name;
case 1: return b->pos;
case 2: return b->mac;
case 3: return b->major;
case 4: return b->minor;
case 5: return b->uuid;
case 6: return b->model.txp;
case 7: return b->model.exp;
case 8: return b->model.waf;
}
throw 1;
}
virtual void setParamValue(const int idx, const ParamValue& val) override {
switch(idx) {
case 0: b->name = val.toString(); break;
case 1: b->pos = val.toPoint3(); break;
case 2: b->mac = val.toString(); break;
case 3: b->major = val.toString(); break;
case 4: b->minor = val.toString(); break;
case 5: b->uuid = val.toString(); break;
case 6: b->uuid = val.toFloat(); break;
case 7: b->uuid = val.toFloat(); break;
case 8: b->uuid = val.toFloat(); break;
}
}
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
void deleteMe() const override {
parent->removeElement(this);
floor->beacons.erase(std::remove(floor->beacons.begin(), floor->beacons.end(), b), floor->beacons.end());
}
};
#endif // MAPVIEWELEMENTIBEACON_H