1 
2 
3 #include "toonz/stage2.h"
4 #include "toonz/imagemanager.h"
5 #include "toonz/txshleveltypes.h"
6 #include "toonz/txshsimplelevel.h"
7 #include "toonz/toonzfolders.h"
8 #include "toonz/glrasterpainter.h"
9 #include "tpalette.h"
10 #include "tropcm.h"
11 #include "tcolorfunctions.h"
12 #include "tgl.h"
13 #include "tvectorgl.h"
14 #include "tvectorrenderdata.h"
15 #include "tstream.h"
16 #include "tsystem.h"
17 #include "tstencilcontrol.h"
18 #include "tvectorimage.h"
19 #include "trasterimage.h"
20 #include <QAction>
21 //=============================================================================
22 namespace Stage {
23 //-----------------------------------------------------------------------------
24 
25 const double bigBoxSize[] = {500, 500, 1000};
26 
27 //=============================================================================
28 
29 //-----------------------------------------------------------------------------
30 }  // namespace Stage
31 //=============================================================================
32 
33 // for all the checks: transparency check, etc.
34 
instance()35 ToonzCheck *ToonzCheck::instance() {
36   static ToonzCheck _instance;
37   return &_instance;
38 }
39 
40 //=============================================================================
41 /*! \class CameraTestCheck
42                 \brief The CameraTestCheck class allows visualization in
43    "CameraTest" mode, from cleanup menu
44 */
45 //=============================================================================
46 
CameraTestCheck()47 CameraTestCheck::CameraTestCheck() : m_toggle(0) {}
48 
49 //-----------------------------------------------------------------------------
50 /*! Return current \b CameraTestCheck instance.
51 */
instance()52 CameraTestCheck *CameraTestCheck::instance() {
53   static CameraTestCheck _instance;
54   return &_instance;
55 }
56 
57 //-----------------------------------------------------------------------------
58 
isEnabled() const59 bool CameraTestCheck::isEnabled() const {
60   return m_toggle ? m_toggle->isChecked() : false;
61 }
62 
63 //-----------------------------------------------------------------------------
64 
setIsEnabled(bool on)65 void CameraTestCheck::setIsEnabled(bool on) {
66   if (!m_toggle) return;
67 
68   if (m_toggle->isChecked() != on)
69     m_toggle->trigger();  // Please, note that this is different than using
70                           // setEnabled(bool)
71 }
72 
73 //-----------------------------------------------------------------------------
74 
setToggle(QAction * toggle)75 void CameraTestCheck::setToggle(QAction *toggle) { m_toggle = toggle; }
76 
77 //-----------------------------------------------------------------------------
78 /*! Boot \b CameraTestCheck color to color saved in file \b tcheckColors.xml.
79 */
80 
81 //=============================================================================
82 /*! \class CleanupViewCheck
83                 \brief The CameraTestCheck class allows visualization in
84    "CameraTest" mode, from cleanup menu
85 */
86 //=============================================================================
87 
CleanupPreviewCheck()88 CleanupPreviewCheck::CleanupPreviewCheck() : m_toggle(0) {}
89 
90 //-----------------------------------------------------------------------------
91 /*! Return current \b TransparencyCheck instance.
92 */
instance()93 CleanupPreviewCheck *CleanupPreviewCheck::instance() {
94   static CleanupPreviewCheck _instance;
95   return &_instance;
96 }
97 
98 //-----------------------------------------------------------------------------
99 
isEnabled() const100 bool CleanupPreviewCheck::isEnabled() const {
101   return m_toggle ? m_toggle->isChecked() : false;
102 }
103 
104 //-----------------------------------------------------------------------------
105 
setIsEnabled(bool on)106 void CleanupPreviewCheck::setIsEnabled(bool on) {
107   if (!m_toggle) return;
108 
109   if (m_toggle->isChecked() != on)
110     m_toggle->trigger();  // Please, note that this is different than using
111                           // setEnabled(bool)
112 }
113 
114 //-----------------------------------------------------------------------------
115 
setToggle(QAction * toggle)116 void CleanupPreviewCheck::setToggle(QAction *toggle) { m_toggle = toggle; }
117 
118 //=============================================================================
119 /*! \class SetScanCropBoxCheck
120                 \brief The SetScanCropBoxCheck class allows visualization in
121    "Set Crop Box" mode, from scan menu
122 */
123 //=============================================================================
124 
SetScanCropboxCheck()125 SetScanCropboxCheck::SetScanCropboxCheck() : m_enabled(false), m_toggle(0) {}
126 
127 //-----------------------------------------------------------------------------
128 
129 /*! Return current \b SetScanCropBoxCheck instance.
130 */
instance()131 SetScanCropboxCheck *SetScanCropboxCheck::instance() {
132   static SetScanCropboxCheck _instance;
133   return &_instance;
134 }
135 
136 //-----------------------------------------------------------------------------
137 
setToggle(QAction * toggle)138 void SetScanCropboxCheck::setToggle(QAction *toggle) { m_toggle = toggle; }
139 
140 //-----------------------------------------------------------------------------
141 
setIsEnabled(bool on)142 void SetScanCropboxCheck::setIsEnabled(bool on) {
143   if (!m_toggle) return;
144   m_enabled = on;
145   m_toggle->setChecked(on);
146 }
147 
148 //-----------------------------------------------------------------------------
149 
uncheck()150 void SetScanCropboxCheck::uncheck() {
151   if (isEnabled()) m_toggle->trigger();
152 }
153