18#include <vtkContourFilter.h>
19#include <vtkOutlineFilter.h>
20#include <vtkTransformFilter.h>
33 QModelIndex parentIndex,
35 : QDialog(parent), _pipeline(pipeline), _parentIndex(parentIndex)
38 filterListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
42 vtkDataObject* parentDataObject =
43 parentItem->
algorithm()->GetOutputDataObject(0);
44 int parentDataObjectType = parentDataObject->GetDataObjectType();
50 int inputType = filter.inputDataObjectType;
51 if ((inputType == parentDataObjectType) ||
52 (inputType == VTK_POINT_SET &&
53 parentDataObjectType != VTK_IMAGE_DATA) ||
54 (inputType == VTK_IMAGE_DATA &&
55 (parentDataObjectType == VTK_STRUCTURED_POINTS ||
56 parentDataObjectType == VTK_UNIFORM_GRID)))
58 new QListWidgetItem(filter.readableName, filterListWidget);
63 connect(filterListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
64 this->buttonBox, SIGNAL(accepted()));
73 if (filter.readableName.compare(
74 filterListWidget->currentItem()->text()) == 0)
76 filterName = filter.name;
82 QList<QVariant> itemData;
83 itemData << filterListWidget->currentItem()->text() <<
true;
89 filterName, parentItem->algorithm());
94 filterName, parentItem->transformFilter());
100 if (filter->GetOutputDataObjectType() == VTK_IMAGE_DATA)
111 vtkAlgorithm* algorithm =
119 ERR(
"VtkFilterFactory cannot create {:s}.",
120 filterName.toStdString());
131 if (filter.readableName.compare(
132 filterListWidget->item(currentRow)->text()) == 0)
134 QString desc = filter.description;
135 desc = desc + QString(
"\n\nThis filter outputs ") +
136 filter.OutputDataObjectTypeAsString() +
137 QString(
"\n\nFilter class name: ") + filter.name;
139 this->filterDescTextEdit->setText(desc);
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the VtkAddFilterDialog class.
Definition of the VtkCompositeFilter class.
Definition of the VtkFilterFactory class.
Definition of the VtkVisImageItem class.
Definition of the VtkVisPipelineItem class.
Definition of the VtkVisPipeline class.
Definition of the VtkVisPointSetItem class.
TreeItem * getItem(const QModelIndex &index) const
VtkAddFilterDialog(VtkVisPipeline &pipeline, QModelIndex parentIndex, QDialog *parent=nullptr)
VtkVisPipeline & _pipeline
void on_buttonBox_accepted()
void on_filterListWidget_currentRowChanged(int currentRow)
Is used to combine several filter in one VtkVisPipelineItem. You can use vtk filter and custom filter...
static QVector< VtkFilterInfo > GetFilterList()
Returns all registered filters. New VtkCompositeFilter or filter inherited from VtkAlgorithmPropertie...
static VtkCompositeFilter * CreateCompositeFilter(QString type, vtkAlgorithm *inputAlgorithm)
Creates a composite filter by name.
static vtkAlgorithm * CreateSimpleFilter(QString type)
Creates a normal filter name.
An item in the VtkVisPipeline containing an image to be visualized.
An item in the VtkVisPipeline containing a graphic object to be visualized.
vtkAlgorithm * algorithm() const
Returns the algorithm object.
VtkVisPipeline manages the VTK visualization. It is a TreeModel and provides functions for adding and...
void addPipelineItem(MeshModel *model, const QModelIndex &idx)
Adds the given Model to the pipeline.
An item in the VtkVisPipeline containing a point set object to be visualized.
Holds meta information about a filter.