3#include <vtkCellData.h>
5#include <vtkInformation.h>
6#include <vtkObjectFactory.h>
7#include <vtkPointData.h>
15 this->SetNumberOfInputPorts(1);
16 this->SetNumberOfOutputPorts(1);
22 vtkInformation *info) {
24 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkDataSet");
31 vtkInformation *info) {
33 info->Set(vtkDataObject::DATA_TYPE_NAME(),
"vtkTable");
40 vtkInformationVector **inputVector,
41 vtkInformationVector *outputVector) {
44 std::string targetAttributeName = this->DataAssociation == 0 ?
"Point"
45 : this->DataAssociation == 1 ?
"Cell"
48 this->
printMsg(
"Converting " + targetAttributeName +
"Data to Table", 0, 0,
51 auto input = vtkDataSet::GetData(inputVector[0]);
55 auto targetData = this->DataAssociation == 0 ? input->GetPointData()
56 : this->DataAssociation == 1 ? input->GetCellData()
57 : input->GetFieldData();
59#ifndef TTK_ENABLE_KAMIKAZE
60 if(targetData->GetNumberOfArrays() < 1) {
61 this->
printWrn(
"Empty " + targetAttributeName +
"Data.");
65 auto table = vtkTable::GetData(outputVector);
66 table->GetRowData()->ShallowCopy(targetData);
68 this->
printMsg(
"Converting " + targetAttributeName +
"Data to Table", 1,
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
TTK VTK-filter that creates a vtkTable from a vtkDataSet.
int FillOutputPortInformation(int port, vtkInformation *info) override
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int FillInputPortInformation(int port, vtkInformation *info) override
~ttkDataSetToTable() override
int printWrn(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
void setDebugMsgPrefix(const std::string &prefix)
int printMsg(const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const
vtkStandardNewMacro(ttkDataSetToTable)