Commit 5b0a9d91 authored by Isaak Lim's avatar Isaak Lim
Browse files

don't emit an OM error message for every face that could not be added

parent 421c318b
Pipeline #1285 passed with stage
......@@ -655,6 +655,10 @@ void FileOBJPlugin::readOBJFile(QByteArray& _bufferedFile, QString _filename, OB
// Now add all meshes for every group (if exists)
createAllGroupObjects(_importer);
const bool omerr_enabled = omerr().is_enabled();
if (omerr_enabled)
omerr().disable();
while( !input.atEnd() )
{
line=input.readLine();
......@@ -1249,6 +1253,9 @@ void FileOBJPlugin::readOBJFile(QByteArray& _bufferedFile, QString _filename, OB
}
if (omerr_enabled)
omerr().enable();
//checks, if an object with a specified type was added. if not, point cloud was read
bool isType = faceCount != 0;
......
......@@ -752,6 +752,10 @@ bool FileOFFPlugin::parseASCII(std::istream& _in, OFFImporter& _importer, DataTy
break;
}
const bool omerr_enabled = omerr().is_enabled();
if (omerr_enabled)
omerr().disable();
// faces
// #N <v1> <v2> .. <v(n-1)> [color spec]
for (uint i=0; i<nF; ++i)
......@@ -858,6 +862,9 @@ bool FileOFFPlugin::parseASCII(std::istream& _in, OFFImporter& _importer, DataTy
}
}
if (omerr_enabled)
omerr().enable();
// File was successfully parsed.
return true;
}
......@@ -968,6 +975,10 @@ bool FileOFFPlugin::parseBinary(std::istream& _in, OFFImporter& _importer, DataT
// Reserve memory
_importer.reserve(nV, nF * _importer.maxFaceValence() /*Upper bound*/, nF);
const bool omerr_enabled = omerr().is_enabled();
if (omerr_enabled)
omerr().disable();
// read vertices: coord [hcoord] [normal] [color] [texcoord]
for (uint i=0; i<nV && !_in.eof(); ++i)
{
......@@ -1139,6 +1150,9 @@ bool FileOFFPlugin::parseBinary(std::istream& _in, OFFImporter& _importer, DataT
}
}
if (omerr_enabled)
omerr().enable();
// File was successfully parsed.
return true;
}
......
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