SMDS: Allow whitespace in the line

This commit is contained in:
Andreas Fabri 2025-03-20 16:52:02 +01:00
parent 46a4ddb88f
commit 648b2bf004
1 changed files with 13 additions and 3 deletions

View File

@ -611,9 +611,11 @@ bool build_triangulation_from_file(std::istream& is,
continue; continue;
} }
if(line == "Vertices") if(line.find("Vertices") != std::string::npos)
{ {
is >> nv; is >> nv;
if(verbose)
std::cerr << "Reading "<< nv << " vertices" << std::endl;
for(int i=0; i<nv; ++i) for(int i=0; i<nv; ++i)
{ {
typename Tr::Geom_traits::FT x,y,z; typename Tr::Geom_traits::FT x,y,z;
@ -627,11 +629,15 @@ bool build_triangulation_from_file(std::istream& is,
} }
} }
if(line == "Triangles") if(line.find("Triangles") != std::string::npos)
{ {
bool has_negative_surface_patch_ids = false; bool has_negative_surface_patch_ids = false;
typename Tr::Cell::Surface_patch_index max_surface_patch_id = 0; typename Tr::Cell::Surface_patch_index max_surface_patch_id = 0;
is >> nf; is >> nf;
if(verbose)
std::cerr << "Reading "<< nf << " triangles" << std::endl;
for(int i=0; i<nf; ++i) for(int i=0; i<nf; ++i)
{ {
int n[3]; int n[3];
@ -680,9 +686,13 @@ bool build_triangulation_from_file(std::istream& is,
} }
} }
if(line == "Tetrahedra") if(line.find("Tetrahedra") != std::string::npos)
{ {
is >> ntet; is >> ntet;
if(verbose)
std::cerr << "Reading "<< ntet << " tetrahedra" << std::endl;
for(int i=0; i<ntet; ++i) for(int i=0; i<ntet; ++i)
{ {
int n[4]; int n[4];