4 Loader::Loader(QObject* parent, const QString& filename)
5 : QThread(parent), filename(filename)
12 { // Verify that this isn't an ascii stl file
14 file.open(QIODevice::ReadOnly);
15 if (file.read(5) == "solid")
17 emit error_ascii_stl();
21 // Skip the rest of the buffer
24 // Assume we're on a little-endian system for simplicity
26 file.read(reinterpret_cast<char*>(&tri_count), sizeof(tri_count));
28 if (file.size() != 84 + tri_count*50)
35 emit got_mesh(Mesh::load_stl(filename));
36 emit loaded_file(filename);