18#define ogsUserPropertyMacro(name,type) \
19 virtual void Set ## name (type _arg) \
22 << this->GetClassName() << " (" << this << "): setting " # name " to " << \
24 if (this->name != _arg) \
28 (*(this->_algorithmUserProperties))[QString(# name)] = QVariant(_arg); \
35#define ogsUserVec2PropertyMacro(name,type) \
36 virtual void Set ## name (type _arg1, type _arg2) \
39 << this->GetClassName() << " (" << this << "): setting " << \
41 _arg1 << "," << _arg2 << ")"); \
42 if ((this->name[0] != _arg1) || (this->name[1] != _arg2)) \
44 this->name[0] = _arg1; \
45 this->name[1] = _arg2; \
47 QList<QVariant> list; \
48 list.push_back(QVariant(_arg1)); \
49 list.push_back(QVariant(_arg2)); \
50 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
54 virtual void Set ## name (type _arg[2]) \
56 this->Set ## name (_arg[0], _arg[1]); \
62#define ogsUserVec3PropertyMacro(name,type) \
63 virtual void Set ## name (type _arg1, type _arg2, type _arg3) \
66 << this->GetClassName() << " (" << this << "): setting " << \
68 _arg1 << "," << _arg2 << "," << _arg3 << ")"); \
69 if ((this->name[0] != _arg1) || (this->name[1] != _arg2) || (this->name[2] != _arg3)) \
71 this->name[0] = _arg1; \
72 this->name[1] = _arg2; \
73 this->name[2] = _arg3; \
75 QList<QVariant> list; \
76 list.push_back(QVariant(_arg1)); \
77 list.push_back(QVariant(_arg2)); \
78 list.push_back(QVariant(_arg3)); \
79 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
83 virtual void Set ## name (type _arg[3]) \
85 this->Set ## name (_arg[0], _arg[1], _arg[2]); \
91#define ogsUserVec4PropertyMacro(name,type) \
92 virtual void Set ## name (type _arg1, type _arg2, type _arg3, type _arg4) \
95 << this->GetClassName() << " (" << this << "): setting " << \
97 _arg1 << "," << _arg2 << "," << _arg3 << "," << _arg4 << ")"); \
98 if ((this->name[0] != _arg1) || (this->name[1] != _arg2) || \
99 (this->name[2] != _arg3) || (this->name[3] != _arg4)) \
101 this->name[0] = _arg1; \
102 this->name[1] = _arg2; \
103 this->name[2] = _arg3; \
104 this->name[3] = _arg4; \
106 QList<QVariant> list; \
107 list.push_back(QVariant(_arg1)); \
108 list.push_back(QVariant(_arg2)); \
109 list.push_back(QVariant(_arg3)); \
110 list.push_back(QVariant(_arg4)); \
111 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
115 virtual void Set ## name (type _arg[4]) \
117 this->Set ## name (_arg[0], _arg[1], _arg[2], _arg[3]); \
152 void SetLookUpTable(
const QString &array_name, vtkLookupTable* lut);
155 void SetLookUpTable(
const QString &array_name,
const QString &filename);
185 (*_algorithmUserProperties)[name] = value;
194 (*_algorithmUserVectorProperties)[name] = values;
215 std::map<QString, vtkLookupTable*>
_lut;
vtkLookupTable * GetLookupTable(const QString &array_name)
Returns the colour lookup table (if one has been assigned).
QMap< QString, QList< QVariant > > * _algorithmUserVectorProperties
void ScalarVisibilityChanged(bool on)
void SetActiveAttribute(QString name)
Set the active attribute.
virtual void SetUserVectorProperty(QString name, QList< QVariant > values)
Sets a vector user property. This should be implemented by subclasses.
bool GetScalarVisibility() const
Returns the scalar visibility.
void SetScalarVisibility(bool on)
Sets the scalar visibility.
vtkTexture * GetTexture()
Returns a texture (if one has been assigned).
QMap< QString, QVariant > * GetAlgorithmUserProperties() const
Returns a map of user properties.
QString GetActiveAttribute() const
Returns the desired active attribute.
void SetLookUpTable(const QString &array_name, vtkLookupTable *lut)
Sets a colour lookup table for the given scalar array of the VtkVisPipelineItem.
std::map< QString, vtkLookupTable * > _lut
QVariant GetUserProperty(QString name) const
Returns the value of a user property.
void SetName(QString name)
Sets the name.
QString _activeAttributeName
void RemoveLookupTable(const QString &array_name)
Removes the lookup table for the given scalar.
QList< QVariant > GetUserVectorProperty(QString name) const
Returns a list of values of a vector user property.
VtkAlgorithmProperties(QObject *parent=nullptr)
Constructor (sets default values)
QMap< QString, QVariant > * _algorithmUserProperties
QMap< QString, QList< QVariant > > * GetAlgorithmUserVectorProperties() const
Returns a map of vector user properties.
void SetTexture(vtkTexture *t)
Sets a texture for the VtkVisPipelineItem.
QString GetName() const
Returns the name. This is set to the file path if it is a source algorithm.
vtkProperty * GetProperties() const
Returns the vtk properties.
bool IsRemovable() const
Is this algorithm removable from the pipeline (view).
~VtkAlgorithmProperties() override
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.