tahoma2d/toonz/sources/include/tmacrofx.h

97 lines
2.5 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TMACROFX_INCLUDED
#define TMACROFX_INCLUDED
#include "trasterfx.h"
#undef DVAPI
#undef DVVAR
#ifdef TFX_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
#ifdef _MSC_VER
2016-03-19 06:57:51 +13:00
#pragma warning(disable : 4251)
#endif
//===================================================================
class DVAPI TMacroFx final : public TRasterFx {
2016-06-15 18:43:10 +12:00
FX_DECLARATION(TMacroFx)
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TRasterFxP m_root;
std::vector<TFxP> m_fxs;
bool m_isEditing;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool isaLeaf(TFx *fx) const;
2016-03-19 06:57:51 +13:00
2019-08-22 22:08:37 +12:00
bool m_isLoading = false;
TMacroFx *m_waitingLinkFx = nullptr;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
static bool analyze(const std::vector<TFxP> &fxs, TFxP &root,
std::vector<TFxP> &roots, std::vector<TFxP> &leafs);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static bool analyze(const std::vector<TFxP> &fxs);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static TMacroFx *create(const std::vector<TFxP> &fxs);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TMacroFx();
~TMacroFx();
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
TFx *clone(bool recursive = true) const override;
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
bool doGetBBox(double frame, TRectD &bBox,
const TRenderSettings &info) override;
void doDryCompute(TRectD &rect, double frame,
const TRenderSettings &info) override;
2016-06-19 20:06:29 +12:00
void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
TFxTimeRegion getTimeRegion() const override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
std::string getPluginId() const override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setRoot(TFx *root);
TFx *getRoot() const;
//! Returns the Fx identified by \b id.
//! Returns 0 if the macro does not contains an Fx with fxId equals ti \b id.
TFx *getFxById(const std::wstring &id) const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
// restituisce un riferimento al vettore contenente gli effetti contenuti nel
// macroFx
const std::vector<TFxP> &getFxs() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
std::string getMacroFxType() const;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
bool canHandle(const TRenderSettings &info, double frame) override;
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
std::string getAlias(double frame,
const TRenderSettings &info) const override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void loadData(TIStream &is) override;
void saveData(TOStream &os) override;
2016-06-15 18:43:10 +12:00
bool isEditing() { return m_isEditing; }
void editMacro(bool edit) { m_isEditing = edit; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void compatibilityTranslatePort(int majorVersion, int minorVersion,
2016-06-19 20:06:29 +12:00
std::string &portName) override;
2016-03-19 06:57:51 +13:00
2019-08-22 22:08:37 +12:00
void linkParams(TFx *src) override;
bool isLoading() { return m_isLoading; }
void setWaitingLinkFx(TMacroFx *linkFx) { m_waitingLinkFx = linkFx; }
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
// non implementati
TMacroFx(const TMacroFx &);
void operator=(const TMacroFx &);
2016-03-19 06:57:51 +13:00
};
//-------------------------------------------------------------------
#endif