-
Notifications
You must be signed in to change notification settings - Fork 1
/
frameparser.h
47 lines (42 loc) · 1.18 KB
/
frameparser.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
#ifndef FRAMEPARSER_H
#define FRAMEPARSER_H
#include "scene.h"
#include "scene2d.h"
#include <Qt>
class FrameParser
{
public:
FrameParser(Scene *scene);
FrameParser(Scene *scene, const QString &fileName);
bool setInputFile(const QString &fileName);
QString getOutPut();
bool nextFrame(bool stopAtEachFrame = false);
void removeObj(Item *&item);
void reset();
void outPutItem(Item *item);
void outPutTranslation(Item *item, int dx, int dy);
void outPutRotation(Item *item, int x, int y, int angle);
void outPutScaling(Item *item, float sx, float sy);
void outPutReflection(Item *item, int x, int y);
void outPutDeletion(Item *item);
void outPutClear();
void outPutChangeColor(Item *item, const QColor &color);
void outPutFillColor(Item *item, const QColor &color);
void outPutAddition();
protected:
void add();
void trans();
void rotate();
void scale();
void reflect();
void doDelete();
void doClear();
void changeColor();
void fillColor();
private:
Scene *scene;
QString outStream, inStream;
QTextStream in, out;
std::map<QString, Item*> objs;
};
#endif // FRAMEPARSER_H