Skip to content

fix(SIGN): rename signe struct - #1313

Open
BenPinet wants to merge 1 commit into
v18from
feat/put_sign_struct_in_caps
Open

fix(SIGN): rename signe struct#1313
BenPinet wants to merge 1 commit into
v18from
feat/put_sign_struct_in_caps

Conversation

@BenPinet

@BenPinet BenPinet commented Aug 3, 2026

Copy link
Copy Markdown
Member

BREAKING CHANGE: rename Sign struct to SIGN

BREAKING CHANGE: rename Sign struct to SIGN
@BenPinet
BenPinet requested a review from BotellaA August 3, 2026 14:41
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v20.1.8) reports: 20 concern(s)
  • bindings/python/src/geometry/sign.cpp:33:10: warning: [misc-use-internal-linkage]

    function 'define_sign' can be made static or moved into an anonymous namespace to enforce internal linkage

       33 |     void define_sign( pybind11::module& module )
          |          ^
          |     static 
  • include/geode/geometry/information.hpp:30:17: warning: [performance-enum-size]

    enum 'SIDE' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

       30 |     enum struct SIDE
          |                 ^
  • include/geode/geometry/information.hpp:39:17: warning: [performance-enum-size]

    enum 'POSITION' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

       39 |     enum struct POSITION
          |                 ^
  • src/geode/geometry/intersection_detection.cpp:75:39: warning: [readability-function-cognitive-complexity]

    function 'segment_segment_intersection_detection2D' has cognitive complexity of 17 (threshold 10)

       75 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection2D(
          |                                       ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:86:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       86 |         if( s0_p0_side == s0_p1_side || s1_p0_side == s1_p1_side )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:86:38: note: +1
       86 |         if( s0_p0_side == s0_p1_side || s1_p0_side == s1_p1_side )
          |                                      ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:88:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       88 |             if( s0_p0_side == geode::SIDE::zero
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:89:17: note: +1
       89 |                 && s1_p0_side == geode::SIDE::zero )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:95:9: note: +1, including nesting penalty of 0, nesting level increased to 1
       95 |         if( s0_p0_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:97:13: note: +2, including nesting penalty of 1, nesting level increased to 2
       97 |             if( s1_p0_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:101:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      101 |             if( s1_p1_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:107:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      107 |         if( s0_p1_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:109:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      109 |             if( s1_p0_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:113:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      113 |             if( s1_p1_side == geode::SIDE::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:119:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      119 |         if( s1_p0_side == geode::SIDE::zero )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:123:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      123 |         if( s1_p1_side == geode::SIDE::zero )
          |         ^
  • src/geode/geometry/intersection_detection.cpp:75:39: warning: [readability-identifier-naming]

    invalid case style for function 'segment_segment_intersection_detection2D'

       75 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection2D(
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                       segment_segment_intersection_detection2_d
  • src/geode/geometry/intersection_detection.cpp:131:9: warning: [readability-function-cognitive-complexity]

    function 'segment_triangle_plane_intersection_detection' has cognitive complexity of 17 (threshold 10)

      131 |         segment_triangle_plane_intersection_detection(
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:142:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      142 |         for( const auto triangle_pt : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:150:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      150 |         for( const auto edge_v0 : geode::LRange{ 3 } )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:156:56: note: +2, including nesting penalty of 1, nesting level increased to 2
      156 |                                                        ? 0
          |                                                        ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:158:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      158 |             if( seg_edge_inter.first == geode::POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:159:17: note: +1
      159 |                 || seg_edge_inter.first == geode::POSITION::parallel )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:163:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      163 |             if( ( seg_edge_inter.first == geode::POSITION::vertex0
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:165:17: note: +1
      165 |                 && ( seg_edge_inter.second == geode::POSITION::vertex0
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:164:21: note: +1
      164 |                     || seg_edge_inter.first == geode::POSITION::vertex1 )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:166:22: note: +1
      166 |                      || seg_edge_inter.second == geode::POSITION::vertex1 ) )
          |                      ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:172:47: note: +3, including nesting penalty of 2, nesting level increased to 3
      172 |                                               ? edge_v0
          |                                               ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:182:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      182 |         if( geode::point_triangle_position(
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:185:13: note: +1
      185 |             && geode::point_triangle_position(
          |             ^
  • src/geode/geometry/intersection_detection.cpp:194:39: warning: [readability-identifier-naming]

    invalid case style for function 'segment_segment_intersection_detection3D'

      194 |     geode::SegmentSegmentIntersection segment_segment_intersection_detection3D(
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                       segment_segment_intersection_detection3_d
  • src/geode/geometry/intersection_detection.cpp:251:32: warning: [readability-function-cognitive-complexity]

    function 'colinear_segment_segment_intersection_detection' has cognitive complexity of 18 (threshold 10)

      251 |     SegmentSegmentIntersection colinear_segment_segment_intersection_detection(
          |                                ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:267:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      267 |         if( s0_p0_position == POSITION::inside
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:270:13: note: +1
      270 |             || s1_p1_position == POSITION::inside )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:274:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      274 |         if( s0_p0_position == POSITION::vertex0 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:276:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      276 |             if( s0_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:277:17: note: +1
      277 |                 || s0_p1_position == POSITION::vertex0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:284:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      284 |         if( s0_p0_position == POSITION::vertex1 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:286:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      286 |             if( s0_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:287:17: note: +1
      287 |                 || s0_p1_position == POSITION::vertex1 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:294:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      294 |         if( s1_p0_position == POSITION::vertex0 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:296:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      296 |             if( s1_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:297:17: note: +1
      297 |                 || s1_p1_position == POSITION::vertex0 )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:304:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      304 |         if( s1_p0_position == POSITION::vertex1 )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:306:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      306 |             if( s1_p1_position == POSITION::outside
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/geometry/intersection_detection.cpp:307:17: note: +1
      307 |                 || s1_p1_position == POSITION::vertex1 )
          |                 ^
  • src/geode/geometry/sign.cpp:34:66: warning: [readability-identifier-naming]

    invalid case style for global constant 'new_axis'

       34 |     const std::array< std::array< geode::local_index_t, 2 >, 3 > new_axis{
          |                                                                  ^~~~~~~~
          |                                                                  NEW_AXIS
  • src/geode/geometry/sign.cpp:60:21: warning: [readability-identifier-length]

    variable name 'p1' is too short, expected at least 3 characters

       60 |         const auto& p1 = polygon_vertices[0];
          |                     ^
  • src/geode/geometry/sign.cpp:63:25: warning: [readability-identifier-length]

    variable name 'p2' is too short, expected at least 3 characters

       63 |             const auto& p2 = polygon_vertices[other_index];
          |                         ^
  • src/geode/geometry/sign.cpp:64:25: warning: [readability-identifier-length]

    variable name 'p3' is too short, expected at least 3 characters

       64 |             const auto& p3 = polygon_vertices[static_cast< local_index_t >(
          |                         ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:48:9: warning: [google-explicit-constructor]

    single-argument constructors must be marked explicit to avoid unintentional implicit conversions

       48 |         PolygonOrientationChecker( const geode::SurfaceMesh< dimension >& mesh )
          |         ^
          |         explicit 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:84:14: warning: [readability-function-cognitive-complexity]

    function 'process_polygon_queue' has cognitive complexity of 20 (threshold 10)

       84 |         void process_polygon_queue( absl::FixedArray< bool >& visited )
          |              ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:86:13: note: +1, including nesting penalty of 0, nesting level increased to 1
       86 |             while( !queue_.empty() )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:93:17: note: +2, including nesting penalty of 1, nesting level increased to 2
       93 |                 for( const auto e : geode::LIndices{ vertices } )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:97:21: note: +3, including nesting penalty of 2, nesting level increased to 3
       97 |                     if( !adj )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:101:66: note: +3, including nesting penalty of 2, nesting level increased to 3
      101 |                     const auto e_next = e == vertices.size() - 1 ? 0 : e + 1;
          |                                                                  ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:106:29: note: +1
      106 |                             && vertices[e_next] == adj_vertices[0] );
          |                             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:107:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      107 |                     if( visited[adj->polygon_id] )
          |                     ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:111:33: note: +4, including nesting penalty of 3, nesting level increased to 4
      111 |                                 ? cur_polygon_reorient
          |                                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:127:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      127 |                     if( reorient_polygon_[adj_polygon] )
          |                     ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:136:9: warning: [modernize-use-nodiscard]

    function 'get_bad_oriented_polygons' should be marked [[nodiscard]]

      136 |         absl::FixedArray< geode::index_t > get_bad_oriented_polygons() const
          |         ^
          |         [[nodiscard]] 
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:157:12: warning: [readability-identifier-naming]

    invalid case style for struct 'polygons_area_sign_info'

      157 |     struct polygons_area_sign_info
          |            ^~~~~~~~~~~~~~~~~~~~~~~
          |            PolygonsAreaSignInfo
      158 |     {
      159 |         polygons_area_sign_info( geode::index_t nb_init,
          |         ~~~~~~~~~~~~~~~~~~~~~~~
          |         PolygonsAreaSignInfo
      160 |             geode::index_t nb_polygons,
      161 |             geode::SIGN sign_init )
      162 |             : nb_bad_polygons{ nb_init }, area_sign{ nb_polygons, sign_init }
      163 |         {
      164 |         }
      165 | 
      166 |         geode::index_t nb_bad_polygons;
      167 |         std::queue< geode::index_t > queue;
      168 |         absl::FixedArray< geode::SIGN > area_sign;
      169 |     };
      170 | 
      171 |     polygons_area_sign_info compute_polygon_area_sign(
          |     ~~~~~~~~~~~~~~~~~~~~~~~
          |     PolygonsAreaSignInfo
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:159:34: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'polygons_area_sign_info' of similar type ('geode::index_t') are easily swapped by mistake

      159 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                  ^~~~~~~~~~~~~~~~~~~~~~~
      160 |             geode::index_t nb_polygons,
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:159:49: note: the first parameter in the range is 'nb_init'
      159 |         polygons_area_sign_info( geode::index_t nb_init,
          |                                                 ^~~~~~~
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:160:28: note: the last parameter in the range is 'nb_polygons'
      160 |             geode::index_t nb_polygons,
          |                            ^~~~~~~~~~~
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:197:10: warning: [readability-function-cognitive-complexity]

    function 'process_null_area_polygons' has cognitive complexity of 20 (threshold 10)

      197 |     void process_null_area_polygons( const geode::SurfaceMesh2D& mesh,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:200:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      200 |         while( !area_sign_info.queue.empty() )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:204:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      204 |             for( const auto e :
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:208:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      208 |                 if( mesh.is_edge_on_border( edge ) )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:213:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      213 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:222:25: note: +1
      222 |                         && vertices[1] == adj_vertices[0] );
          |                         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:223:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      223 |                 if( same_orientation )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:229:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      229 |                 if( area_sign_info.area_sign[adj.polygon_id]
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:235:17: note: +1, nesting level increased to 3
      235 |                 else
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:242:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      242 |             if( area_sign_info.area_sign[cur_polygon] == geode::SIGN::zero )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:246:18: note: +1, nesting level increased to 2
      246 |             else if( area_sign_info.area_sign[cur_polygon]
          |                  ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:287:10: warning: [readability-function-cognitive-complexity]

    function 'reorient_bad_polygons' has cognitive complexity of 11 (threshold 10)

      287 |     void reorient_bad_polygons( geode::SurfaceMeshBuilder< dimension >& builder,
          |          ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:291:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      291 |         for( const auto p : bad_polygons )
          |         ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:297:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      297 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:304:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      304 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:309:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      309 |             for( const auto v : geode::LRange{ mesh.nb_polygon_vertices( p ) } )
          |             ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:314:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      314 |                 if( adjacents[v] )
          |                 ^
    /__w/OpenGeode/OpenGeode/src/geode/mesh/helpers/repair_polygon_orientations.cpp:319:17: note: +1, nesting level increased to 3
      319 |                 else
          |                 ^
  • src/geode/mesh/helpers/repair_polygon_orientations.cpp:346:10: warning: [misc-use-internal-linkage]

    function 'repair_polygons_orientations' can be made static or moved into an anonymous namespace to enforce internal linkage

      346 |     void repair_polygons_orientations( const SurfaceMesh< dimension >& mesh,
          |          ^
          |     static 

Have any feedback or feature suggestions? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants