29 #define ogsUserPropertyMacro(name,type) \
30 virtual void Set ## name (type _arg) \
33 << this->GetClassName() << " (" << this << "): setting " # name " to " << \
35 if (this->name != _arg) \
39 (*(this->_algorithmUserProperties))[QString(# name)] = QVariant(_arg); \
46 #define ogsUserVec2PropertyMacro(name,type) \
47 virtual void Set ## name (type _arg1, type _arg2) \
50 << this->GetClassName() << " (" << this << "): setting " << \
52 _arg1 << "," << _arg2 << ")"); \
53 if ((this->name[0] != _arg1) || (this->name[1] != _arg2)) \
55 this->name[0] = _arg1; \
56 this->name[1] = _arg2; \
58 QList<QVariant> list; \
59 list.push_back(QVariant(_arg1)); \
60 list.push_back(QVariant(_arg2)); \
61 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
65 virtual void Set ## name (type _arg[2]) \
67 this->Set ## name (_arg[0], _arg[1]); \
73 #define ogsUserVec3PropertyMacro(name,type) \
74 virtual void Set ## name (type _arg1, type _arg2, type _arg3) \
77 << this->GetClassName() << " (" << this << "): setting " << \
79 _arg1 << "," << _arg2 << "," << _arg3 << ")"); \
80 if ((this->name[0] != _arg1) || (this->name[1] != _arg2) || (this->name[2] != _arg3)) \
82 this->name[0] = _arg1; \
83 this->name[1] = _arg2; \
84 this->name[2] = _arg3; \
86 QList<QVariant> list; \
87 list.push_back(QVariant(_arg1)); \
88 list.push_back(QVariant(_arg2)); \
89 list.push_back(QVariant(_arg3)); \
90 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
94 virtual void Set ## name (type _arg[3]) \
96 this->Set ## name (_arg[0], _arg[1], _arg[2]); \
102 #define ogsUserVec4PropertyMacro(name,type) \
103 virtual void Set ## name (type _arg1, type _arg2, type _arg3, type _arg4) \
106 << this->GetClassName() << " (" << this << "): setting " << \
108 _arg1 << "," << _arg2 << "," << _arg3 << "," << _arg4 << ")"); \
109 if ((this->name[0] != _arg1) || (this->name[1] != _arg2) || \
110 (this->name[2] != _arg3) || (this->name[3] != _arg4)) \
112 this->name[0] = _arg1; \
113 this->name[1] = _arg2; \
114 this->name[2] = _arg3; \
115 this->name[3] = _arg4; \
117 QList<QVariant> list; \
118 list.push_back(QVariant(_arg1)); \
119 list.push_back(QVariant(_arg2)); \
120 list.push_back(QVariant(_arg3)); \
121 list.push_back(QVariant(_arg4)); \
122 (*(this->_algorithmUserVectorProperties))[QString(# name)] = list; \
126 virtual void Set ## name (type _arg[4]) \
128 this->Set ## name (_arg[0], _arg[1], _arg[2], _arg[3]); \
163 void SetLookUpTable(
const QString &array_name, vtkLookupTable* lut);
166 void SetLookUpTable(
const QString &array_name,
const QString &filename);
196 (*_algorithmUserProperties)[
name] = value;
205 (*_algorithmUserVectorProperties)[
name] = values;
226 std::map<QString, vtkLookupTable*>
_lut;
Contains properties for the visualization of objects as VtkVisPipelineItems.
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.
QString GetActiveAttribute() const
Returns the desired active attribute.
QMap< QString, QList< QVariant > > * GetAlgorithmUserVectorProperties() const
Returns a map of vector user properties.
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.
vtkTexture * GetTexture()
Returns a texture (if one has been assigned).
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, QVariant > * GetAlgorithmUserProperties() const
Returns a map of user properties.
vtkProperty * GetProperties() const
Returns the vtk 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.
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.