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

68 lines
1.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 MMREGISTRATION_H
#define MMREGISTRATION_H
#include "MMRegistrationPoint.h"
#include <Indoor/floorplan/v2/Floorplan.h>
/**
* layer that contains registriation points: earth <-> map
*/
class MMRegistration : public MapLayer {
private:
Floorplan::IndoorMap* map;
public:
/** ctor */
MMRegistration(MapLayer* parent, Floorplan::IndoorMap* map) : MapLayer(parent, MapLayerType::REGISTRATION), map(map) {
// the registered points
for (Floorplan::EarthPosMapPos* reg : map->earthReg.correspondences) {
addElement(new MMRegistrationPoint(this, map, reg));
}
}
bool isVisible() const override {
return map->earthReg.enabled;
}
void setVisible(const bool visible) override {
map->earthReg.enabled = visible;
onVisibilityChanged(visible);
}
//TODO: check
MMRegistrationPoint* create(Floorplan::EarthPosMapPos* reg) {
// add to underlying model
map->earthReg.correspondences.push_back(reg);
// add to myself as element
MMRegistrationPoint* mm = new MMRegistrationPoint(this, map, reg);
addElement(mm);
return mm;
}
virtual std::string getLayerName() const override {return "registration";}
};
#endif // MMREGISTRATION_H