Change UNQUEUED to Unqueued to keep convensions
This commit is contained in:
parent
63a58ce1ad
commit
1a8cf3b029
3 changed files with 10 additions and 6 deletions
|
@ -106,7 +106,11 @@ bool build_tree(PointCloud &nodes, Builder &builder)
|
||||||
mergenode.right = closest_node_id;
|
mergenode.right = closest_node_id;
|
||||||
size_t new_idx = nodes.insert_junction(mergenode);
|
size_t new_idx = nodes.insert_junction(mergenode);
|
||||||
ptsqueue.push(new_idx);
|
ptsqueue.push(new_idx);
|
||||||
|
size_t qid = nodes.get_queue_idx(closest_node_id);
|
||||||
|
|
||||||
|
if (qid != PointCloud::Unqueued)
|
||||||
ptsqueue.remove(nodes.get_queue_idx(closest_node_id));
|
ptsqueue.remove(nodes.get_queue_idx(closest_node_id));
|
||||||
|
|
||||||
nodes.mark_unreachable(closest_node_id);
|
nodes.mark_unreachable(closest_node_id);
|
||||||
}
|
}
|
||||||
} else if (closest_node.pos.z() < node.pos.z() &&
|
} else if (closest_node.pos.z() < node.pos.z() &&
|
||||||
|
|
|
@ -140,7 +140,7 @@ PointCloud::PointCloud(std::vector<Node> meshpts,
|
||||||
, LEAFS_BEGIN{MESHPTS_BEGIN + m_meshpoints.size()}
|
, LEAFS_BEGIN{MESHPTS_BEGIN + m_meshpoints.size()}
|
||||||
, JUNCTIONS_BEGIN{LEAFS_BEGIN + m_leafs.size()}
|
, JUNCTIONS_BEGIN{LEAFS_BEGIN + m_leafs.size()}
|
||||||
, m_searchable_indices(JUNCTIONS_BEGIN + m_junctions.size(), true)
|
, m_searchable_indices(JUNCTIONS_BEGIN + m_junctions.size(), true)
|
||||||
, m_queue_indices(JUNCTIONS_BEGIN + m_junctions.size(), UNQUEUED)
|
, m_queue_indices(JUNCTIONS_BEGIN + m_junctions.size(), Unqueued)
|
||||||
, m_reachable_cnt{JUNCTIONS_BEGIN + m_junctions.size()}
|
, m_reachable_cnt{JUNCTIONS_BEGIN + m_junctions.size()}
|
||||||
, m_ktree{CoordFn{this}, LEAFS_BEGIN} // Only for bed and mesh points
|
, m_ktree{CoordFn{this}, LEAFS_BEGIN} // Only for bed and mesh points
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,8 +67,6 @@ private:
|
||||||
return dot_sq < D.squaredNorm() * cos2bridge_slope;
|
return dot_sq < D.squaredNorm() * cos2bridge_slope;
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr auto UNQUEUED = size_t(-1);
|
|
||||||
|
|
||||||
template<class PC>
|
template<class PC>
|
||||||
static auto *get_node(PC &&pc, size_t id)
|
static auto *get_node(PC &&pc, size_t id)
|
||||||
{
|
{
|
||||||
|
@ -87,6 +85,8 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static constexpr auto Unqueued = size_t(-1);
|
||||||
|
|
||||||
struct ZCompareFn
|
struct ZCompareFn
|
||||||
{
|
{
|
||||||
const PointCloud *self;
|
const PointCloud *self;
|
||||||
|
@ -155,7 +155,7 @@ public:
|
||||||
m_junctions.emplace_back(p);
|
m_junctions.emplace_back(p);
|
||||||
m_junctions.back().id = int(new_id);
|
m_junctions.back().id = int(new_id);
|
||||||
m_searchable_indices.emplace_back(true);
|
m_searchable_indices.emplace_back(true);
|
||||||
m_queue_indices.emplace_back(UNQUEUED);
|
m_queue_indices.emplace_back(Unqueued);
|
||||||
++m_reachable_cnt;
|
++m_reachable_cnt;
|
||||||
|
|
||||||
return new_id;
|
return new_id;
|
||||||
|
@ -172,7 +172,7 @@ public:
|
||||||
assert(node_id < m_searchable_indices.size());
|
assert(node_id < m_searchable_indices.size());
|
||||||
|
|
||||||
m_searchable_indices[node_id] = false;
|
m_searchable_indices[node_id] = false;
|
||||||
m_queue_indices[node_id] = UNQUEUED;
|
m_queue_indices[node_id] = Unqueued;
|
||||||
--m_reachable_cnt;
|
--m_reachable_cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue