From 216a50846ada4efe45a9d97e507d3dd0f789deda Mon Sep 17 00:00:00 2001 From: Date: Tue, 16 Apr 2019 14:07:29 +0200 Subject: [PATCH] update exeption test remove usless implementation of create mesh --- src/ringmesh/mesh/line_mesh.cpp | 2 +- src/ringmesh/mesh/point_set_mesh.cpp | 28 ---------------------------- src/ringmesh/mesh/surface_mesh.cpp | 2 +- src/ringmesh/mesh/volume_mesh.cpp | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/ringmesh/mesh/line_mesh.cpp b/src/ringmesh/mesh/line_mesh.cpp index 88f43a8ee..21d9706f7 100644 --- a/src/ringmesh/mesh/line_mesh.cpp +++ b/src/ringmesh/mesh/line_mesh.cpp @@ -55,7 +55,7 @@ namespace RINGMesh MeshType new_type = type; if( new_type.empty() ) { - if( !PointSetMeshFactory< DIMENSION >::has_creator( + if( !LineMeshFactory< DIMENSION >::has_creator( "GeogramPointSetMesh" ) ) { throw RINGMeshException( diff --git a/src/ringmesh/mesh/point_set_mesh.cpp b/src/ringmesh/mesh/point_set_mesh.cpp index 59fcf8d03..1e5ba5870 100644 --- a/src/ringmesh/mesh/point_set_mesh.cpp +++ b/src/ringmesh/mesh/point_set_mesh.cpp @@ -86,34 +86,6 @@ namespace RINGMesh return std::make_tuple( nb_compoments, components ); } - template < index_t DIMENSION > - std::unique_ptr< LineMesh< DIMENSION > > LineMesh< DIMENSION >::create_mesh( - const MeshType type ) - { - MeshType new_type = type; - if( new_type.empty() ) - { - if( !PointSetMeshFactory< DIMENSION >::has_creator( - "GeogramPointSetMesh" ) ) - { - throw RINGMeshException( - "LineMesh", "Default mesh data structure not registered" ); - } - return create_mesh( "GeogramLineMesh" ); - } - auto mesh = LineMeshFactory< DIMENSION >::create( new_type ); - if( !mesh ) - { - Logger::warn( "LineMesh", - "Could not create mesh data structure: ", new_type ); - Logger::warn( - "LineMesh", "Falling back to GeogramLineMesh data structure" ); - - return create_mesh(); - } - return mesh; - } - template class mesh_api PointSetMesh< 2 >; template class mesh_api PointSetMesh< 3 >; } // namespace RINGMesh diff --git a/src/ringmesh/mesh/surface_mesh.cpp b/src/ringmesh/mesh/surface_mesh.cpp index 49fbfa6d5..bbe2dfa04 100644 --- a/src/ringmesh/mesh/surface_mesh.cpp +++ b/src/ringmesh/mesh/surface_mesh.cpp @@ -53,7 +53,7 @@ namespace RINGMesh MeshType new_type = type; if( new_type.empty() ) { - if( !PointSetMeshFactory< DIMENSION >::has_creator( + if( !SurfaceMeshFactory< DIMENSION >::has_creator( "GeogramPointSetMesh" ) ) { throw RINGMeshException( "SurfaceMesh", diff --git a/src/ringmesh/mesh/volume_mesh.cpp b/src/ringmesh/mesh/volume_mesh.cpp index 441293d5d..b091caa08 100644 --- a/src/ringmesh/mesh/volume_mesh.cpp +++ b/src/ringmesh/mesh/volume_mesh.cpp @@ -53,7 +53,7 @@ namespace RINGMesh auto new_type = type; if( new_type.empty() ) { - if( !PointSetMeshFactory< DIMENSION >::has_creator( + if( !VolumeMeshFactory< DIMENSION >::has_creator( "GeogramPointSetMesh" ) ) { throw RINGMeshException( "VolumeMesh",