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
const targetAttributeName = this->DataAssociation == 0 ?
"Point"
45 : this->DataAssociation == 1
49 this->
printMsg(
"Converting " + targetAttributeName +
"Data to Table", 0, 0,
52 auto input = vtkDataSet::GetData(inputVector[0]);
56 auto targetData = this->DataAssociation == 0 ? input->GetPointData()
57 : this->DataAssociation == 1 ? input->GetCellData()
58 : input->GetFieldData();
60#ifndef TTK_ENABLE_KAMIKAZE
61 if(targetData->GetNumberOfArrays() < 1) {
62 this->
printWrn(
"Empty " + targetAttributeName +
"Data.");
66 auto table = vtkTable::GetData(outputVector);
67 table->GetRowData()->ShallowCopy(targetData);
69 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)
vtkStandardNewMacro(ttkDataSetToTable)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)