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  ~ObjectData() = default;
31 
32  void setCurrentFrame(int n) { mCurrentFrame = n; }
33  int getCurrentFrame() const { return mCurrentFrame; }
34 
35  void setCurrentColor(QColor c) { mCurrentColor = c; }
36  QColor getCurrentColor() const { return mCurrentColor; }
37 
38  void setCurrentLayer(int n) { mCurrentLayer = n; }
39  int getCurrentLayer() const { return mCurrentLayer; }
40 
41  void setCurrentView(QTransform t) { mCurrentView = t; }
42  QTransform getCurrentView() const { return mCurrentView; }
43 
44  void setFrameRate(int n) { mFps = n; }
45  int getFrameRate() const { return mFps; }
46 
47  void setLooping(bool b) { mIsLoop = b; }
48  bool isLooping() const { return mIsLoop; }
49 
50  void setRangedPlayback(bool b) { mIsRangedPlayback = b; }
51  bool isRangedPlayback() const { return mIsRangedPlayback; }
52 
53  void setMarkInFrameNumber(int n) { mMarkInFrame = n; }
54  int getMarkInFrameNumber() const { return mMarkInFrame; }
55 
56  void setMarkOutFrameNumber(int n) { mMarkOutFrame = n; }
57  int getMarkOutFrameNumber() const { return mMarkOutFrame; }
58 
59 private:
60  int mCurrentFrame = 1;
61  QColor mCurrentColor{ 0, 0, 0, 255 };
62  int mCurrentLayer = 0;
63  // view manager
64  QTransform mCurrentView;
65 
66  // playback manager
67  int mFps = 12;
68  bool mIsLoop = false;
69  bool mIsRangedPlayback = false;
70  int mMarkInFrame = 1;
71  int mMarkOutFrame = 10;
72 };
73 
74 #endif // EDITORSTATE_H