Raise an error message box on ascii stl
This commit is contained in:
parent
236a203320
commit
428aff52a5
4 changed files with 22 additions and 4 deletions
|
@ -8,10 +8,16 @@ Loader::Loader(QObject* parent, const QString& filename)
|
|||
|
||||
void Loader::run()
|
||||
{
|
||||
QTime timer;
|
||||
timer.start();
|
||||
emit got_mesh(Mesh::load_stl(filename));
|
||||
qDebug() << "Time taken:" << timer.elapsed();
|
||||
{ // Verify that this isn't an ascii stl file
|
||||
QFile file(filename);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
if (file.read(5) == "solid")
|
||||
{
|
||||
emit error_ascii_stl();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
emit got_mesh(Mesh::load_stl(filename));
|
||||
emit loaded_file(filename);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue