Commit 92240200 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Added utility in viewer to export a mesh into all available exported types.

Added utility in viewer to do this in command-line using 2 arguments : for example "./viewer input.off output.ply"
A set of data is btw available here : http://canaris.u-strasbg.fr/~kenneth/share/DataGeometry/
parent 493aa1ac
......@@ -175,7 +175,7 @@ void Viewer::cb_Open()
void Viewer::cb_Save()
{
std::string filters("all (*.*);; off (*.off);; ply (*.ply);; plygen (*.plygen)") ;
std::string filters("all (*.*);; map (*.map);; off (*.off);; ply (*.ply);; plygen (*.plygen)") ;
std::string filename = selectFileSave("Save Mesh", "", filters) ;
exportMesh(filename) ;
......@@ -231,10 +231,12 @@ void Viewer::exportMesh(std::string& filename)
std::string extension = filename.substr(pos) ;
if (extension.compare(std::string(".off")) == 0)
if (extension == std::string(".off"))
Algo::Export::exportOFF<PFP>(myMap, position, filename.c_str(), allDarts) ;
else if (extension.compare(0, 4, std::string(".ply")) == 0)
Algo::Export::exportPLY<PFP>(myMap, position, filename.c_str(), allDarts) ;
else if (extension == std::string(".map"))
myMap.saveMapBin(filename) ;
else
std::cerr << "Cannot save file " << filename << " : unknown or unhandled extension" << std::endl ;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment