minor changes to grid walking
This commit is contained in:
12
grid/Grid.h
12
grid/Grid.h
@@ -213,6 +213,14 @@ public:
|
||||
return GridNodeBBox(node, gridSize_cm);
|
||||
}
|
||||
|
||||
/** is this node part of a non-plain stair/escalator */
|
||||
bool isPlain(const T& n1) const {
|
||||
for (const T& n2 : neighbors(n1)) {
|
||||
if (n2.z_cm != n1.z_cm) {return false;}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* get an UID for the given point.
|
||||
* this works only for aligned points.
|
||||
@@ -469,11 +477,11 @@ public:
|
||||
|
||||
|
||||
|
||||
NeighborForEach neighbors(const int idx) {
|
||||
NeighborForEach neighbors(const int idx) const {
|
||||
return neighbors(nodes[idx]);
|
||||
}
|
||||
|
||||
NeighborForEach neighbors(const T& node) {
|
||||
NeighborForEach neighbors(const T& node) const {
|
||||
return NeighborForEach(*this, node._idx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user