Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
objectdata.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2017 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 
24 
26 {
27 public:
28  ObjectData();
29 
30  void setCurrentFrame( int n ) { mCurrentFrame = n; }
31  int getCurrentFrame() const { return mCurrentFrame; }
32 
33  void setCurrentColor( QColor c ) { mCurrentColor = c; }
34  QColor getCurrentColor() const { return mCurrentColor; }
35 
36  void setCurrentLayer( int n ) { mCurrentLayer = n; }
37  int getCurrentLayer() const { return mCurrentLayer; }
38 
39  void setCurrentView( QTransform t ) { mCurrentView = t; }
40  QTransform getCurrentView() const { return mCurrentView; }
41 
42  void setFrameRate( int n ) { mFps = n; }
43  int getFrameRate() const { return mFps; }
44 
45  void setLooping( bool b ) { mIsLoop = b; }
46  bool isLooping() const { return mIsLoop; }
47 
48  void setRangedPlayback( bool b ) { mIsRangedPlayback = b; }
49  bool isRangedPlayback() const { return mIsRangedPlayback; }
50 
51  void setMarkInFrameNumber( int n ) { mMarkInFrame = n; }
52  int getMarkInFrameNumber() const { return mMarkInFrame; }
53 
54  void setMarkOutFrameNumber( int n ) { mMarkOutFrame = n; }
55  int getMarkOutFrameNumber() const { return mMarkOutFrame; }
56 
57 private:
58  int mCurrentFrame = 0;
59  QColor mCurrentColor{ 0, 0, 0, 255 };
60  int mCurrentLayer = 2; // Layers are counted bottom up
61  // 0 - Camera Layer
62  // 1 - Vector Layer
63  // 2 - Bitmap Layer
64  // view manager
65  QTransform mCurrentView;
66 
67  // playback manager
68  int mFps = 12;
69  bool mIsLoop = false;
70  bool mIsRangedPlayback = false;
71  int mMarkInFrame = 1;
72  int mMarkOutFrame = 10;
73 
74 };
75 
76 #endif // EDITORSTATE_H