Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Checks: >
-llvm-header-guard,
-llvm-prefer-static-over-anonymous-namespace,
-misc-no-recursion,
-misc-include-cleaner,
-misc-const-correctness,
-modernize-use-trailing-return-type,
-portability-avoid-pragma-once,
-readability-redundant-access-specifiers,
-readability-convert-member-functions-to-static,
-cppcoreguidelines-avoid-const-or-ref-data-members
Expand Down Expand Up @@ -59,5 +62,3 @@ CheckOptions:
value: 10
- key: readability-function-size.ParameterThreshold
value: 4
- key: misc-include-cleaner.IgnoreHeaders
value: utility;cstddef;geode/.*_export\.h;geode/.*/common\.h;geode/basic/types\.h;geode/basic/assert\.h;
2 changes: 1 addition & 1 deletion bindings/python/src/basic/cell_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define PYTHON_ARRAY( dimension ) \
const auto name##dimension = \
"CellArray" + std::to_string( dimension ) + "D"; \
pybind11::class_< CellArray##dimension##D >( \
pybind11::class_< CellArray##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( \
"nb_cell_neighbors", &CellArray##dimension##D::nb_cell_neighbors ) \
Expand All @@ -44,10 +44,10 @@

namespace geode
{
void define_cell_array( pybind11::module& module )

Check warning on line 47 in bindings/python/src/basic/cell_array.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/basic/cell_array.cpp:47:10 [misc-use-internal-linkage]

function 'define_cell_array' can be made static or moved into an anonymous namespace to enforce internal linkage
{
PYTHON_ARRAY( 1 );

Check warning on line 49 in bindings/python/src/basic/cell_array.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/basic/cell_array.cpp:49:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
PYTHON_ARRAY( 2 );

Check warning on line 50 in bindings/python/src/basic/cell_array.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/basic/cell_array.cpp:50:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
PYTHON_ARRAY( 3 );

Check warning on line 51 in bindings/python/src/basic/cell_array.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/basic/cell_array.cpp:51:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
}
} // namespace geode
3 changes: 2 additions & 1 deletion bindings/python/src/basic/identifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@

namespace geode
{
void define_identifier( pybind11::module& module )

Check warning on line 31 in bindings/python/src/basic/identifier.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/basic/identifier.cpp:31:10 [misc-use-internal-linkage]

function 'define_identifier' can be made static or moved into an anonymous namespace to enforce internal linkage
{
pybind11::class_< Identifier >( module, "Identifier" )
pybind11::class_< Identifier, pybind11::smart_holder >(
module, "Identifier" )
.def( "id", &Identifier::id )
.def( "name", &Identifier::name );
}
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/geometry/coordinate_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_COORDINATE_SYSTEM( dimension ) \
const auto name##dimension = \
"CoordinateSystem" + std::to_string( dimension ) + "D"; \
pybind11::class_< CoordinateSystem##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< CoordinateSystem##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( pybind11::init<>() ) \
.def( pybind11::init< std::array< Vector< dimension >, dimension >, \
Point< dimension > >() ) \
Expand All @@ -44,10 +44,10 @@

namespace geode
{
void define_coordinate_system( pybind11::module& module )

Check warning on line 47 in bindings/python/src/geometry/coordinate_system.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/geometry/coordinate_system.cpp:47:10 [misc-use-internal-linkage]

function 'define_coordinate_system' can be made static or moved into an anonymous namespace to enforce internal linkage
{
PYTHON_COORDINATE_SYSTEM( 1 );

Check warning on line 49 in bindings/python/src/geometry/coordinate_system.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/geometry/coordinate_system.cpp:49:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
PYTHON_COORDINATE_SYSTEM( 2 );

Check warning on line 50 in bindings/python/src/geometry/coordinate_system.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/geometry/coordinate_system.cpp:50:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
PYTHON_COORDINATE_SYSTEM( 3 );

Check warning on line 51 in bindings/python/src/geometry/coordinate_system.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/geometry/coordinate_system.cpp:51:9 [cppcoreguidelines-pro-bounds-pointer-arithmetic]

do not use pointer arithmetic
}
} // namespace geode
3 changes: 2 additions & 1 deletion bindings/python/src/image/core/raster_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
const auto name##dimension = \
"RasterImage" + std::to_string( dimension ) + "D"; \
pybind11::class_< RasterImage##dimension##D, CellArray##dimension##D, \
Identifier >( module, name##dimension.c_str() ) \
Identifier, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( pybind11::init< std::array< index_t, dimension > >() ) \
.def( \
"native_extension", &RasterImage##dimension##D::native_extension ) \
Expand All @@ -40,7 +41,7 @@

namespace geode
{
void define_raster_image( pybind11::module& module )

Check warning on line 44 in bindings/python/src/image/core/raster_image.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/image/core/raster_image.cpp:44:10 [misc-use-internal-linkage]

function 'define_raster_image' can be made static or moved into an anonymous namespace to enforce internal linkage
{
PYTHON_RASTER_IMAGE( 1 );
PYTHON_RASTER_IMAGE( 2 );
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/crs_managers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#define PYTHON_CRS_MANAGERS( dimension ) \
const auto name##dimension = "CoordinateReferenceSystemManagers" \
+ std::to_string( dimension ) + "D"; \
pybind11::class_< CoordinateReferenceSystemManagers##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< CoordinateReferenceSystemManagers##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "coordinate_reference_system_manager1D", \
static_cast< const CoordinateReferenceSystemManager1D& ( \
CoordinateReferenceSystemManagers##dimension##D::*) () \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/edged_curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
const auto name##dimension = \
"EdgedCurve" + std::to_string( dimension ) + "D"; \
pybind11::class_< EdgedCurve##dimension##D, Graph, \
CoordinateReferenceSystemManagers##dimension##D >( \
module, name##dimension.c_str() ) \
CoordinateReferenceSystemManagers##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< EdgedCurve##dimension##D > ( * )() >( \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/mesh/core/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace geode
{
void define_graph( pybind11::module& module )
{
pybind11::class_< Graph, VertexSet >( module, "Graph" )
pybind11::class_< Graph, VertexSet, pybind11::smart_holder >(
module, "Graph" )
.def_static(
"create", static_cast< std::unique_ptr< Graph > ( * )() >(
&Graph::create ) )
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

#define PYTHON_GRID( dimension ) \
const auto name##dimension = "Grid" + std::to_string( dimension ) + "D"; \
pybind11::class_< Grid##dimension##D, CellArray##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< Grid##dimension##D, CellArray##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "grid_coordinate_system", \
&Grid##dimension##D::grid_coordinate_system ) \
.def( "nb_cell_vertices", &Grid##dimension##D::nb_cell_vertices ) \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/hybrid_solid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_HYBRID_SOLID( dimension ) \
const auto name##dimension = \
"HybridSolid" + std::to_string( dimension ) + "D"; \
pybind11::class_< HybridSolid##dimension##D, SolidMesh##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< HybridSolid##dimension##D, SolidMesh##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< HybridSolid##dimension##D > ( * )() >( \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/light_regular_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace
const auto class_name =
absl::StrCat( "LightRegularGrid", dimension, "D" );
pybind11::class_< geode::LightRegularGrid< dimension >,
geode::Grid< dimension >, geode::Identifier >(
module, class_name.c_str() )
geode::Grid< dimension >, geode::Identifier,
pybind11::smart_holder >( module, class_name.c_str() )
.def( pybind11::init< geode::Point< dimension >,
std::array< geode::index_t, dimension >,
std::array< double, dimension > >() )
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/point_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
const auto name##dimension = \
"PointSet" + std::to_string( dimension ) + "D"; \
pybind11::class_< PointSet##dimension##D, VertexSet, \
CoordinateReferenceSystemManagers##dimension##D >( \
module, name##dimension.c_str() ) \
CoordinateReferenceSystemManagers##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< std::unique_ptr< PointSet##dimension##D > ( * )() >( \
&PointSet##dimension##D::create ) ) \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/mesh/core/polygonal_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
const auto name##dimension = \
"PolygonalSurface" + std::to_string( dimension ) + "D"; \
pybind11::class_< PolygonalSurface##dimension##D, \
SurfaceMesh##dimension##D >( module, name##dimension.c_str() ) \
SurfaceMesh##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< PolygonalSurface##dimension##D > ( * )() >( \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/polyhedral_solid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_POLYHEDRAL_SOLID( dimension ) \
const auto name##dimension = \
"PolyhedralSolid" + std::to_string( dimension ) + "D"; \
pybind11::class_< PolyhedralSolid##dimension##D, \
SolidMesh##dimension##D >( module, name##dimension.c_str() ) \
pybind11::class_< PolyhedralSolid##dimension##D, SolidMesh##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< PolyhedralSolid##dimension##D > ( * )() >( \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/mesh/core/regular_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
const auto name##dimension = \
"RegularGrid" + std::to_string( dimension ) + "D"; \
pybind11::class_< RegularGrid##dimension##D, Base##dimension##D, \
Grid##dimension##D >( module, name##dimension.c_str() ) \
Grid##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< RegularGrid##dimension##D > ( * )() >( \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/solid_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
const auto name##dimension = \
"SolidMesh" + std::to_string( dimension ) + "D"; \
pybind11::class_< SolidMesh##dimension##D, VertexSet, \
CoordinateReferenceSystemManagers##dimension##D >( \
module, name##dimension.c_str() ) \
CoordinateReferenceSystemManagers##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< std::unique_ptr< SolidMesh##dimension##D > ( * )() >( \
&SolidMesh##dimension##D::create ) ) \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/surface_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
const auto name##dimension = \
"SurfaceMesh" + std::to_string( dimension ) + "D"; \
pybind11::class_< SurfaceMesh##dimension##D, VertexSet, \
CoordinateReferenceSystemManagers##dimension##D >( \
module, name##dimension.c_str() ) \
CoordinateReferenceSystemManagers##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "are_edges_enabled", \
&SurfaceMesh##dimension##D::are_edges_enabled ) \
.def( "enable_edges", &SurfaceMesh##dimension##D::enable_edges ) \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/mesh/core/tetrahedral_solid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#define PYTHON_TETRAHEDRAL_SOLID( dimension ) \
const auto name##dimension = \
"TetrahedralSolid" + std::to_string( dimension ) + "D"; \
pybind11::class_< TetrahedralSolid##dimension##D, \
SolidMesh##dimension##D >( module, name##dimension.c_str() ) \
pybind11::class_< TetrahedralSolid##dimension##D, SolidMesh##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def_static( "create", \
static_cast< \
std::unique_ptr< TetrahedralSolid##dimension##D > ( * )() >( \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/mesh/core/triangulated_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
const auto name##dimension = \
"TriangulatedSurface" + std::to_string( dimension ) + "D"; \
pybind11::class_< TriangulatedSurface##dimension##D, \
SurfaceMesh##dimension##D >( module, name##dimension.c_str() ) \
SurfaceMesh##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def_static( \
"create", static_cast< std::unique_ptr< \
TriangulatedSurface##dimension##D > ( * )() >( \
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/mesh/core/vertex_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace geode
{
void define_vertex_set( pybind11::module& module )
{
pybind11::class_< VertexSet, Identifier >( module, "VertexSet" )
pybind11::class_< VertexSet, Identifier, pybind11::smart_holder >(
module, "VertexSet" )
.def_static(
"create", static_cast< std::unique_ptr< VertexSet > ( * )() >(
&VertexSet::create ) )
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#define PYTHON_BLOCK( dimension ) \
const auto name##dimension = "Block" + std::to_string( dimension ) + "D"; \
pybind11::class_< Block##dimension##D, Component##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< Block##dimension##D, Component##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "mesh", &Block##dimension##D::mesh< SolidMesh##dimension##D >, \
pybind11::return_value_policy::reference ) \
.def( "polyhedral_mesh", \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/block_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_BLOCK_COLLECTION( dimension ) \
const auto name##dimension = \
"BlockCollection" + std::to_string( dimension ) + "D"; \
pybind11::class_< BlockCollection##dimension##D, \
Component##dimension##D >( module, name##dimension.c_str() ) \
pybind11::class_< BlockCollection##dimension##D, Component##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "component_id", &BlockCollection##dimension##D::component_id ) \
.def_static( "component_type_static", \
&BlockCollection##dimension##D::component_type_static )
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/block_collections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#define PYTHON_BLOCK_COLLECTIONS( dimension ) \
const auto name##dimension = \
"BlockCollections" + std::to_string( dimension ) + "D"; \
pybind11::class_< BlockCollections##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< BlockCollections##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "nb_block_collections", \
&BlockCollections##dimension##D::nb_block_collections ) \
.def( "block_collection", \
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/model/mixin/core/blocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#define PYTHON_BLOCKS( dimension ) \
const auto name##dimension = "Blocks" + std::to_string( dimension ) + "D"; \
pybind11::class_< Blocks##dimension##D >( \
pybind11::class_< Blocks##dimension##D, pybind11::smart_holder >( \
module, name##dimension.c_str() ) \
.def( "nb_blocks", &Blocks##dimension##D::nb_blocks ) \
.def( "block", &Blocks##dimension##D::block, \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_COMPONENT( dimension ) \
const auto name##dimension = \
"Component" + std::to_string( dimension ) + "D"; \
pybind11::class_< Component##dimension##D, Identifier >( \
module, name##dimension.c_str() ) \
pybind11::class_< Component##dimension##D, Identifier, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "component_type", &Component##dimension##D::component_type )

namespace geode
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/model/mixin/core/component_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace geode
{
void define_component_registry( pybind11::module& module )
{
pybind11::class_< ComponentRegistry >( module, "ComponentRegistry" )
pybind11::class_< ComponentRegistry, pybind11::smart_holder >(
module, "ComponentRegistry" )
.def( pybind11::init<>() )
.def( "mesh_components", &ComponentRegistry::mesh_components )
.def( "collection_components",
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/corner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#define PYTHON_CORNER( dimension ) \
const auto name##dimension = "Corner" + std::to_string( dimension ) + "D"; \
pybind11::class_< Corner##dimension##D, Component##dimension##D >( \
module, name##dimension.c_str() ) \
pybind11::class_< Corner##dimension##D, Component##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "mesh", &Corner##dimension##D::mesh, \
pybind11::return_value_policy::reference ) \
.def( "component_id", &Corner##dimension##D::component_id ) \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/model/mixin/core/corner_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define PYTHON_CORNER_COLLECTION( dimension ) \
const auto name##dimension = \
"CornerCollection" + std::to_string( dimension ) + "D"; \
pybind11::class_< CornerCollection##dimension##D, \
Component##dimension##D >( module, name##dimension.c_str() ) \
pybind11::class_< CornerCollection##dimension##D, Component##dimension##D, \
pybind11::smart_holder >( module, name##dimension.c_str() ) \
.def( "component_id", &CornerCollection##dimension##D::component_id ) \
.def_static( "component_type_static", \
&CornerCollection##dimension##D::component_type_static )
Expand Down
Loading
Loading