Skip to content

Commit 30e1c10

Browse files
committed
review changes
1 parent dc9b4fc commit 30e1c10

File tree

6 files changed

+15
-34
lines changed

6 files changed

+15
-34
lines changed

bindings/python/src/geometry/nn_search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
.def( "neighbors", &NNSearch##dimension##D::neighbors ) \
4040
.def( "radius_colocated_index_mapping", \
4141
static_cast< NNSearch##dimension##D::ColocatedInfo ( \
42-
NNSearch##dimension##D::* )( const double ) const >( \
42+
NNSearch##dimension##D::* )( double ) const >( \
4343
&NNSearch##dimension##D::colocated_index_mapping ) ) \
4444
.def( "frame_colocated_index_mapping", \
4545
static_cast< NNSearch##dimension##D::ColocatedInfo ( \

include/geode/geometry/nn_search.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@
2828

2929
#include <geode/geometry/basic_objects/ellipse.hpp>
3030
#include <geode/geometry/common.hpp>
31-
#include <geode/geometry/frame.hpp>
3231
#include <geode/geometry/point.hpp>
3332

3433
namespace geode
3534
{
35+
FORWARD_DECLARATION_DIMENSION_CLASS( Frame );
36+
3637
/*!
3738
* Given a list of points, this class returns neighboring points.
3839
*/
@@ -138,7 +139,7 @@ namespace geode
138139
* @return The information related to this colocated operation
139140
*/
140141
[[nodiscard]] ColocatedInfo colocated_index_mapping(
141-
const double epsilon ) const;
142+
double epsilon ) const;
142143

143144
[[nodiscard]] ColocatedInfo colocated_index_mapping(
144145
const Frame< dimension >& epsilon ) const;

include/geode/mesh/helpers/detail/solid_merger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace geode
7272
~SolidMeshMerger();
7373

7474
[[nodiscard]] std::unique_ptr< SolidMesh< dimension > > merge(
75-
const double epsilon );
75+
double epsilon );
7676

7777
[[nodiscard]] std::unique_ptr< SolidMesh< dimension > > merge(
7878
const Frame< dimension >& epsilons_frame );

src/geode/geometry/nn_search.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <geode/geometry/nn_search.hpp>
2525

2626
#include <geode/geometry/basic_objects/segment.hpp>
27+
#include <geode/geometry/frame.hpp>
2728
#include <geode/geometry/intersection.hpp>
2829

2930
#include <mutex>
@@ -309,9 +310,8 @@ namespace geode
309310
{
310311
OPENGEODE_EXCEPTION(
311312
epsilons_frame.direction( d ).length() >= GLOBAL_EPSILON,
312-
"[NNSearch::colocated_index_mapping] Given epsilon too "
313-
"small, "
314-
"should be bigger than GLOBAL_EPSILON (i.e. ",
313+
"[NNSearch::colocated_index_mapping] Given epsilon is too "
314+
"small, should be bigger than GLOBAL_EPSILON (i.e. ",
315315
GLOBAL_EPSILON, ")" );
316316
}
317317
return impl_->colocated_index_mapping( *this, epsilons_frame );

src/geode/mesh/helpers/detail/solid_merger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace geode
8585
}
8686

8787
std::unique_ptr< SolidMesh< dimension > > merge(
88-
SolidMeshMerger< dimension >& merger, const double epsilon )
88+
SolidMeshMerger< dimension >& merger, double epsilon )
8989
{
9090
merger.create_points( epsilon );
9191
create_polyhedra( merger );
@@ -341,7 +341,7 @@ namespace geode
341341

342342
template < index_t dimension >
343343
std::unique_ptr< SolidMesh< dimension > >
344-
SolidMeshMerger< dimension >::merge( const double epsilon )
344+
SolidMeshMerger< dimension >::merge( double epsilon )
345345
{
346346
return impl_->merge( *this, epsilon );
347347
}

src/geode/mesh/helpers/detail/vertex_merger.cpp

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace geode
106106
return *builder_;
107107
}
108108

109-
void create_points( const double epsilon )
109+
void create_points( double epsilon )
110110
{
111111
auto info = create_colocated_index_mapping( epsilon );
112112
vertices_ = std::move( info.colocated_mapping );
@@ -147,28 +147,8 @@ namespace geode
147147
}
148148

149149
private:
150-
ColocatedInfo create_colocated_index_mapping( const double epsilon )
151-
{
152-
index_t nb_points{ 0 };
153-
for( const auto& mesh : meshes_ )
154-
{
155-
nb_points += mesh.get().nb_vertices();
156-
}
157-
std::vector< Point< dimension > > points;
158-
points.reserve( nb_points );
159-
for( const auto& mesh : meshes_ )
160-
{
161-
for( const auto v : Range{ mesh.get().nb_vertices() } )
162-
{
163-
points.emplace_back( mesh.get().point( v ) );
164-
}
165-
}
166-
NNSearch< dimension > nnsearch{ std::move( points ) };
167-
return nnsearch.colocated_index_mapping( epsilon );
168-
}
169-
170-
ColocatedInfo create_colocated_index_mapping(
171-
const Frame< dimension >& epsilon )
150+
template < typename EpsilonType >
151+
ColocatedInfo create_colocated_index_mapping( EpsilonType epsilon )
172152
{
173153
index_t nb_points{ 0 };
174154
for( const auto& mesh : meshes_ )
@@ -218,8 +198,8 @@ namespace geode
218198
}
219199

220200
template < typename Mesh >
221-
auto VertexMerger< Mesh >::vertex_origins(
222-
index_t vertex ) const -> const VertexOrigins&
201+
auto VertexMerger< Mesh >::vertex_origins( index_t vertex ) const
202+
-> const VertexOrigins&
223203
{
224204
return impl_->vertex_origins( vertex );
225205
}

0 commit comments

Comments
 (0)