OGS
VtkVisPipelineItem.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <QList>
18#include <QMap>
19#include <QString>
20#include <QVariant>
21
22#include "Base/TreeItem.h"
23
24class QStringList;
25class vtkAlgorithm;
26class vtkDataSetAttributes;
27class vtkPointSet;
28class vtkProp3D;
29class vtkRenderer;
30class vtkTransformFilter;
32
35
42class VtkVisPipelineItem : /*public QObject,*/ public TreeItem
43{
44// Q_OBJECT
45
46public:
48 VtkVisPipelineItem(vtkAlgorithm* algorithm,
50 const QList<QVariant> data = QList<QVariant>());
51
54 const QList<QVariant> data = QList<QVariant>());
55
56 ~VtkVisPipelineItem() override;
57
59 VtkVisPipelineItem* child(int row) const;
60
63 virtual void Initialize(vtkRenderer* renderer) = 0;
64
65 QVariant data(int column) const override;
66 bool setData(int column, const QVariant& value) override;
67
69 vtkAlgorithm* algorithm() const { return _algorithm; }
70
72 vtkProp3D* actor() const;
73
74 // Dummy for implementation in derived classes
75 virtual QString GetActiveAttribute() const { return QString(""); }
76
77 // Dummy for implementation in derived classes
78 virtual void SetActiveAttribute(const QString& str) { (void)str; }
79
82
84 bool isVisible() const;
85
87 void setVisible(bool visible);
88
91 int writeToFile(const std::string &filename) const;
92
97 virtual void setScale(double x, double y, double z) const;
98
101 void setScaleOnChildren(double x, double y, double z) const;
102
107 virtual void setTranslation(double x, double y, double z) const;
108
113 virtual vtkAlgorithm* transformFilter() const = 0;
114
116 virtual void setBackfaceCulling(bool enable) const;
117
119 void setBackfaceCullingOnChildren(bool enable) const;
120
123 QStringList getScalarArrayNames() const;
124
127
128protected:
129 vtkProp3D* _actor;
130 vtkAlgorithm* _algorithm;
131 vtkRenderer* _renderer;
133
137
142 virtual int callVTKWriter(vtkAlgorithm* algorithm, const std::string &filename) const;
143
144private:
145};
Definition of the TreeItem class.
Simply wraps vtkDataSetMapper as a Qt object to enable slot connections.
Objects nodes for the TreeModel.
Definition TreeItem.h:28
TreeItem * parentItem() const
Definition TreeItem.cpp:115
int row() const
Definition TreeItem.cpp:73
Contains properties for the visualization of objects as VtkVisPipelineItems.
Is used to combine several filter in one VtkVisPipelineItem. You can use vtk filter and custom filter...
An item in the VtkVisPipeline containing a graphic object to be visualized.
virtual void setScale(double x, double y, double z) const
Scales the data in visualisation-space. This function is empty and needs to be implemented by derived...
virtual void setTranslation(double x, double y, double z) const
Translates the item in visualisation-space. This function is empty and needs to be implemented by der...
vtkProp3D * actor() const
Returns the actor as vtkProp3D.
QStringList getScalarArrayNames() const
Returns a list of array names prefixed with P- or C- for point and cell data.
vtkAlgorithm * algorithm() const
Returns the algorithm object.
VtkAlgorithmProperties * _vtkProps
The active VtkAlgorithmProperties. From algorithm, compositeFilter, or copied from parent.
virtual void setBackfaceCulling(bool enable) const
Enables / disables backface culling.
bool isVisible() const
Returns if the VTK object is visible in the visualization.
bool setData(int column, const QVariant &value) override
void setBackfaceCullingOnChildren(bool enable) const
Enables / disables backface culling on all children.
VtkVisPipelineItem(vtkAlgorithm *algorithm, TreeItem *parentItem, const QList< QVariant > data=QList< QVariant >())
Constructor for a source/filter object.
virtual vtkAlgorithm * transformFilter() const =0
void setVisible(bool visible)
Sets the visibility of the VTK object in the visualization.
vtkAlgorithm * _algorithm
VtkCompositeFilter * _compositeFilter
VtkVisPipelineItem * child(int row) const
Returns a VtkVisPipelineItem.
VtkAlgorithmProperties * getVtkProperties() const
Returns the VtkAlgorithmProperties.
virtual QString GetActiveAttribute() const
virtual int callVTKWriter(vtkAlgorithm *algorithm, const std::string &filename) const
int writeToFile(const std::string &filename) const
Writes this algorithm's vtkDataSet (i.e. vtkPolyData or vtkUnstructuredGrid) to a vtk-file.
QVariant data(int column) const override
virtual void Initialize(vtkRenderer *renderer)=0
Initializes vtkMapper and vtkActor necessary for visualization of the item and sets the item's proper...
VtkCompositeFilter * compositeFilter() const
Returns the composite filter.
void setScaleOnChildren(double x, double y, double z) const
Sets the geometry and date scaling recursively on all children of this item.
virtual void SetActiveAttribute(const QString &str)