Blame toonz/sources/include/toonzqt/strokesdata.h
|
Toshihiro Shimizu |
890ddd |
|
|
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 |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI StrokesData : public DvMimeData
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TVectorImageP m_image;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
StrokesData()
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
StrokesData(const StrokesData *src)
|
|
Toshihiro Shimizu |
890ddd |
: m_image(src->m_image)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
StrokesData(TVectorImage *image)
|
|
Toshihiro Shimizu |
890ddd |
: m_image(image)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
~StrokesData()
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
StrokesData *clone() const
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TVectorImage *vi = 0;
|
|
Toshihiro Shimizu |
890ddd |
if (m_image)
|
|
Toshihiro Shimizu |
890ddd |
vi = dynamic_cast<tvectorimage *="">(m_image->cloneImage());</tvectorimage>
|
|
Toshihiro Shimizu |
890ddd |
return new StrokesData(vi);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// data <- image; copia gli stroke indicati da indices
|
|
Toshihiro Shimizu |
890ddd |
void setImage(TVectorImageP image, const std::set<int> &indices);</int>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// image <- data;
|
|
Toshihiro Shimizu |
890ddd |
// se insert==true aggiunge le nuove strokes e mette in indices[] i nuovi indici
|
|
Toshihiro Shimizu |
890ddd |
// se insert==false rimpiazza le strokes indicati da indices[]
|
|
Toshihiro Shimizu |
890ddd |
void getImage(TVectorImageP image, std::set<int> &indices, bool insert) const;</int>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
ToonzImageData *toToonzImageData(const TToonzImageP &imageToPaste) const;
|
|
Toshihiro Shimizu |
890ddd |
FullColorImageData *toFullColorImageData(const TRasterImageP &imageToPaste) const;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif // STROKES_DATA_H
|