-
Notifications
You must be signed in to change notification settings - Fork 3
/
loader.h
42 lines (31 loc) · 899 Bytes
/
loader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LOADER_H
#define LOADER_H
#include <QThread>
#include "mesh.h"
class Loader : public QThread
{
Q_OBJECT
public:
explicit Loader(QObject* parent, const QString& filename, bool is_reload);
void run();
static Mesh* empty_mesh();
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, bool is_reload);
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;
};
#endif // LOADER_H