MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/CompactNSearch / find_neighbors

Method find_neighbors

src/CompactNSearch.cpp:145–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void
146NeighborhoodSearch::find_neighbors()
147{
148 if (!m_initialized)
149 {
150 init();
151 m_initialized = true;
152 }
153
154 // Precompute cell indices.
155 for (PointSet& d : m_point_sets)
156 {
157 if (!d.is_dynamic()) continue;
158 d.m_keys.swap(d.m_old_keys);
159 for (unsigned int i = 0; i < d.n_points(); ++i)
160 d.m_keys[i] = cell_index(d.point(i));
161 }
162
163 std::vector<unsigned int> to_delete;
164 if (m_erase_empty_cells)
165 {
166 to_delete.reserve(m_entries.size());
167 }
168 update_hash_table(to_delete);
169 if (m_erase_empty_cells)
170 {
171 erase_empty_entries(to_delete);
172 }
173 query();
174}
175
176void
177NeighborhoodSearch::erase_empty_entries(std::vector<unsigned int> const& to_delete)

Callers 1

mainFunction · 0.80

Calls 3

is_dynamicMethod · 0.80
n_pointsMethod · 0.80
pointMethod · 0.80

Tested by

no test coverage detected