Skip to content

Commit

Permalink
fix(OG-inspector): renaming enum with uppercase names
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit2776 committed Jul 11, 2024
1 parent 458d62e commit 6697530
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
32 changes: 16 additions & 16 deletions src/geode/inspector/criterion/intersections/model_intersections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ namespace
};

geode::local_index_t model_vertex_position_to_index(
geode::Position position )
geode::POSITION position )
{
if( position == geode::Position::vertex0 )
if( position == geode::POSITION::vertex0 )
{
return 0;
}
if( position == geode::Position::vertex1 )
if( position == geode::POSITION::vertex1 )
{
return 1;
}
if( position == geode::Position::vertex2 )
if( position == geode::POSITION::vertex2 )
{
return 2;
}
Expand All @@ -92,7 +92,7 @@ namespace
mesh2_( same_surface_
? mesh1_
: surface2_.template mesh<
geode::TriangulatedSurface< Model::dim > >() )
geode::TriangulatedSurface< Model::dim > >() )
{
}

Expand Down Expand Up @@ -170,7 +170,7 @@ namespace
const geode::uuid& surface_id1,
const geode::uuid& surface_id2 )
: ModelSurfacesIntersectionBase< Model >(
model, surface_id1, surface_id2 ),
model, surface_id1, surface_id2 ),
same_surface_{ surface_id1 == surface_id2 }
{
}
Expand Down Expand Up @@ -208,7 +208,7 @@ namespace
const geode::uuid& surface_id1,
const geode::uuid& surface_id2 )
: ModelSurfacesIntersectionBase< Model >(
model, surface_id1, surface_id2 ),
model, surface_id1, surface_id2 ),
same_surface_{ surface_id1 == surface_id2 }
{
}
Expand Down Expand Up @@ -274,21 +274,21 @@ namespace
if( geode::segment_segment_intersection_detection(
{ common_pt0, t1_third_pt }, { common_pt1, t2_third_pt } )
.first
!= geode::Position::outside
!= geode::POSITION::outside
|| geode::segment_segment_intersection_detection(
{ common_pt1, t1_third_pt },
{ common_pt0, t2_third_pt } )
.first
!= geode::Position::outside )
!= geode::POSITION::outside )
{
return true;
}
const auto t1 = mesh1_.triangle( t1_id );
const auto t2 = mesh2_.triangle( t2_id );
if( geode::point_triangle_position( t1_third_pt, t2 )
!= geode::Position::outside
!= geode::POSITION::outside
|| geode::point_triangle_position( t2_third_pt, t1 )
!= geode::Position::outside )
!= geode::POSITION::outside )
{
return true;
}
Expand All @@ -312,8 +312,8 @@ namespace
geode::segment_segment_intersection_detection(
t1_edge, { mesh2_.point( edge2_vertices[0] ),
mesh2_.point( edge2_vertices[1] ) } );
if( edge_edge_inter.first == geode::Position::outside
|| edge_edge_inter.first == geode::Position::parallel )
if( edge_edge_inter.first == geode::POSITION::outside
|| edge_edge_inter.first == geode::POSITION::parallel )
{
continue;
}
Expand Down Expand Up @@ -353,7 +353,7 @@ namespace
const auto v2_id = v_id == 2 ? 0 : v_id + 1;
const auto intersection = segment_triangle_intersection_detection(
{ t1.vertices()[v_id], t1.vertices()[v2_id] }, t2 );
if( intersection.first != geode::Position::outside )
if( intersection.first != geode::POSITION::outside )
{
if( common_vertices.size() != 1 )
{
Expand Down Expand Up @@ -397,12 +397,12 @@ namespace
if( geode::segment_triangle_intersection_detection(
{ mesh1_.point( common_vertices[0][0] ), t1_third_pt }, t2 )
.first
== geode::Position::parallel
== geode::POSITION::parallel
|| geode::segment_triangle_intersection_detection(
{ mesh1_.point( common_vertices[1][0] ), t1_third_pt },
t2 )
.first
== geode::Position::parallel )
== geode::POSITION::parallel )
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace
{
if( geode::point_triangle_position(
segment.vertices()[ev].get(), triangle )
== geode::Position::inside )
== geode::POSITION::inside )
{
return true;
}
Expand All @@ -143,11 +143,11 @@ namespace
surface_.point( edge_vertices[1] ) };
const auto result =
geode::segment_segment_intersection_detection( segment, edge );
if( result.first == geode::Position::inside )
if( result.first == geode::POSITION::inside )
{
return true;
}
if( result.second == geode::Position::inside )
if( result.second == geode::POSITION::inside )
{
return true;
}
Expand All @@ -165,41 +165,41 @@ namespace
{
if( geode::point_triangle_position(
segment.vertices()[ev].get(), triangle )
== geode::Position::inside )
== geode::POSITION::inside )
{
return true;
}
}
const auto result =
geode::segment_triangle_intersection_detection( segment, triangle );
if( result.first == geode::Position::outside
|| result.second == geode::Position::outside )
if( result.first == geode::POSITION::outside
|| result.second == geode::POSITION::outside )
{
return false;
}

if( result.first == geode::Position::inside )
if( result.first == geode::POSITION::inside )
{
return true;
}

if( result.second == geode::Position::inside
|| result.second == geode::Position::edge0
|| result.second == geode::Position::edge1
|| result.second == geode::Position::edge2 )
if( result.second == geode::POSITION::inside
|| result.second == geode::POSITION::edge0
|| result.second == geode::POSITION::edge1
|| result.second == geode::POSITION::edge2 )
{
return true;
}

if( result.first == geode::Position::parallel )
if( result.first == geode::POSITION::parallel )
{
for( const auto ev : geode::LRange{ 2 } )
{
const auto position = geode::point_triangle_position(
segment.vertices()[ev].get(), triangle );
if( position != geode::Position::vertex0
&& position != geode::Position::vertex1
&& position != geode::Position::vertex2 )
if( position != geode::POSITION::vertex0
&& position != geode::POSITION::vertex1
&& position != geode::POSITION::vertex2 )
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
namespace
{
geode::local_index_t surface_vertex_position_to_index(
geode::Position position )
geode::POSITION position )
{
if( position == geode::Position::vertex0 )
if( position == geode::POSITION::vertex0 )
{
return 0;
}
if( position == geode::Position::vertex1 )
if( position == geode::POSITION::vertex1 )
{
return 1;
}
if( position == geode::Position::vertex2 )
if( position == geode::POSITION::vertex2 )
{
return 2;
}
Expand Down Expand Up @@ -211,21 +211,21 @@ namespace
if( geode::segment_segment_intersection_detection(
{ common_pt0, t1_third_pt }, { common_pt1, t2_third_pt } )
.first
!= geode::Position::outside
!= geode::POSITION::outside
|| geode::segment_segment_intersection_detection(
{ common_pt1, t1_third_pt },
{ common_pt0, t2_third_pt } )
.first
!= geode::Position::outside )
!= geode::POSITION::outside )
{
return true;
}
const auto t1 = mesh_.triangle( t1_id );
const auto t2 = mesh_.triangle( t2_id );
if( geode::point_triangle_position( t1_third_pt, t2 )
!= geode::Position::outside
!= geode::POSITION::outside
|| geode::point_triangle_position( t2_third_pt, t1 )
!= geode::Position::outside )
!= geode::POSITION::outside )
{
return true;
}
Expand All @@ -249,8 +249,8 @@ namespace
geode::segment_segment_intersection_detection(
t1_edge, { mesh_.point( edge2_vertices[0] ),
mesh_.point( edge2_vertices[1] ) } );
if( edge_edge_inter.first == geode::Position::outside
|| edge_edge_inter.first == geode::Position::parallel )
if( edge_edge_inter.first == geode::POSITION::outside
|| edge_edge_inter.first == geode::POSITION::parallel )
{
continue;
}
Expand Down Expand Up @@ -289,7 +289,7 @@ namespace
const auto v2_id = v_id == 2 ? 0 : v_id + 1;
const auto intersection = segment_triangle_intersection_detection(
{ t1.vertices()[v_id], t1.vertices()[v2_id] }, t2 );
if( intersection.first != geode::Position::outside )
if( intersection.first != geode::POSITION::outside )
{
if( common_points.size() != 1 )
{
Expand Down Expand Up @@ -331,11 +331,11 @@ namespace
if( geode::segment_triangle_intersection_detection(
{ mesh_.point( common_points[0] ), t1_third_pt }, t2 )
.first
== geode::Position::parallel
== geode::POSITION::parallel
|| geode::segment_triangle_intersection_detection(
{ mesh_.point( common_points[1] ), t1_third_pt }, t2 )
.first
== geode::Position::parallel )
== geode::POSITION::parallel )
{
return true;
}
Expand Down

0 comments on commit 6697530

Please sign in to comment.