Skip to content
Snippets Groups Projects
Commit 7c89d321 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

check output stream in writing TIN

parent f1f84d35
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,10 @@ GeoLib::Surface* TINInterface::readTIN(std::string const& fname,
void TINInterface::writeSurfaceAsTIN(GeoLib::Surface const& surface, std::string const& file_name)
{
std::ofstream os (file_name.c_str());
if (!os) {
WARN("writeSurfaceAsTIN(): could not open stream to %s.", file_name.c_str());
return;
}
os.precision(std::numeric_limits<double>::digits10);
const std::size_t n_tris (surface.getNTriangles());
for (std::size_t l(0); l < n_tris; l++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment