adjusted some models due to indoor changes
This commit is contained in:
@@ -7,11 +7,24 @@
|
||||
#include "MapViewElementHelper.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 {
|
||||
|
||||
private:
|
||||
|
||||
bool sel = false;
|
||||
Floorplan::IndoorMap* map;
|
||||
Floorplan::Floor* floor;
|
||||
Floorplan::Stair* stair;
|
||||
//int selPart = -1;
|
||||
@@ -19,8 +32,8 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
/** ctor with the AP to render/edit */
|
||||
MV2DElementStair(Floorplan::Floor* floor, Floorplan::Stair* stair) : floor(floor), stair(stair) {;}
|
||||
/** ctor with the stair to render/edit */
|
||||
MV2DElementStair(Floorplan::IndoorMap* map, Floorplan::Floor* floor, Floorplan::Stair* stair) : map(map), floor(floor), stair(stair) {;}
|
||||
|
||||
|
||||
/** get the element's 3D bounding box */
|
||||
@@ -116,7 +129,8 @@ public:
|
||||
|
||||
// LINT disconnected end
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user