Use BGL API instead of assuming graph.clear() exists

This commit is contained in:
Mael Rouxel-Labbé 2023-05-15 12:42:13 +02:00
parent 7a3ad05e05
commit 34a9756836
5 changed files with 10 additions and 11 deletions

View File

@ -172,7 +172,7 @@ bool read_STL(const std::string& fname,
{
return true;
}
g.clear();
clear(g);
}
std::ifstream is(fname);
CGAL::IO::set_mode(is, CGAL::IO::ASCII);

View File

@ -45,25 +45,25 @@ bool read_polygon_mesh(std::istream& is,
ok = read_OFF(is, g, np, false);
if(ok)
return true;
g.clear();
clear(g);
is.clear();//reset the error state
is.seekg (0, is.beg);
ok = read_OBJ(is, g, np, false);
if(ok)
return true;
g.clear();
clear(g);
is.clear();
is.seekg (0, is.beg);
ok = read_PLY(is, g, np, false);
if(ok)
return true;
g.clear();
clear(g);
is.clear();
is.seekg (0, is.beg);
ok = read_STL(is, g, np, false);
if(ok)
return true;
g.clear();
clear(g);
is.clear();
is.seekg (0, is.beg);
ok = read_GOCAD(is, g, np, false);

View File

@ -489,7 +489,7 @@ void test_invalid_selections()
assert(pinched_fg.is_selection_valid());
// this creates a non-manifold vertex (multiple umbrellas)
clear(mesh);
CGAL::clear(mesh);
read_a_mesh(mesh, "data/genus3.off");
assert(is_valid_polygon_mesh(mesh));

View File

@ -122,7 +122,7 @@ void test_bgl_OFF(const std::string filename)
assert(ok);
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
is.close();
fg.clear();
CGAL::clear(fg);
is.open(filename, std::ios::binary);
ok = CGAL::IO::read_OFF(is, fg);
@ -286,7 +286,7 @@ void test_bgl_OFF(const std::string filename)
for(auto f : faces(fg))
assert(get(fcm2, f) != CGAL::IO::Color());
fg.clear();
CGAL::clear(fg);
is.close();
is.open("data/full.off");
@ -478,7 +478,7 @@ void test_bgl_PLY(const std::string filename,
assert(filename != CGAL::data_file_path("meshes/colored_tetra.ply") || (num_vertices(fg) == 4 && num_faces(fg) == 4));
if(!binary)
{
fg.clear();
CGAL::clear(fg);
is.open(filename, std::ios::binary);
bool ok = CGAL::IO::read_PLY(is, fg, CGAL::parameters::use_binary_mode(false));
is.close();
@ -711,7 +711,6 @@ void test_bgl_GOCAD(const char* filename)
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
is.seekg(0);
fg.clear();
CGAL::clear(fg);
std::pair<std::string, std::string> name_and_color;
ok = CGAL::IO::read_GOCAD(is, name_and_color, fg);

View File

@ -43,7 +43,7 @@ void create_mesh_with_cc_to_orient(Mesh& mesh)
}
// load the soup into the mesh;
mesh.clear();
CGAL::clear(mesh);
PMP::polygon_soup_to_polygon_mesh(points, triangles, mesh);
}