Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TMACROFX_INCLUDED
Toshihiro Shimizu 890ddd
#define TMACROFX_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "trasterfx.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TFX_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
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
#pragma warning(disable : 4251)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TMacroFx : public TRasterFx
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	FX_DECLARATION(TMacroFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRasterFxP m_root;
Shinya Kitaoka 3bfa54
	std::vector<tfxp> m_fxs;</tfxp>
Toshihiro Shimizu 890ddd
	bool m_isEditing;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isaLeaf(TFx *fx) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 3bfa54
	static bool analyze(const std::vector<tfxp> &fxs,</tfxp>
Toshihiro Shimizu 890ddd
						TFxP &root,
Shinya Kitaoka 3bfa54
						std::vector<tfxp> &roots,</tfxp>
Shinya Kitaoka 3bfa54
						std::vector<tfxp> &leafs);</tfxp>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	static bool analyze(const std::vector<tfxp> &fxs);</tfxp>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	static TMacroFx *create(const std::vector<tfxp> &fxs);</tfxp>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TMacroFx();
Toshihiro Shimizu 890ddd
	~TMacroFx();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TFx *clone(bool recursive = true) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info);
Toshihiro Shimizu 890ddd
	void doDryCompute(TRectD &rect,
Toshihiro Shimizu 890ddd
					  double frame,
Toshihiro Shimizu 890ddd
					  const TRenderSettings &info);
Toshihiro Shimizu 890ddd
	void doCompute(TTile &tile, double frame, const TRenderSettings &ri);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TFxTimeRegion getTimeRegion() const;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::string getPluginId() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setRoot(TFx *root);
Toshihiro Shimizu 890ddd
	TFx *getRoot() const;
Toshihiro Shimizu 890ddd
	//!Returns the Fx identified by \b id.
Toshihiro Shimizu 890ddd
	//!Returns 0 if the macro does not contains an Fx with fxId equals ti \b id.
Shinya Kitaoka 3bfa54
	TFx *getFxById(const std::wstring &id) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// restituisce un riferimento al vettore contenente gli effetti contenuti nel macroFx
Shinya Kitaoka 3bfa54
	const std::vector<tfxp> &getFxs() const;</tfxp>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::string getMacroFxType() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool canHandle(const TRenderSettings &info, double frame);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::string getAlias(double frame, const TRenderSettings &info) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TIStream &is);
Toshihiro Shimizu 890ddd
	void saveData(TOStream &os);
Toshihiro Shimizu 890ddd
	bool isEditing() { return m_isEditing; }
Toshihiro Shimizu 890ddd
	void editMacro(bool edit) { m_isEditing = edit; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void compatibilityTranslatePort(int majorVersion, int minorVersion, std::string &portName);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	// non implementati
Toshihiro Shimizu 890ddd
	TMacroFx(const TMacroFx &);
Toshihiro Shimizu 890ddd
	void operator=(const TMacroFx &);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif