1 #pragma once 2 3 #ifndef TMACROFX_INCLUDED 4 #define TMACROFX_INCLUDED 5 6 #include "trasterfx.h" 7 8 #undef DVAPI 9 #undef DVVAR 10 #ifdef TFX_EXPORTS 11 #define DVAPI DV_EXPORT_API 12 #define DVVAR DV_EXPORT_VAR 13 #else 14 #define DVAPI DV_IMPORT_API 15 #define DVVAR DV_IMPORT_VAR 16 #endif 17 18 #ifdef _MSC_VER 19 #pragma warning(disable : 4251) 20 #endif 21 22 //=================================================================== 23 24 class DVAPI TMacroFx final : public TRasterFx { 25 FX_DECLARATION(TMacroFx) 26 27 TRasterFxP m_root; 28 std::vector<TFxP> m_fxs; 29 bool m_isEditing; 30 31 bool isaLeaf(TFx *fx) const; 32 33 bool m_isLoading = false; 34 TMacroFx *m_waitingLinkFx = nullptr; 35 36 public: 37 static bool analyze(const std::vector<TFxP> &fxs, TFxP &root, 38 std::vector<TFxP> &roots, std::vector<TFxP> &leafs); 39 40 static bool analyze(const std::vector<TFxP> &fxs); 41 42 static TMacroFx *create(const std::vector<TFxP> &fxs); 43 44 TMacroFx(); 45 ~TMacroFx(); 46 47 TFx *clone(bool recursive = true) const override; 48 49 bool doGetBBox(double frame, TRectD &bBox, 50 const TRenderSettings &info) override; 51 void doDryCompute(TRectD &rect, double frame, 52 const TRenderSettings &info) override; 53 void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override; 54 55 TFxTimeRegion getTimeRegion() const override; 56 57 std::string getPluginId() const override; 58 59 void setRoot(TFx *root); 60 TFx *getRoot() const; 61 //! Returns the Fx identified by \b id. 62 //! Returns 0 if the macro does not contains an Fx with fxId equals ti \b id. 63 TFx *getFxById(const std::wstring &id) const; 64 65 // restituisce un riferimento al vettore contenente gli effetti contenuti nel 66 // macroFx 67 const std::vector<TFxP> &getFxs() const; 68 69 std::string getMacroFxType() const; 70 71 bool canHandle(const TRenderSettings &info, double frame) override; 72 73 std::string getAlias(double frame, 74 const TRenderSettings &info) const override; 75 76 void loadData(TIStream &is) override; 77 void saveData(TOStream &os) override; isEditing()78 bool isEditing() { return m_isEditing; } editMacro(bool edit)79 void editMacro(bool edit) { m_isEditing = edit; } 80 81 void compatibilityTranslatePort(int majorVersion, int minorVersion, 82 std::string &portName) override; 83 84 void linkParams(TFx *src) override; isLoading()85 bool isLoading() { return m_isLoading; } setWaitingLinkFx(TMacroFx * linkFx)86 void setWaitingLinkFx(TMacroFx *linkFx) { m_waitingLinkFx = linkFx; } 87 88 private: 89 // non implementati 90 TMacroFx(const TMacroFx &); 91 void operator=(const TMacroFx &); 92 }; 93 94 //------------------------------------------------------------------- 95 96 #endif 97