Skip to content

Commit 161f7b7

Browse files
committed
fix(Geometry): review changes.
1 parent 49f7245 commit 161f7b7

File tree

5 files changed

+11
-111
lines changed

5 files changed

+11
-111
lines changed

include/geode/geometry/dynamic_nn_search.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace geode
3737
class DynamicNNSearch
3838
{
3939
OPENGEODE_DISABLE_COPY( DynamicNNSearch );
40-
// OPENGEODE_TEMPLATE_ASSERT_2D_OR_3D( DynamicNNSearch );
4140

4241
public:
4342
explicit DynamicNNSearch( std::vector< Point< dimension > > points );
@@ -47,6 +46,7 @@ namespace geode
4746
index_t nb_points() const;
4847

4948
const Point< dimension >& point( index_t index ) const;
49+
void add_point( const Point< dimension >& point );
5050

5151
/*!
5252
* Get the neighbors closer than a given distance from the given point
@@ -58,8 +58,6 @@ namespace geode
5858
std::vector< index_t > radius_neighbors(
5959
const Point< dimension >& point, double threshold_distance ) const;
6060

61-
void add_point( const Point< dimension >& point );
62-
6361
private:
6462
IMPLEMENTATION_MEMBER( impl_ );
6563
};

src/geode/geometry/dynamic_nn_search.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@
2323

2424
#include <geode/geometry/dynamic_nn_search.hpp>
2525

26-
#include <numeric>
26+
#include <nanoflann.hpp>
2727

2828
#include <absl/algorithm/container.h>
2929

30-
#include <async++.h>
31-
32-
#include <nanoflann.hpp>
33-
3430
#include <geode/basic/logger.hpp>
3531
#include <geode/basic/pimpl_impl.hpp>
3632

@@ -64,8 +60,7 @@ namespace geode
6460
nanoflann::RadiusResultSet< double, index_t > resultSet(
6561
threshold_distance * threshold_distance, results );
6662
dynamic_nn_tree_.findNeighbors( resultSet, &copy( point )[0] );
67-
std::sort(
68-
results.begin(), results.end(), nanoflann::IndexDist_Sorter() );
63+
absl::c_sort( results, nanoflann::IndexDist_Sorter() );
6964
std::vector< index_t > indices;
7065
indices.reserve( results.size() );
7166
for( const auto& result : results )
@@ -93,6 +88,7 @@ namespace geode
9388
}
9489
return result;
9590
}
91+
9692
struct PointCloud
9793
{
9894
std::vector< Point< dimension > > points;
@@ -133,7 +129,7 @@ namespace geode
133129
template < index_t dimension >
134130
DynamicNNSearch< dimension >::DynamicNNSearch(
135131
std::vector< Point< dimension > > points )
136-
: impl_( std::move( points ) )
132+
: impl_{ std::move( points ) }
137133
{
138134
}
139135

tests/geometry/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,33 @@ add_geode_test(
6161
${PROJECT_NAME}::geometry
6262
)
6363
add_geode_test(
64-
SOURCE "test-intersection.cpp"
64+
SOURCE "test-dynamic-nnsearch.cpp"
6565
DEPENDENCIES
6666
${PROJECT_NAME}::basic
6767
${PROJECT_NAME}::geometry
68-
ESSENTIAL
6968
)
7069
add_geode_test(
71-
SOURCE "test-intersection-detection.cpp"
70+
SOURCE "test-intersection.cpp"
7271
DEPENDENCIES
7372
${PROJECT_NAME}::basic
7473
${PROJECT_NAME}::geometry
7574
ESSENTIAL
7675
)
7776
add_geode_test(
78-
SOURCE "test-mensuration.cpp"
77+
SOURCE "test-intersection-detection.cpp"
7978
DEPENDENCIES
8079
${PROJECT_NAME}::basic
8180
${PROJECT_NAME}::geometry
81+
ESSENTIAL
8282
)
8383
add_geode_test(
84-
SOURCE "test-nnsearch.cpp"
84+
SOURCE "test-mensuration.cpp"
8585
DEPENDENCIES
8686
${PROJECT_NAME}::basic
8787
${PROJECT_NAME}::geometry
8888
)
8989
add_geode_test(
90-
SOURCE "test-dynamic-nnsearch.cpp"
90+
SOURCE "test-nnsearch.cpp"
9191
DEPENDENCIES
9292
${PROJECT_NAME}::basic
9393
${PROJECT_NAME}::geometry

tests/mesh/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,6 @@ add_geode_test(
155155
${PROJECT_NAME}::geometry
156156
${PROJECT_NAME}::mesh
157157
)
158-
add_geode_test(
159-
SOURCE "test-dynamic-nnsearch-point-set.cpp"
160-
DEPENDENCIES
161-
${PROJECT_NAME}::basic
162-
${PROJECT_NAME}::geometry
163-
${PROJECT_NAME}::mesh
164-
)
165158
add_geode_test(
166159
SOURCE "test-point-set.cpp"
167160
DEPENDENCIES

tests/mesh/test-dynamic-nnsearch-point-set.cpp

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)