@@ -33,45 +33,54 @@ ABSL_FLAG( bool, degeneration, true, "Toggle degeneration criterion" );
3333ABSL_FLAG ( bool , manifold_vertex, true , " Toggle manifold vertex criterion" );
3434ABSL_FLAG ( bool , manifold_edge, true , " Toggle manifold edge criterion" );
3535
36- void inspect_surface ( const geode::SurfaceMesh3D& surface )
36+ template < geode::index_t dimension >
37+ void inspect_surface ( const geode::SurfaceMesh< dimension >& surface )
3738{
3839 absl::InlinedVector< async::task< void >, 5 > tasks;
3940 if ( absl::GetFlag ( FLAGS_adjacency ) )
4041 {
4142 tasks.emplace_back ( async::spawn ( [&surface] {
42- const geode::SurfaceMeshAdjacency3D adjacency{ surface };
43+ const geode::SurfaceMeshAdjacency< dimension > adjacency{ surface };
4344 const auto nb = adjacency.nb_edges_with_wrong_adjacency ();
4445 geode::Logger::info ( nb, " edges with wrong adjacency" );
4546 } ) );
4647 }
4748 if ( absl::GetFlag ( FLAGS_colocation ) )
4849 {
4950 tasks.emplace_back ( async::spawn ( [&surface] {
50- const geode::SurfaceMeshColocation3D colocation{ surface };
51+ const geode::SurfaceMeshColocation< dimension > colocation{
52+ surface
53+ };
5154 const auto nb = colocation.nb_colocated_points ();
5255 geode::Logger::info ( nb, " colocated points" );
5356 } ) );
5457 }
5558 if ( absl::GetFlag ( FLAGS_degeneration ) )
5659 {
5760 tasks.emplace_back ( async::spawn ( [&surface] {
58- const geode::SurfaceMeshDegeneration3D degeneration{ surface };
61+ const geode::SurfaceMeshDegeneration< dimension > degeneration{
62+ surface
63+ };
5964 const auto nb = degeneration.nb_degenerated_edges ();
6065 geode::Logger::info ( nb, " degenerated edges" );
6166 } ) );
6267 }
6368 if ( absl::GetFlag ( FLAGS_manifold_vertex ) )
6469 {
6570 tasks.emplace_back ( async::spawn ( [&surface] {
66- const geode::SurfaceMeshVertexManifold3D manifold_vertex{ surface };
71+ const geode::SurfaceMeshVertexManifold< dimension > manifold_vertex{
72+ surface
73+ };
6774 const auto nb = manifold_vertex.nb_non_manifold_vertices ();
6875 geode::Logger::info ( nb, " non manifold vertices" );
6976 } ) );
7077 }
7178 if ( absl::GetFlag ( FLAGS_manifold_edge ) )
7279 {
7380 tasks.emplace_back ( async::spawn ( [&surface] {
74- const geode::SurfaceMeshEdgeManifold3D manifold_edge{ surface };
81+ const geode::SurfaceMeshEdgeManifold< dimension > manifold_edge{
82+ surface
83+ };
7584 const auto nb = manifold_edge.nb_non_manifold_edges ();
7685 geode::Logger::info ( nb, " non manifold edges" );
7786 } ) );
@@ -105,6 +114,16 @@ int main( int argc, char* argv[] )
105114 inspect_surface (
106115 *geode::load_triangulated_surface< 3 >( filename ) );
107116 }
117+ else if ( geode::TriangulatedSurfaceInputFactory2D::has_creator ( ext ) )
118+ {
119+ inspect_surface (
120+ *geode::load_triangulated_surface< 2 >( filename ) );
121+ }
122+ else if ( geode::PolygonalSurfaceInputFactory2D::has_creator ( ext ) )
123+ {
124+ inspect_surface (
125+ *geode::load_triangulated_surface< 2 >( filename ) );
126+ }
108127 else
109128 {
110129 throw geode::OpenGeodeException ( " Unable to load file " , filename );
0 commit comments