19#include <vtkAlgorithm.h>
20#include <vtkCellData.h>
21#include <vtkDataSetMapper.h>
22#include <vtkGenericDataObjectWriter.h>
23#include <vtkImageActor.h>
24#include <vtkPointData.h>
25#include <vtkPointSet.h>
26#include <vtkProperty.h>
27#include <vtkRenderer.h>
28#include <vtkSmartPointer.h>
29#include <vtkTextureMapToPlane.h>
39 vtkAlgorithm* algorithm,
TreeItem* parentItem,
40 const QList<QVariant> data )
43 _algorithm(algorithm),
45 _compositeFilter(nullptr),
52 visParentItem->algorithm()->GetOutputPort());
58 const QList<QVariant> data )
62 _compositeFilter(compositeFilter),
108 return static_cast<bool>(
_actor->GetVisibility());
113 _actor->SetVisibility(
static_cast<int>(visible));
120 if (!filename.empty())
128 const std::string& filename)
const
181 vtkDataSet* dataSet =
182 vtkDataSet::SafeDownCast(this->
algorithm()->GetOutputDataObject(0));
183 QStringList dataSetAttributesList;
186 vtkPointData* pointData = dataSet->GetPointData();
189 for (
int i = 0; i < pointData->GetNumberOfArrays(); i++)
193 dataSetAttributesList.push_back(QString(
"P-") +
194 pointData->GetArrayName(i));
197 vtkCellData* cellData = dataSet->GetCellData();
200 for (
int i = 0; i < cellData->GetNumberOfArrays(); i++)
204 dataSetAttributesList.push_back(QString(
"C-") +
205 cellData->GetArrayName(i));
208 return dataSetAttributesList;
Definition of the QVtkDataSetMapper class.
Definition of the VtkAlgorithmProperties class.
Definition of the VtkCompositeFilter class.
Definition of the VtkVisPipelineItem class.
Objects nodes for the TreeModel.
virtual int childCount() const
TreeItem * parentItem() const
TreeItem * child(int row) const
virtual bool setData(int column, const QVariant &value)
virtual QVariant data(int column) const
Is used to combine several filter in one VtkVisPipelineItem. You can use vtk filter and custom filter...
vtkAlgorithm * GetOutputAlgorithm() const
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.
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.
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.
virtual int callVTKWriter(vtkAlgorithm *algorithm, const std::string &filename) const
~VtkVisPipelineItem() override
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
void setScaleOnChildren(double x, double y, double z) const
Sets the geometry and date scaling recursively on all children of this item.