mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-17 01:54:42 +00:00
Corrected wrong managment of malformed stl files
This commit is contained in:
parent
7b292f511c
commit
5d3fbca6ba
@ -85,15 +85,20 @@ void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, const QSt
|
||||
bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterSet &parlst, CallBackPos *cb, QWidget * /*parent*/)
|
||||
{
|
||||
bool normalsUpdated = false;
|
||||
QString errorMsgFormat = "Error encountered while loading file:\n\"%1\"\n\nError details: %2";
|
||||
|
||||
if(!QFile::exists(fileName))
|
||||
{
|
||||
errorMessage = errorMsgFormat.arg(fileName, "File does not exist");
|
||||
return false;
|
||||
}
|
||||
// initializing mask
|
||||
mask = 0;
|
||||
|
||||
// initializing progress bar status
|
||||
if (cb != NULL) (*cb)(0, "Loading...");
|
||||
|
||||
QString errorMsgFormat = "Error encountered while loading file:\n\"%1\"\n\nError details: %2";
|
||||
|
||||
|
||||
//string filename = fileName.toUtf8().data();
|
||||
string filename = QFile::encodeName(fileName).constData();
|
||||
|
||||
@ -119,7 +124,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName,
|
||||
{
|
||||
if (!tri::io::ImporterSTL<CMeshO>::LoadMask(filename.c_str(), mask))
|
||||
{
|
||||
errorMessage = errorMsgFormat.arg(fileName, tri::io::ImporterSTL<CMeshO>::ErrorMsg(tri::io::ImporterSTL<CMeshO>::E_CANTOPEN));
|
||||
errorMessage = errorMsgFormat.arg(fileName, tri::io::ImporterSTL<CMeshO>::ErrorMsg(tri::io::ImporterSTL<CMeshO>::E_MALFORMED));
|
||||
return false;
|
||||
}
|
||||
m.Enable(mask);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user