3#include <vtkFieldData.h>
4#include <vtkInformation.h>
5#include <vtkInformationVector.h>
6#include <vtkMultiBlockDataSet.h>
8#include <vtkObjectFactory.h>
15 this->SetNumberOfInputPorts(1);
16 this->SetNumberOfOutputPorts(1);
20 vtkInformation *info) {
22 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkMultiBlockDataSet");
29 vtkInformation *info) {
31 info->Set(vtkDataObject::DATA_TYPE_NAME(),
"vtkTable");
38 vtkInformationVector **inputVector,
39 vtkInformationVector *outputVector) {
41 std::vector<vtkTable *> inputTables;
43 auto blocks = vtkMultiBlockDataSet::GetData(inputVector[0], 0);
48 if(blocks !=
nullptr) {
49 nInputs = blocks->GetNumberOfBlocks();
50 for(
size_t i = 0; i < nInputs; ++i) {
51 inputTables.emplace_back(vtkTable::SafeDownCast(blocks->GetBlock(i)));
56 for(
const auto table : inputTables) {
57 if(table ==
nullptr) {
58 this->
printErr(
"Input tables are not all vtkTables");
70 auto outputTable = vtkTable::GetData(outputVector);
74 outputTable->DeepCopy(inputTables[0]);
77 const auto fd = outputTable->GetFieldData();
83 for(
size_t i = 1; i < nInputs; ++i) {
84 const auto currTable{inputTables[i]};
85 for(vtkIdType j = 0; j < currTable->GetNumberOfRows(); ++j) {
86 outputTable->InsertNextRow(currTable->GetRow(j));
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
TTK processing package for merging vtkTables from a vtkMultiBlockDataSet.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int FillOutputPortInformation(int port, vtkInformation *info) override
int FillInputPortInformation(int port, vtkInformation *info) override
void setDebugMsgPrefix(const std::string &prefix)
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
vtkStandardNewMacro(ttkMergeBlockTables)