3#include <vtkContourFilter.h>
4#include <vtkInformation.h>
11 this->SetNumberOfInputPorts(1);
12 this->SetNumberOfOutputPorts(1);
19 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkDataSet");
28 info->Set(vtkDataObject::DATA_TYPE_NAME(),
"vtkPolyData");
36 vtkInformationVector **inputVector,
37 vtkInformationVector *outputVector) {
42 auto input = vtkDataSet::GetData(inputVector[0]);
43 auto output = vtkPolyData::GetData(outputVector);
45 auto uArray = this->GetInputArrayToProcess(0, inputVector);
47 this->
printErr(
"Unable to retrieve input array U.");
50 std::string uArrayName(uArray->GetName());
52 auto vArray = this->GetInputArrayToProcess(1, inputVector);
54 this->
printErr(
"Unable to retrieve input array V.");
57 std::string vArrayName(vArray->GetName());
59 this->
printMsg(
"Computing Fiber (" + uArrayName +
": "
60 + std::to_string(UValue) +
", " + vArrayName +
": "
61 + std::to_string(VValue) +
")",
65 isoSurface->SetInputData(input);
66 isoSurface->SetComputeScalars(
true);
67 isoSurface->SetInputArrayToProcess(
68 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, uArray->GetName());
69 isoSurface->SetGenerateTriangles(
true);
70 isoSurface->SetNumberOfContours(1);
71 isoSurface->SetValue(0, UValue);
75 isoLine->SetInputData(isoSurface->GetOutput());
76 isoLine->SetComputeScalars(
true);
77 isoLine->SetInputArrayToProcess(
78 0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, vArray->GetName());
79 isoLine->SetNumberOfContours(1);
80 isoLine->SetValue(0, VValue);
83 output->ShallowCopy(isoLine->GetOutput());
85 this->
printMsg(
"Computing Fiber (" + uArrayName +
": "
86 + std::to_string(UValue) +
", " + vArrayName +
": "
87 + std::to_string(VValue) +
")",
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
TTK VTK-filter for fiber computation on bivariate volumetric data.
int FillInputPortInformation(int port, vtkInformation *info) override
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) 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(ttkFiber)