added earth-registration support
This commit is contained in:
48
mapview/model/MMRegistration.h
Normal file
48
mapview/model/MMRegistration.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//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
|
||||
Reference in New Issue
Block a user