Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • structure
objectdata.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU 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
26class ObjectData
27{
28public:
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
59private:
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
ObjectData
Definition: objectdata.h:27
QColor
QTransform
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39