| 36 | namespace geode |
| 37 | { |
| 38 | std::unique_ptr< Graph > load_graph( |
| 39 | const MeshImpl& impl, std::string_view filename ) |
| 40 | { |
| 41 | constexpr auto TYPE = "Graph"; |
| 42 | try |
| 43 | { |
| 44 | auto graph = detail::geode_object_input_impl< GraphInputFactory >( |
| 45 | TYPE, filename, impl ); |
| 46 | Logger::info( TYPE, " has: ", graph->nb_vertices(), " vertices, ", |
| 47 | graph->nb_edges(), " edges" ); |
| 48 | return graph; |
| 49 | } |
| 50 | catch( const OpenGeodeException& e ) |
| 51 | { |
| 52 | Logger::error( e.what() ); |
| 53 | print_available_extensions< GraphInputFactory >( TYPE ); |
| 54 | Logger::info( "Other extensions are available in parent classes." ); |
| 55 | print_available_extensions< VertexSetInputFactory >( "VertexSet" ); |
| 56 | throw OpenGeodeMeshException{ nullptr, |
| 57 | OpenGeodeException::TYPE::internal, |
| 58 | "Cannot load Graph from file: ", filename }; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | std::unique_ptr< Graph > load_graph( std::string_view filename ) |
| 63 | { |