4#include <vtkInformation.h>
5#include <vtkObjectFactory.h>
7#include <vtkPointData.h>
8#include <vtkProbeFilter.h>
14 this->SetNumberOfInputPorts(2);
15 this->SetNumberOfOutputPorts(1);
17 vtkWarningMacro(
"`TTK DataSetInterpolator' is now deprecated. Please use "
18 "`ResampleWithDataset' instead.");
23 vtkInformation *info) {
24 if(port == 0 || port == 1) {
25 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkDataSet");
32 vtkInformation *info) {
41 vtkInformationVector **inputVector,
42 vtkInformationVector *outputVector) {
45 auto target = vtkDataSet::GetData(inputVector[0]);
46 auto source = vtkDataSet::GetData(inputVector[1]);
49 "Computing " + std::to_string(target->GetNumberOfPoints()) +
" locations",
52 auto output = vtkDataSet::GetData(outputVector);
55 probe->SetInputData(target);
56 probe->SetSourceData(source);
59#ifndef TTK_ENABLE_KAMIKAZE
60 if(!probe->GetOutput()) {
61 this->
printErr(
"Data probe failed.");
66 output->ShallowCopy(probe->GetOutput());
69 auto inputPointData = target->GetPointData();
70 auto outputPointData = output->GetPointData();
72 const size_t numberOfArrays = inputPointData->GetNumberOfArrays();
73 for(
size_t i = 0; i < numberOfArrays; ++i)
74 outputPointData->AddArray(inputPointData->GetAbstractArray(i));
77 "Computing " + std::to_string(target->GetNumberOfPoints()) +
" locations",
#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()
TTK VTK-filter that wraps the dataSetInterpolator processing package.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
~ttkDataSetInterpolator() override
int FillInputPortInformation(int port, vtkInformation *info) override
int FillOutputPortInformation(int port, vtkInformation *info) override
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
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
vtkStandardNewMacro(ttkDataSetInterpolator)