Skip to content

Commit 4b8f55e

Browse files
committed
Merge branch 'next' into feat_add_ellipsoid_radius_neighbors_in_nnsearch
2 parents 4f16936 + c15c308 commit 4b8f55e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1587
-517
lines changed

bindings/python/src/common.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <pybind11/stl.h>
2727

2828
#include <absl/container/fixed_array.h>
29+
#include <absl/container/flat_hash_map.h>
2930
#include <absl/container/inlined_vector.h>
3031
#include <absl/types/span.h>
3132

@@ -69,5 +70,11 @@ namespace pybind11
6970

7071
std::vector< typename std::remove_const< Type >::type > cpp_;
7172
};
73+
74+
template < typename Key, typename Value >
75+
struct type_caster< absl::flat_hash_map< Key, Value > >
76+
: map_caster< absl::flat_hash_map< Key, Value >, Key, Value >
77+
{
78+
};
7279
} // namespace detail
7380
} // namespace pybind11

bindings/python/src/model/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ add_geode_python_binding(
3232
"helpers/ray_tracing.cpp"
3333
"mixin/builder/blocks_builder.cpp"
3434
"mixin/builder/block_collections_builder.cpp"
35+
"mixin/builder/component_registry_builder.cpp"
3536
"mixin/builder/corners_builder.cpp"
3637
"mixin/builder/corner_collections_builder.cpp"
3738
"mixin/builder/lines_builder.cpp"
@@ -48,6 +49,7 @@ add_geode_python_binding(
4849
"mixin/core/blocks.cpp"
4950
"mixin/core/component.cpp"
5051
"mixin/core/component_mesh_element.cpp"
52+
"mixin/core/component_registry.cpp"
5153
"mixin/core/component_type.cpp"
5254
"mixin/core/corner_collection.cpp"
5355
"mixin/core/corner_collections.cpp"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2019 - 2025 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#include "../../../common.hpp"
25+
26+
#include <geode/model/mixin/builder/component_registry_builder.hpp>
27+
#include <geode/model/mixin/core/component_registry.hpp>
28+
29+
namespace geode
30+
{
31+
void define_component_registry_builder( pybind11::module& module )
32+
{
33+
pybind11::class_< ComponentRegistryBuilder >(
34+
module, "ComponentRegistryBuilder" )
35+
.def( pybind11::init< ComponentRegistry& >() )
36+
.def( "add_mesh_component",
37+
&ComponentRegistryBuilder::add_mesh_component )
38+
.def( "add_collection_component",
39+
&ComponentRegistryBuilder::add_collection_component )
40+
.def( "remove_mesh_component",
41+
&ComponentRegistryBuilder::remove_mesh_component )
42+
.def( "remove_collection_component",
43+
&ComponentRegistryBuilder::remove_collection_component );
44+
}
45+
} // namespace geode

bindings/python/src/model/mixin/builder/topology_builder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace geode
3030
void define_topology_builder( pybind11::module& module )
3131
{
3232
pybind11::class_< TopologyBuilder, RelationshipsBuilder,
33-
VertexIdentifierBuilder >( module, "TopologyBuilder" );
33+
VertexIdentifierBuilder, ComponentRegistryBuilder >(
34+
module, "TopologyBuilder" );
3435
}
3536
} // namespace geode
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2019 - 2025 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#include "../../../common.hpp"
25+
26+
#include <geode/model/mixin/core/component_registry.hpp>
27+
28+
namespace geode
29+
{
30+
void define_component_registry( pybind11::module& module )
31+
{
32+
pybind11::class_< ComponentRegistry >( module, "ComponentRegistry" )
33+
.def( pybind11::init<>() )
34+
.def( "mesh_components", &ComponentRegistry::mesh_components )
35+
.def( "collection_components",
36+
&ComponentRegistry::collection_components );
37+
}
38+
} // namespace geode

bindings/python/src/model/mixin/core/topology.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace geode
2929
{
3030
void define_topology( pybind11::module& module )
3131
{
32-
pybind11::class_< Topology, Relationships, VertexIdentifier >(
33-
module, "Topology" );
32+
pybind11::class_< Topology, Relationships, VertexIdentifier,
33+
ComponentRegistry >( module, "Topology" );
3434
}
3535
} // namespace geode

bindings/python/src/model/model.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace geode
3131
void define_component_type( pybind11::module& );
3232
void define_component( pybind11::module& );
3333
void define_component_mesh_element( pybind11::module& );
34+
void define_component_registry( pybind11::module& );
3435
void define_block( pybind11::module& );
3536
void define_blocks( pybind11::module& );
3637
void define_corner( pybind11::module& );
@@ -54,6 +55,7 @@ namespace geode
5455
void define_topology( pybind11::module& );
5556

5657
void define_blocks_builder( pybind11::module& );
58+
void define_component_registry_builder( pybind11::module& );
5759
void define_corners_builder( pybind11::module& );
5860
void define_lines_builder( pybind11::module& );
5961
void define_model_boundaries_builder( pybind11::module& );
@@ -106,6 +108,7 @@ PYBIND11_MODULE( opengeode_py_model, module )
106108
geode::define_component_type( module );
107109
geode::define_component( module );
108110
geode::define_component_mesh_element( module );
111+
geode::define_component_registry( module );
109112
geode::define_block( module );
110113
geode::define_blocks( module );
111114
geode::define_corner( module );
@@ -129,6 +132,7 @@ PYBIND11_MODULE( opengeode_py_model, module )
129132
geode::define_topology( module );
130133

131134
geode::define_blocks_builder( module );
135+
geode::define_component_registry_builder( module );
132136
geode::define_corners_builder( module );
133137
geode::define_lines_builder( module );
134138
geode::define_model_boundaries_builder( module );

0 commit comments

Comments
 (0)