X-Git-Url: https://git.sur5r.net/?p=fstl;a=blobdiff_plain;f=src%2Floader.h;fp=src%2Floader.h;h=006f1d1d1469a5524c4d2fdc0a1c7168aad4639d;hp=fb0c8d81eb10bf8a610fb38a4345dfa2f65ce6ea;hb=5dd213695da2eb22219ac5143aa8b5cfe7c89559;hpb=967d178c4343c689c728571bb10d5c94ab8d9d13 diff --git a/src/loader.h b/src/loader.h index fb0c8d8..006f1d1 100644 --- a/src/loader.h +++ b/src/loader.h @@ -9,21 +9,32 @@ class Loader : public QThread { Q_OBJECT public: - explicit Loader(QObject* parent, const QString& filename); + explicit Loader(QObject* parent, const QString& filename, bool is_reload); void run(); protected: Mesh* load_stl(); + /* Reads an ASCII stl, starting from the start of the file*/ + Mesh* read_stl_ascii(QFile& file); + /* Reads a binary stl, assuming we're at the end of the header */ + Mesh* read_stl_binary(QFile& file); + signals: void loaded_file(QString filename); - void got_mesh(Mesh* m); + void got_mesh(Mesh* m, bool is_reload); - void error_ascii_stl(); void error_bad_stl(); + void error_empty_mesh(); + void warning_confusing_stl(); + void error_missing_file(); private: const QString filename; + bool is_reload; + + /* Used to warn on binary STLs that begin with the word 'solid'" */ + bool confusing_stl; };