Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/geode/geometry/nn_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@
nn_tree_.buildIndex();
}

const Point< dimension >& point( const index_t index ) const

Check warning on line 54 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:54:9 [modernize-use-nodiscard]

function 'point' should be marked [[nodiscard]]
{
return cloud_.points.at( index );
}

index_t nb_points() const

Check warning on line 59 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:59:9 [modernize-use-nodiscard]

function 'nb_points' should be marked [[nodiscard]]
{
return cloud_.kdtree_get_point_count();
}

std::vector< index_t > neighbors(

Check warning on line 64 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:64:9 [modernize-use-nodiscard]

function 'neighbors' should be marked [[nodiscard]]
const Point< dimension >& point, double threshold_distance ) const
{
std::vector< nanoflann::ResultItem< index_t, double > > results;
Expand All @@ -78,7 +78,7 @@
return indices;
}

std::vector< index_t > neighbors( const Point< dimension >& point,

Check warning on line 81 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:81:9 [modernize-use-nodiscard]

function 'neighbors' should be marked [[nodiscard]]
const Frame< dimension >& epsilons_frame ) const
{
std::vector< nanoflann::ResultItem< index_t, double > > results;
Expand Down Expand Up @@ -114,19 +114,19 @@
return indices;
}

std::vector< index_t > nearest_vertices(

Check warning on line 117 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:117:9 [modernize-use-nodiscard]

function 'nearest_vertices' should be marked [[nodiscard]]
const Point< dimension >& point, const index_t nb_neighbors ) const
{
std::vector< index_t > results( nb_neighbors );
std::vector< double > distances( nb_neighbors );
const auto new_nb_neighbors = nn_tree_.knnSearch(
&copy( point )[0], nb_neighbors, &results[0], &distances[0] );

Check warning on line 123 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:123:63 [readability-container-data-pointer]

'data' should be used for accessing the data pointer instead of taking the address of the 0-th element

Check warning on line 123 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:123:50 [readability-container-data-pointer]

'data' should be used for accessing the data pointer instead of taking the address of the 0-th element
results.resize( new_nb_neighbors );
return results;
}

template < typename EpsilonType >
typename geode::NNSearch< dimension >::ColocatedInfo

Check warning on line 129 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:129:9 [modernize-use-nodiscard]

function 'colocated_index_mapping<geode::Frame<3>>' should be marked [[nodiscard]]

Check warning on line 129 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:129:9 [modernize-use-nodiscard]

function 'colocated_index_mapping<geode::Frame<2>>' should be marked [[nodiscard]]

Check warning on line 129 in src/geode/geometry/nn_search.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geometry/nn_search.cpp:129:9 [modernize-use-nodiscard]

function 'colocated_index_mapping<double>' should be marked [[nodiscard]]
colocated_index_mapping(
const geode::NNSearch< dimension >& nn_search,
const EpsilonType& epsilon ) const
Expand Down Expand Up @@ -160,6 +160,12 @@
index_t nb_unique_points{ 0 };
for( const auto point_id : Range{ nb_points } )
{
OpenGeodeGeometryException::check_exception(
mapping[point_id] != NO_ID, point( point_id ),
OpenGeodeException::TYPE::data,
"[NNSearch::colocated_index_mapping] Issue with a point "
"coordinate for point id ",
point_id, ": ", point( point_id ).string() );
if( mapping[point_id] == point_id )
{
nb_unique_points++;
Expand Down
Loading