-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuropener.h
54 lines (49 loc) · 1.33 KB
/
suropener.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
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef SUROPENER_H
#define SUROPENER_H
#include <QString>
#include <QList>
#include <QVector>
class ObjectModel;
class SUROpener
{
public:
static ObjectModel *openSUR(QString fileName);
private:
class Parser
{
public:
Parser(QString fileName);
typedef struct {int first, last;} Group;
typedef struct {int a, b, c;} Incidence;
typedef struct {double x, y, z;} Coordinate;
QList<Group> &getGroups();
QList<Incidence> &getIncidences();
QList<Coordinate> &getCoordinates();
private:
class LineReader
{
public:
LineReader(QString);
QList<QString> getWords();
private:
QList<QString> words;
};
typedef enum {INITIAL = 0, GROUPS, INCIDENCE, COORDINATES, VOLUME} State;
Parser::State state;
QList<Group> groups;
int groupCount;
QList<Incidence> incidences;
QList<Coordinate> coordinates;
int coordinateCount;
void parseLine(QString);
void parseHeader(QString);
bool header(QString);
void removeUselessBlanks(QString &);
void dispatch(QString);
void parseGroup(QString);
void parseIncidence(QString);
void parseCoordinate(QString);
void ignoreLine(QString);
};
};
#endif // SUROPENER_H