Skip to content

Commit 8e428d9

Browse files
committed
Merge branch 'next' into fix/unsegmentation
2 parents 8ce7dc5 + 78d492c commit 8e428d9

File tree

90 files changed

+1168
-459
lines changed

Some content is hidden

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

90 files changed

+1168
-459
lines changed

bindings/python/src/basic/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_geode_python_binding(
2828
"identifier.cpp"
2929
"identifier_builder.cpp"
3030
"mapping.cpp"
31+
"percentage.cpp"
3132
"uuid.cpp"
3233
DEPENDENCIES
3334
${PROJECT_NAME}::basic

bindings/python/src/basic/basic.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace geode
3434
void define_identifier( pybind11::module& );
3535
void define_identifier_builder( pybind11::module& );
3636
void define_mapping( pybind11::module& );
37+
void define_percentage( pybind11::module& );
3738
void define_uuid( pybind11::module& );
3839
} // namespace geode
3940

@@ -53,5 +54,6 @@ PYBIND11_MODULE( opengeode_py_basic, module )
5354
geode::define_identifier( module );
5455
geode::define_identifier_builder( module );
5556
geode::define_mapping( module );
57+
geode::define_percentage( module );
5658
geode::define_uuid( module );
5759
}

bindings/python/src/basic/input.hpp

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,32 @@
2424
#include <geode/basic/input.hpp>
2525

2626
#define PYTHON_INPUT_CLASS( type, name ) \
27-
pybind11::class_< Input< type >::MissingFiles >( \
28-
module, absl::StrCat( "MissingFiles", name ).c_str() ) \
29-
.def( "has_missing_files", \
30-
&Input< type >::MissingFiles::has_missing_files ) \
31-
.def_readwrite( "additional_files", \
32-
&Input< type >::MissingFiles::additional_files ) \
27+
pybind11::class_< Input< type >::AdditionalFile >( \
28+
module, absl::StrCat( "AdditionalFile", name ).c_str() ) \
29+
.def_readwrite( "filename", &Input< type >::AdditionalFile::filename ) \
3330
.def_readwrite( \
34-
"mandatory_files", &Input< type >::MissingFiles::mandatory_files )
31+
"is_missing", &Input< type >::AdditionalFile::is_missing ); \
32+
pybind11::class_< Input< type >::AdditionalFiles >( \
33+
module, absl::StrCat( "AdditionalFiles", name ).c_str() ) \
34+
.def( "has_additional_files", \
35+
&Input< type >::AdditionalFiles::has_additional_files ) \
36+
.def_readwrite( "optional_files", \
37+
&Input< type >::AdditionalFiles::optional_files ) \
38+
.def_readwrite( "mandatory_files", \
39+
&Input< type >::AdditionalFiles::mandatory_files )
3540

3641
#define PYTHON_INPUT_MESH_CLASS( type, name ) \
37-
pybind11::class_< Input< type, MeshImpl >::MissingFiles >( \
38-
module, absl::StrCat( "MissingFiles", name ).c_str() ) \
39-
.def( "has_missing_files", \
40-
&Input< type, MeshImpl >::MissingFiles::has_missing_files ) \
41-
.def_readwrite( "additional_files", \
42-
&Input< type, MeshImpl >::MissingFiles::additional_files ) \
42+
pybind11::class_< Input< type, MeshImpl >::AdditionalFile >( \
43+
module, absl::StrCat( "AdditionalFile", name ).c_str() ) \
44+
.def_readwrite( \
45+
"filename", &Input< type, MeshImpl >::AdditionalFile::filename ) \
46+
.def_readwrite( "is_missing", \
47+
&Input< type, MeshImpl >::AdditionalFile::is_missing ); \
48+
pybind11::class_< Input< type, MeshImpl >::AdditionalFiles >( \
49+
module, absl::StrCat( "AdditionalFiles", name ).c_str() ) \
50+
.def( "has_additional_files", \
51+
&Input< type, MeshImpl >::AdditionalFiles::has_additional_files ) \
52+
.def_readwrite( "optional_files", \
53+
&Input< type, MeshImpl >::AdditionalFiles::optional_files ) \
4354
.def_readwrite( "mandatory_files", \
44-
&Input< type, MeshImpl >::MissingFiles::mandatory_files )
55+
&Input< type, MeshImpl >::AdditionalFiles::mandatory_files )
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/basic/percentage.hpp>
27+
28+
namespace geode
29+
{
30+
void define_percentage( pybind11::module& module )
31+
{
32+
pybind11::class_< Percentage >( module, "Percentage" )
33+
.def( pybind11::init< double >() )
34+
.def( "string", &Percentage::string )
35+
.def( "value", &Percentage::value )
36+
.def( "set_value", &Percentage::set_value );
37+
}
38+
} // namespace geode

bindings/python/src/image/io/raster_image.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@
3939
const auto load##dimension = \
4040
"load_raster_image" + std::to_string( dimension ) + "D"; \
4141
module.def( load##dimension.c_str(), &load_raster_image< dimension > ); \
42-
const auto check##dimension = "check_raster_image_missing_files" \
43-
+ std::to_string( dimension ) + "D"; \
42+
const auto check##dimension = \
43+
"raster_image_additional_files" + std::to_string( dimension ) + "D"; \
4444
module.def( check##dimension.c_str(), \
45-
&check_raster_image_missing_files< dimension > ); \
45+
&raster_image_additional_files< dimension > ); \
46+
const auto priority##dimension = \
47+
"raster_image_object_priority" + std::to_string( dimension ) + "D"; \
48+
module.def( priority##dimension.c_str(), \
49+
&raster_image_object_priority< dimension > ); \
4650
const auto loadable##dimension = \
4751
"is_raster_image_loadable" + std::to_string( dimension ) + "D"; \
4852
module.def( \

bindings/python/src/mesh/io/edged_curve.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@
4141
static_cast< std::unique_ptr< EdgedCurve< dimension > > ( * )( \
4242
std::string_view ) >( &load_edged_curve< dimension > ) ); \
4343
const auto check##dimension = \
44-
"check_edged_curve_missing_files" + std::to_string( dimension ) + "D"; \
44+
"edged_curve_additional_files" + std::to_string( dimension ) + "D"; \
4545
module.def( check##dimension.c_str(), \
46-
&check_edged_curve_missing_files< dimension > ); \
46+
&edged_curve_additional_files< dimension > ); \
47+
const auto priority##dimension = \
48+
"edged_curve_object_priority" + std::to_string( dimension ) + "D"; \
49+
module.def( priority##dimension.c_str(), \
50+
&edged_curve_object_priority< dimension > ); \
4751
const auto loadable##dimension = \
4852
"is_edged_curve_loadable" + std::to_string( dimension ) + "D"; \
4953
module.def( \

bindings/python/src/mesh/io/graph.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ namespace geode
3737
module.def( "load_graph",
3838
static_cast< std::unique_ptr< Graph > ( * )( std::string_view ) >(
3939
&load_graph ) );
40-
module.def( "check_graph_missing_files", &check_graph_missing_files );
40+
module.def( "graph_additional_files", &graph_additional_files );
41+
module.def( "graph_object_priority", &graph_object_priority );
4142
module.def( "is_graph_loadable", &is_graph_loadable );
4243
module.def( "is_graph_saveable", &is_graph_saveable );
4344
PYTHON_INPUT_MESH_CLASS( std::unique_ptr< Graph >, "Graph" );

bindings/python/src/mesh/io/hybrid_solid.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@
4040
module.def( load##dimension.c_str(), \
4141
static_cast< std::unique_ptr< HybridSolid< dimension > > ( * )( \
4242
std::string_view ) >( &load_hybrid_solid< dimension > ) ); \
43-
const auto check##dimension = "check_hybrid_solid_missing_files" \
44-
+ std::to_string( dimension ) + "D"; \
43+
const auto check##dimension = \
44+
"hybrid_solid_additional_files" + std::to_string( dimension ) + "D"; \
4545
module.def( check##dimension.c_str(), \
46-
&check_hybrid_solid_missing_files< dimension > ); \
46+
&hybrid_solid_additional_files< dimension > ); \
47+
const auto priority##dimension = \
48+
"hybrid_solid_object_priority" + std::to_string( dimension ) + "D"; \
49+
module.def( priority##dimension.c_str(), \
50+
&hybrid_solid_object_priority< dimension > ); \
4751
const auto loadable##dimension = \
4852
"is_hybrid_solid_loadable" + std::to_string( dimension ) + "D"; \
4953
module.def( \

bindings/python/src/mesh/io/light_regular_grid.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@
4141
module.def( load##dimension.c_str(), \
4242
static_cast< LightRegularGrid< dimension > ( * )( \
4343
std::string_view ) >( &load_light_regular_grid< dimension > ) ); \
44-
const auto check##dimension = "check_light_regular_grid_missing_files" \
44+
const auto check##dimension = "light_regular_grid_additional_files" \
4545
+ std::to_string( dimension ) + "D"; \
4646
module.def( check##dimension.c_str(), \
47-
&check_light_regular_grid_missing_files< dimension > ); \
47+
&light_regular_grid_additional_files< dimension > ); \
48+
const auto priority##dimension = "light_regular_grid_object_priority" \
49+
+ std::to_string( dimension ) + "D"; \
50+
module.def( priority##dimension.c_str(), \
51+
&light_regular_grid_object_priority< dimension > ); \
4852
const auto loadable##dimension = \
4953
"is_light_regular_grid_loadable" + std::to_string( dimension ) + "D"; \
5054
module.def( loadable##dimension.c_str(), \

bindings/python/src/mesh/io/point_set.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@
4141
static_cast< std::unique_ptr< PointSet< dimension > > ( * )( \
4242
std::string_view ) >( &load_point_set< dimension > ) ); \
4343
const auto check##dimension = \
44-
"check_point_set_missing_files" + std::to_string( dimension ) + "D"; \
45-
module.def( check##dimension.c_str(), \
46-
&check_point_set_missing_files< dimension > ); \
44+
"point_set_additional_files" + std::to_string( dimension ) + "D"; \
45+
module.def( \
46+
check##dimension.c_str(), &point_set_additional_files< dimension > ); \
47+
const auto priority##dimension = \
48+
"point_set_object_priority" + std::to_string( dimension ) + "D"; \
49+
module.def( priority##dimension.c_str(), \
50+
&point_set_object_priority< dimension > ); \
4751
const auto loadable##dimension = \
4852
"is_point_set_loadable" + std::to_string( dimension ) + "D"; \
4953
module.def( \

0 commit comments

Comments
 (0)