5#include <vtkObjectFactory.h>
15 vtkInformation *info) {
17 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkTable");
24 vtkInformation *info) {
33 vtkInformation *request,
34 vtkInformationVector **inputVector,
35 vtkInformationVector *outputVector) {
37 vtkTable *input = vtkTable::GetData(inputVector[0]);
43 vtkInformationVector **inputVector,
44 vtkInformationVector *outputVector) {
45 vtkTable *input = vtkTable::GetData(inputVector[0]);
46 vtkTable *output = vtkTable::GetData(outputVector);
50 output->ShallowCopy(input);
52 vtkDataSetAttributes *inputRowData = input->GetRowData();
53#ifndef TTK_ENABLE_KAMIKAZE
55 this->
printErr(
"Input has no row data.");
62#ifndef TTK_ENABLE_KAMIKAZE
64 this->
printErr(
"vtkFieldData memory allocation problem.");
69 if(AvailableCols.empty()) {
74 for(
auto &col : SelectedCols) {
80 ptrdiff_t
const pos = find(AvailableCols.begin(), AvailableCols.end(), col)
81 - AvailableCols.begin();
82 if(pos < RangeId[0] || pos > RangeId[1]) {
86 if(!regex_match(col, regex(RegexpString))) {
90 vtkDataArray *arr = inputRowData->GetArray(col.c_str());
92 outputRowData->AddArray(arr);
95 output->GetRowData()->ShallowCopy(outputRowData);
107 int const nbColumns = input->GetNumberOfColumns();
108 AvailableCols.clear();
109 AvailableCols.resize(nbColumns);
110 for(
int i = 0; i < nbColumns; ++i) {
111 AvailableCols[i] = input->GetColumnName(i);
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
static vtkInformationIntegerKey * SAME_DATA_TYPE_AS_INPUT_PORT()
virtual int RequestInformation(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
TTK VTK-filter that selects scalar fields on input with shallow copy.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int FillInputPortInformation(int port, vtkInformation *info) override
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int FillOutputPortInformation(int port, vtkInformation *info) override
void FillAvailableCols(vtkTable *input)
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
vtkStandardNewMacro(ttkTableDataSelector)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)