tahoma2d/toonz/sources/include/tfxattributes.h

117 lines
3 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 TFX_ATTRIBUTES_INCLUDED
#define TFX_ATTRIBUTES_INCLUDED
#include "tgeometry.h"
#include <QStack>
2019-07-10 15:19:16 +12:00
#include <QList>
2016-03-19 06:57:51 +13:00
#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
2016-06-15 18:43:10 +12:00
class DVAPI TFxAttributes {
int m_id;
TPointD m_dagNodePos;
bool m_enabled;
bool m_speedAware;
bool m_isOpened;
TPointD m_speed;
// A stack is used to manage subgroups.
QStack<int> m_groupId;
QStack<std::wstring> m_groupName;
int m_passiveCacheDataIdx;
int m_groupSelector;
/*-- Get object trajectory data for MotionBlur and other Fxs --*/
2016-06-15 18:43:10 +12:00
QList<TPointD> m_motionPoints;
TAffine m_motionAffine[2];
// to maintain backward compatibility in the fx
int m_fxVersion;
2016-03-19 06:57:51 +13:00
2021-09-02 20:36:37 +12:00
bool m_hasGlobalControl;
double m_globalIntensity;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TFxAttributes();
~TFxAttributes();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setId(int id) { m_id = id; }
int getId() { return m_id; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setDagNodePos(const TPointD &pos);
TPointD getDagNodePos() const { return m_dagNodePos; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool isEnabled() const { return m_enabled; }
void enable(bool on) { m_enabled = on; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setIsSpeedAware(bool yes) { m_speedAware = yes; }
bool isSpeedAware() const { return m_speedAware; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setSpeed(TPointD &speed) { m_speed = speed; }
TPointD getSpeed() const { return m_speed; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setIsOpened(bool value) { m_isOpened = value; }
bool isOpened() { return m_isOpened; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int &passiveCacheDataIdx() { return m_passiveCacheDataIdx; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setMotionPoints(QList<TPointD> motionPoints) {
m_motionPoints = motionPoints;
}
QList<TPointD> getMotionPoints() { return m_motionPoints; }
void setMotionAffines(TAffine aff_Before, TAffine aff_After) {
m_motionAffine[0] = aff_Before;
m_motionAffine[1] = aff_After;
}
void getMotionAffines(TAffine &aff_Before, TAffine &aff_After) {
aff_Before = m_motionAffine[0];
aff_After = m_motionAffine[1];
}
void setFxVersion(int version) { m_fxVersion = version; }
int getFxVersion() const { return m_fxVersion; };
2016-03-19 06:57:51 +13:00
2021-09-02 20:36:37 +12:00
void setHasGlobalControl(bool yes) { m_hasGlobalControl = yes; }
bool hasGlobalControl() const { return m_hasGlobalControl; }
void setGlobalIntensity(double val) { m_globalIntensity = val; }
double getGlobalIntensity() { return m_globalIntensity; }
2016-06-15 18:43:10 +12:00
// Group management
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int setGroupId(int value);
void setGroupId(int value, int position);
int getGroupId();
QStack<int> getGroupIdStack();
void removeGroupId(int position);
int removeGroupId();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void removeFromAllGroup();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool isGrouped();
bool isContainedInGroup(int groupId);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setGroupName(const std::wstring &name, int position = -1);
std::wstring getGroupName(bool fromEditor);
QStack<std::wstring> getGroupNameStack();
int removeGroupName(bool fromEditor);
void removeGroupName(int position = -1);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool editGroup();
bool isGroupEditing();
void closeEditingGroup(int groupId);
int getEditingGroupId();
std::wstring getEditingGroupName();
void closeAllGroups();
2016-03-19 06:57:51 +13:00
};
#endif