All Classes Namespaces Functions Variables Enumerations Properties Pages
objectdata.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 
18 #ifndef EDITORSTATE_H
19 #define EDITORSTATE_H
20 
21 #include <QColor>
22 #include <QTransform>
23 #include "pencildef.h"
24 
25 
27 {
28 public:
29  ObjectData();
30 
31  void setCurrentFrame(int n) { mCurrentFrame = n; }
32  int getCurrentFrame() const { return mCurrentFrame; }
33 
34  void setCurrentColor(QColor c) { mCurrentColor = c; }
35  QColor getCurrentColor() const { return mCurrentColor; }
36 
37  void setCurrentLayer(int n) { mCurrentLayer = n; }
38  int getCurrentLayer() const { return mCurrentLayer; }
39 
40  void setCurrentView(QTransform t) { mCurrentView = t; }
41  QTransform getCurrentView() const { return mCurrentView; }
42 
43  void setFrameRate(int n) { mFps = n; }
44  int getFrameRate() const { return mFps; }
45 
46  void setLooping(bool b) { mIsLoop = b; }
47  bool isLooping() const { return mIsLoop; }
48 
49  void setRangedPlayback(bool b) { mIsRangedPlayback = b; }
50  bool isRangedPlayback() const { return mIsRangedPlayback; }
51 
52  void setMarkInFrameNumber(int n) { mMarkInFrame = n; }
53  int getMarkInFrameNumber() const { return mMarkInFrame; }
54 
55  void setMarkOutFrameNumber(int n) { mMarkOutFrame = n; }
56  int getMarkOutFrameNumber() const { return mMarkOutFrame; }
57 
58 private:
59  int mCurrentFrame = 1;
60  QColor mCurrentColor{ 0, 0, 0, 255 };
61  int mCurrentLayer = 2; // Layers are counted bottom up
62  // 0 - Camera Layer
63  // 1 - Vector Layer
64  // 2 - Bitmap Layer
65  // view manager
66  QTransform mCurrentView;
67 
68  // playback manager
69  int mFps = 12;
70  bool mIsLoop = false;
71  bool mIsRangedPlayback = false;
72  int mMarkInFrame = 1;
73  int mMarkOutFrame = 10;
74 
75 };
76 
77 #endif // EDITORSTATE_H