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()35ToonzCheck *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()47CameraTestCheck::CameraTestCheck() : m_toggle(0) {} 48 49 //----------------------------------------------------------------------------- 50 /*! Return current \b CameraTestCheck instance. 51 */ instance()52CameraTestCheck *CameraTestCheck::instance() { 53 static CameraTestCheck _instance; 54 return &_instance; 55 } 56 57 //----------------------------------------------------------------------------- 58 isEnabled() const59bool CameraTestCheck::isEnabled() const { 60 return m_toggle ? m_toggle->isChecked() : false; 61 } 62 63 //----------------------------------------------------------------------------- 64 setIsEnabled(bool on)65void 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)75void 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()88CleanupPreviewCheck::CleanupPreviewCheck() : m_toggle(0) {} 89 90 //----------------------------------------------------------------------------- 91 /*! Return current \b TransparencyCheck instance. 92 */ instance()93CleanupPreviewCheck *CleanupPreviewCheck::instance() { 94 static CleanupPreviewCheck _instance; 95 return &_instance; 96 } 97 98 //----------------------------------------------------------------------------- 99 isEnabled() const100bool CleanupPreviewCheck::isEnabled() const { 101 return m_toggle ? m_toggle->isChecked() : false; 102 } 103 104 //----------------------------------------------------------------------------- 105 setIsEnabled(bool on)106void 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)116void 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()125SetScanCropboxCheck::SetScanCropboxCheck() : m_enabled(false), m_toggle(0) {} 126 127 //----------------------------------------------------------------------------- 128 129 /*! Return current \b SetScanCropBoxCheck instance. 130 */ instance()131SetScanCropboxCheck *SetScanCropboxCheck::instance() { 132 static SetScanCropboxCheck _instance; 133 return &_instance; 134 } 135 136 //----------------------------------------------------------------------------- 137 setToggle(QAction * toggle)138void SetScanCropboxCheck::setToggle(QAction *toggle) { m_toggle = toggle; } 139 140 //----------------------------------------------------------------------------- 141 setIsEnabled(bool on)142void SetScanCropboxCheck::setIsEnabled(bool on) { 143 if (!m_toggle) return; 144 m_enabled = on; 145 m_toggle->setChecked(on); 146 } 147 148 //----------------------------------------------------------------------------- 149 uncheck()150void SetScanCropboxCheck::uncheck() { 151 if (isEnabled()) m_toggle->trigger(); 152 } 153