Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzLib includes
Toshihiro Shimizu 890ddd
#include "toonz/textureutils.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonz/txsheethandle.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// TXsheeHandle
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TXsheetHandle::TXsheetHandle() : m_xsheet(0) {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TXsheetHandle::~TXsheetHandle() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TXsheet *TXsheetHandle::getXsheet() const { return m_xsheet; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TXsheetHandle::setXsheet(TXsheet *xsheet) {
Shinya Kitaoka 120a6e
  if (m_xsheet == xsheet) return;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_xsheet = xsheet;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  if (m_xsheet) {
Shinya Kitaoka 120a6e
    texture_utils::invalidateTextures(m_xsheet);  // We'll be editing m_xsheet -
Shinya Kitaoka 120a6e
                                                  // so destroy every texture of
Shinya Kitaoka 120a6e
                                                  // his
Shinya Kitaoka 120a6e
    emit xsheetSwitched();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}