adjusted some models due to indoor changes
This commit is contained in:
@@ -7,11 +7,24 @@
|
|||||||
#include "MapViewElementHelper.h"
|
#include "MapViewElementHelper.h"
|
||||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||||
|
|
||||||
|
/** is the given stair's end connected to ANY of the floorplan's floors? */
|
||||||
|
static inline bool stairEndConnected(const Floorplan::IndoorMap* map, const Floorplan::Floor* floor, const Floorplan::Stair* stair) {
|
||||||
|
const int stairEnd_cm = std::round( (floor->atHeight + stair->getParts().back().end.z) * 100 );
|
||||||
|
std::vector<int> floorsAtHeight_cm;
|
||||||
|
for (const Floorplan::Floor* f : map->floors) {
|
||||||
|
const int height_cm = std::round(f->atHeight*100);
|
||||||
|
floorsAtHeight_cm.push_back(height_cm);
|
||||||
|
}
|
||||||
|
const bool connected = std::find(floorsAtHeight_cm.begin(), floorsAtHeight_cm.end(), stairEnd_cm) != floorsAtHeight_cm.end();
|
||||||
|
return connected;
|
||||||
|
}
|
||||||
|
|
||||||
class MV2DElementStair : public MV2DElement, public HasMoveableNodes {
|
class MV2DElementStair : public MV2DElement, public HasMoveableNodes {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool sel = false;
|
bool sel = false;
|
||||||
|
Floorplan::IndoorMap* map;
|
||||||
Floorplan::Floor* floor;
|
Floorplan::Floor* floor;
|
||||||
Floorplan::Stair* stair;
|
Floorplan::Stair* stair;
|
||||||
//int selPart = -1;
|
//int selPart = -1;
|
||||||
@@ -19,8 +32,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** ctor with the AP to render/edit */
|
/** ctor with the stair to render/edit */
|
||||||
MV2DElementStair(Floorplan::Floor* floor, Floorplan::Stair* stair) : floor(floor), stair(stair) {;}
|
MV2DElementStair(Floorplan::IndoorMap* map, Floorplan::Floor* floor, Floorplan::Stair* stair) : map(map), floor(floor), stair(stair) {;}
|
||||||
|
|
||||||
|
|
||||||
/** get the element's 3D bounding box */
|
/** get the element's 3D bounding box */
|
||||||
@@ -116,7 +129,8 @@ public:
|
|||||||
|
|
||||||
// LINT disconnected end
|
// LINT disconnected end
|
||||||
if (i == (int) parts.size() - 1) {
|
if (i == (int) parts.size() - 1) {
|
||||||
if (quad.p3.z != floor->getEndingZ()) {
|
//if (quad.p3.z != floor->getEndingZ()) {
|
||||||
|
if (!stairEndConnected(map, floor, stair)) {
|
||||||
p.drawLine(quad.p3, quad.p4);
|
p.drawLine(quad.p3, quad.p4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class GridModel {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int gridSize_cm = 30; // TODO
|
int gridSize_cm = 20; // TODO
|
||||||
|
|
||||||
Grid<MyNode> grid;
|
Grid<MyNode> grid;
|
||||||
Floorplan::IndoorMap* im;
|
Floorplan::IndoorMap* im;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
new MMFloorBeacons(this, floor);
|
new MMFloorBeacons(this, floor);
|
||||||
new MMFloorFingerprints(this, floor);
|
new MMFloorFingerprints(this, floor);
|
||||||
new MMFloorPOIs(this, floor);
|
new MMFloorPOIs(this, floor);
|
||||||
new MMFloorStairs(this, floor);
|
new MMFloorStairs(this, map, floor);
|
||||||
new MMFloorElevators(this, floor);
|
new MMFloorElevators(this, floor);
|
||||||
new MMFloorGroundTruthPoints(this, floor);
|
new MMFloorGroundTruthPoints(this, floor);
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/** ctor with the underlying model */
|
/** ctor with the underlying model */
|
||||||
MMFloorStair(MapLayer* parent, Floorplan::Floor* floor, Floorplan::StairFreeform* stair) :
|
MMFloorStair(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor, Floorplan::StairFreeform* stair) :
|
||||||
MapModelElement(parent), floor(floor), stair(stair), mv2d(floor, stair), mv3d(floor, stair) {
|
MapModelElement(parent), floor(floor), stair(stair), mv2d(map, floor, stair), mv3d(floor, stair) {
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,18 @@ class MMFloorStairs : public MapLayer {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Floorplan::IndoorMap* map;
|
||||||
Floorplan::Floor* floor;
|
Floorplan::Floor* floor;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** ctor with the underlying model */
|
/** ctor with the underlying model */
|
||||||
MMFloorStairs(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_STAIRS), floor(floor) {
|
MMFloorStairs(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_STAIRS), map(map), floor(floor) {
|
||||||
|
|
||||||
// add all floors
|
// add all floors
|
||||||
for (Floorplan::Stair* stair : floor->stairs) {
|
for (Floorplan::Stair* stair : floor->stairs) {
|
||||||
if (dynamic_cast<Floorplan::StairFreeform*>(stair)) {
|
if (dynamic_cast<Floorplan::StairFreeform*>(stair)) {
|
||||||
addElement( new MMFloorStair(this, floor, (Floorplan::StairFreeform*)stair) );
|
addElement( new MMFloorStair(this, map, floor, (Floorplan::StairFreeform*)stair) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ public:
|
|||||||
floor->stairs.push_back(stair);
|
floor->stairs.push_back(stair);
|
||||||
|
|
||||||
// add to myself as element
|
// add to myself as element
|
||||||
MMFloorStair* mm = new MMFloorStair(this, floor, stair);
|
MMFloorStair* mm = new MMFloorStair(this, map, floor, stair);
|
||||||
addElement(mm);
|
addElement(mm);
|
||||||
return mm;
|
return mm;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user