Skip to content

Commit dc9b4fc

Browse files
committed
review changes
1 parent d36de4c commit dc9b4fc

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

src/geode/geometry/nn_search.cpp

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ namespace geode
6060
return cloud_.kdtree_get_point_count();
6161
}
6262

63-
std::vector< index_t > radius_neighbors(
64-
const Point< dimension >& point,
65-
const double threshold_distance ) const
63+
std::vector< index_t > neighbors(
64+
const Point< dimension >& point, double threshold_distance ) const
6665
{
6766
std::vector< nanoflann::ResultItem< index_t, double > > results;
6867
nanoflann::SearchParameters params;
@@ -78,7 +77,7 @@ namespace geode
7877
return indices;
7978
}
8079

81-
std::vector< index_t > frame_neighbors( const Point< dimension >& point,
80+
std::vector< index_t > neighbors( const Point< dimension >& point,
8281
const Frame< dimension >& epsilons_frame ) const
8382
{
8483
std::vector< nanoflann::ResultItem< index_t, double > > results;
@@ -109,7 +108,7 @@ namespace geode
109108
return indices;
110109
}
111110

112-
std::vector< index_t > neighbors(
111+
std::vector< index_t > nearest_vertices(
113112
const Point< dimension >& point, const index_t nb_neighbors ) const
114113
{
115114
std::vector< index_t > results( nb_neighbors );
@@ -138,7 +137,7 @@ namespace geode
138137
return;
139138
}
140139
const auto neighbor_vertices =
141-
vertices_around( point( point_id ), epsilon );
140+
neighbors( point( point_id ), epsilon );
142141
std::lock_guard< std::mutex > lock( mutex );
143142
if( mapping[point_id] != NO_ID )
144143
{
@@ -187,18 +186,6 @@ namespace geode
187186
}
188187

189188
private:
190-
std::vector< index_t > vertices_around(
191-
const Point< dimension >& point, double epsilon ) const
192-
{
193-
return radius_neighbors( point, epsilon );
194-
}
195-
196-
std::vector< index_t > vertices_around( const Point< dimension >& point,
197-
const Frame< dimension >& epsilon ) const
198-
{
199-
return frame_neighbors( point, epsilon );
200-
}
201-
202189
std::array< double, dimension > copy(
203190
const Point< dimension >& point ) const
204191
{
@@ -275,29 +262,29 @@ namespace geode
275262
index_t NNSearch< dimension >::closest_neighbor(
276263
const Point< dimension >& point ) const
277264
{
278-
return impl_->neighbors( point, 1 ).front();
265+
return impl_->nearest_vertices( point, 1 ).front();
279266
}
280267

281268
template < index_t dimension >
282269
std::vector< index_t > NNSearch< dimension >::radius_neighbors(
283270
const Point< dimension >& point, double threshold_distance ) const
284271
{
285-
return impl_->radius_neighbors( point, threshold_distance );
272+
return impl_->neighbors( point, threshold_distance );
286273
}
287274

288275
template < index_t dimension >
289276
std::vector< index_t > NNSearch< dimension >::frame_neighbors(
290277
const Point< dimension >& point,
291278
const Frame< dimension >& epsilons_frame ) const
292279
{
293-
return impl_->frame_neighbors( point, epsilons_frame );
280+
return impl_->neighbors( point, epsilons_frame );
294281
}
295282

296283
template < index_t dimension >
297284
std::vector< index_t > NNSearch< dimension >::neighbors(
298285
const Point< dimension >& point, index_t nb_neighbors ) const
299286
{
300-
return impl_->neighbors( point, nb_neighbors );
287+
return impl_->nearest_vertices( point, nb_neighbors );
301288
}
302289

303290
template < geode::index_t dimension >

0 commit comments

Comments
 (0)