Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef STROKES_DATA_H
Toshihiro Shimizu 890ddd
#define STROKES_DATA_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
#include "tvectorimage.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/dvmimedata.h"
Toshihiro Shimizu 890ddd
#include "ttoonzimage.h"
Toshihiro Shimizu 890ddd
#include "trasterimage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class ToonzImageData;
Toshihiro Shimizu 890ddd
class FullColorImageData;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZQT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// StrokesData
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI StrokesData final : public DvMimeData {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TVectorImageP m_image;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  StrokesData() {}
Shinya Kitaoka 120a6e
  StrokesData(const StrokesData *src) : m_image(src->m_image) {}
Shinya Kitaoka 120a6e
  StrokesData(TVectorImage *image) : m_image(image) {}
Shinya Kitaoka 120a6e
  ~StrokesData() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 473e70
  StrokesData *clone() const override {
Shinya Kitaoka 120a6e
    TVectorImage *vi = 0;
Shinya Kitaoka 120a6e
    if (m_image) vi  = dynamic_cast<tvectorimage *="">(m_image->cloneImage());</tvectorimage>
Shinya Kitaoka 120a6e
    return new StrokesData(vi);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // data <- image; copia gli stroke indicati da indices
Shinya Kitaoka 120a6e
  void setImage(TVectorImageP image, const std::set<int> &indices);</int>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // image <- data;
Shinya Kitaoka 120a6e
  // se insert==true aggiunge le nuove strokes e mette in indices[] i nuovi
Shinya Kitaoka 120a6e
  // indici
Shinya Kitaoka 120a6e
  // se insert==false rimpiazza le strokes indicati da indices[]
Shinya Kitaoka 120a6e
  void getImage(TVectorImageP image, std::set<int> &indices, bool insert) const;</int>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  ToonzImageData *toToonzImageData(const TToonzImageP &imageToPaste) const;
Shinya Kitaoka 120a6e
  FullColorImageData *toFullColorImageData(
Shinya Kitaoka 120a6e
      const TRasterImageP &imageToPaste) const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // STROKES_DATA_H