diff --git a/bindings/python/src/geometry/sign.cpp b/bindings/python/src/geometry/sign.cpp index 0a0b91124..8e1f6d97f 100644 --- a/bindings/python/src/geometry/sign.cpp +++ b/bindings/python/src/geometry/sign.cpp @@ -34,10 +34,10 @@ namespace geode { module.def( "tetrahedron_volume_sign", &tetrahedron_volume_sign ); module.def( "triangle_area_sign2D", - static_cast< Sign ( * )( const Triangle2D& ) >( + static_cast< SIGN ( * )( const Triangle2D& ) >( &triangle_area_sign ) ); module.def( "triangle_area_sign3D", - static_cast< Sign ( * )( const Triangle3D&, local_index_t ) >( + static_cast< SIGN ( * )( const Triangle3D&, local_index_t ) >( &triangle_area_sign ) ); } } // namespace geode diff --git a/include/geode/geometry/information.hpp b/include/geode/geometry/information.hpp index 5550c7865..8c2aedef8 100644 --- a/include/geode/geometry/information.hpp +++ b/include/geode/geometry/information.hpp @@ -34,7 +34,7 @@ namespace geode zero }; - using Sign = SIDE; + using SIGN = SIDE; enum struct POSITION { diff --git a/include/geode/geometry/sign.hpp b/include/geode/geometry/sign.hpp index 7284a9c10..b1d190653 100644 --- a/include/geode/geometry/sign.hpp +++ b/include/geode/geometry/sign.hpp @@ -33,7 +33,7 @@ namespace geode ALIAS_2D( Polygon ); class Tetrahedron; enum struct SIDE; - using Sign = SIDE; + using SIGN = SIDE; } // namespace geode namespace geode @@ -41,21 +41,21 @@ namespace geode /*! * Return the sign of a tetrahedron volume. */ - [[nodiscard]] Sign opengeode_geometry_api tetrahedron_volume_sign( + [[nodiscard]] SIGN opengeode_geometry_api tetrahedron_volume_sign( const Tetrahedron& tetra ); /*! * Return the sign of a 2D triangle area. */ - [[nodiscard]] Sign opengeode_geometry_api triangle_area_sign( + [[nodiscard]] SIGN opengeode_geometry_api triangle_area_sign( const Triangle2D& triangle ); - [[nodiscard]] Sign opengeode_geometry_api polygon_area_sign( + [[nodiscard]] SIGN opengeode_geometry_api polygon_area_sign( const Polygon2D& polygon ); /*! * Return the sign of a 3D triangle area aligned on X- Y- or Z-axis. */ - [[nodiscard]] Sign opengeode_geometry_api triangle_area_sign( + [[nodiscard]] SIGN opengeode_geometry_api triangle_area_sign( const Triangle3D& triangle, local_index_t axis ); } // namespace geode diff --git a/src/geode/geometry/intersection_detection.cpp b/src/geode/geometry/intersection_detection.cpp index fd2e4fb7e..2f52f02a0 100644 --- a/src/geode/geometry/intersection_detection.cpp +++ b/src/geode/geometry/intersection_detection.cpp @@ -197,7 +197,7 @@ namespace if( geode::tetrahedron_volume_sign( geode::Tetrahedron{ segment0.vertices()[0].get(), segment0.vertices()[1].get(), segment1.vertices()[0].get(), segment1.vertices()[1].get() } ) - != geode::Sign::zero ) + != geode::SIGN::zero ) { return { geode::POSITION::outside, geode::POSITION::outside }; } diff --git a/src/geode/geometry/sign.cpp b/src/geode/geometry/sign.cpp index 66ae59404..75e66e249 100644 --- a/src/geode/geometry/sign.cpp +++ b/src/geode/geometry/sign.cpp @@ -40,21 +40,21 @@ namespace namespace geode { - Sign tetrahedron_volume_sign( const Tetrahedron& tetra ) + SIGN tetrahedron_volume_sign( const Tetrahedron& tetra ) { const auto& vertices = tetra.vertices(); return internal::side( GEO::PCK::orient_3d( vertices[0], vertices[1], vertices[2], vertices[3] ) ); } - Sign triangle_area_sign( const Triangle2D& triangle ) + SIGN triangle_area_sign( const Triangle2D& triangle ) { const auto& vertices = triangle.vertices(); return internal::side( GEO::PCK::orient_2d( vertices[0], vertices[1], vertices[2] ) ); } - Sign polygon_area_sign( const Polygon2D& polygon ) + SIGN polygon_area_sign( const Polygon2D& polygon ) { const auto& polygon_vertices = polygon.vertices(); const auto& p1 = polygon_vertices[0]; @@ -64,15 +64,15 @@ namespace geode const auto& p3 = polygon_vertices[static_cast< local_index_t >( other_index + 1 )]; const auto sign = triangle_area_sign( { p1, p2, p3 } ); - if( sign != Sign::zero ) + if( sign != SIGN::zero ) { return sign; } } - return geode::Sign::zero; + return geode::SIGN::zero; } - Sign triangle_area_sign( const Triangle3D& triangle, local_index_t axis ) + SIGN triangle_area_sign( const Triangle3D& triangle, local_index_t axis ) { const auto axis1 = new_axis[axis][0]; const auto axis2 = new_axis[axis][1]; diff --git a/src/geode/mesh/helpers/repair_polygon_orientations.cpp b/src/geode/mesh/helpers/repair_polygon_orientations.cpp index 4d9aa373a..e31726f4d 100644 --- a/src/geode/mesh/helpers/repair_polygon_orientations.cpp +++ b/src/geode/mesh/helpers/repair_polygon_orientations.cpp @@ -158,30 +158,30 @@ namespace { polygons_area_sign_info( geode::index_t nb_init, geode::index_t nb_polygons, - geode::Sign sign_init ) + geode::SIGN sign_init ) : nb_bad_polygons{ nb_init }, area_sign{ nb_polygons, sign_init } { } geode::index_t nb_bad_polygons; std::queue< geode::index_t > queue; - absl::FixedArray< geode::Sign > area_sign; + absl::FixedArray< geode::SIGN > area_sign; }; polygons_area_sign_info compute_polygon_area_sign( const geode::SurfaceMesh2D& mesh ) { polygons_area_sign_info area_sign_info{ 0, mesh.nb_polygons(), - geode::Sign::zero }; + geode::SIGN::zero }; for( const auto polygon_id : geode::Range{ mesh.nb_polygons() } ) { area_sign_info.area_sign[polygon_id] = geode::polygon_area_sign( mesh.polygon( polygon_id ) ); - if( area_sign_info.area_sign[polygon_id] == geode::Sign::negative ) + if( area_sign_info.area_sign[polygon_id] == geode::SIGN::negative ) { area_sign_info.nb_bad_polygons++; } - else if( area_sign_info.area_sign[polygon_id] == geode::Sign::zero ) + else if( area_sign_info.area_sign[polygon_id] == geode::SIGN::zero ) { area_sign_info.queue.emplace( polygon_id ); } @@ -211,7 +211,7 @@ namespace } const auto adj = mesh.polygon_adjacent_edge( edge ).value(); if( area_sign_info.area_sign[adj.polygon_id] - == geode::Sign::zero ) + == geode::SIGN::zero ) { continue; } @@ -227,24 +227,24 @@ namespace break; } if( area_sign_info.area_sign[adj.polygon_id] - == geode::Sign::positive ) + == geode::SIGN::positive ) { area_sign_info.area_sign[cur_polygon] = - geode::Sign::negative; + geode::SIGN::negative; } else { area_sign_info.area_sign[cur_polygon] = - geode::Sign::positive; + geode::SIGN::positive; } break; } - if( area_sign_info.area_sign[cur_polygon] == geode::Sign::zero ) + if( area_sign_info.area_sign[cur_polygon] == geode::SIGN::zero ) { area_sign_info.queue.emplace( cur_polygon ); } else if( area_sign_info.area_sign[cur_polygon] - == geode::Sign::negative ) + == geode::SIGN::negative ) { area_sign_info.nb_bad_polygons++; } @@ -267,7 +267,7 @@ namespace geode::index_t count{ 0 }; for( const auto p : geode::Range{ mesh.nb_polygons() } ) { - if( area_sign_info.area_sign[p] == geode::Sign::negative ) + if( area_sign_info.area_sign[p] == geode::SIGN::negative ) { bad_polygons[count++] = p; }