Commit a94fa39b authored by Mike Kremer's avatar Mike Kremer

Added compatibility mode for files in old file format without header.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@88 66977474-1d4b-4f09-8fe9-267525286df2
parent 2a34c296
......@@ -84,6 +84,8 @@ bool FileManager::readFile(const std::string& _filename, MeshT& _mesh,
* Header
*/
bool header_found = true;
// Get first line
getCleanLine(iff, line);
sstr.str(line);
......@@ -92,9 +94,10 @@ bool FileManager::readFile(const std::string& _filename, MeshT& _mesh,
sstr >> s_tmp;
std::transform(s_tmp.begin(), s_tmp.end(), s_tmp.begin(), ::toupper);
if(s_tmp != "OVM") {
iff.close();
std::cerr << "The specified file is not in OpenVolumeMesh format!" << std::endl;
return false;
//iff.close();
header_found = false;
std::cerr << "The specified might not be in OpenVolumeMesh format!" << std::endl;
//return false;
}
// Get ASCII/BINARY string
......@@ -109,9 +112,14 @@ bool FileManager::readFile(const std::string& _filename, MeshT& _mesh,
/*
* Vertices
*/
if(!header_found) {
sstr.clear();
sstr.str(line);
} else {
getCleanLine(iff, line);
sstr.clear();
sstr.str(line);
}
sstr >> s_tmp;
std::transform(s_tmp.begin(), s_tmp.end(), s_tmp.begin(), ::toupper);
......
......@@ -156,6 +156,8 @@ public:
typedef std::vector<Face> Faces;
typedef std::vector<Cell> Cells;
typedef VecT PointT;
//=====================================================================
// Constructors/Destructor
//=====================================================================
......
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