3#include <vtkInformation.h>
5#include <vtkDataArray.h>
7#include <vtkObjectFactory.h>
8#include <vtkPointData.h>
9#include <vtkSmartPointer.h>
31 this->SetNumberOfInputPorts(1);
32 this->SetNumberOfOutputPorts(1);
44 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
"vtkDataSet");
87 vtkInformationVector **inputVector,
88 vtkInformationVector *outputVector) {
92 vtkDataSet *inputDataSet = vtkDataSet::GetData(inputVector[0]);
141 vtkDataArray *inputArray = this->GetInputArrayToProcess(0, inputVector);
143 this->
printErr(
"Unable to retrieve input array.");
149 if(this->GetInputArrayAssociation(0, inputVector) != 0) {
150 this->
printErr(
"Input array needs to be a point data array.");
153 if(inputArray->GetNumberOfComponents() != 1) {
154 this->
printErr(
"Input array needs to be a scalar array.");
159 this->
printMsg(
"Starting computation...");
160 this->
printMsg(
" Scalar Array: " + std::string(inputArray->GetName()));
167 outputArray->SetName(this->OutputArrayName.data());
168 outputArray->SetNumberOfComponents(1);
169 outputArray->SetNumberOfTuples(inputArray->GetNumberOfTuples());
184 (status = this->computeAverages<VTK_TT, TTK_TT>(
187 (TTK_TT *)triangulation->
getData())));
195 vtkDataSet *outputDataSet = vtkDataSet::GetData(outputVector, 0);
198 outputDataSet->ShallowCopy(inputDataSet);
201 outputDataSet->GetPointData()->AddArray(outputArray);
#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::Triangulation * GetTriangulation(vtkDataSet *dataSet)
TTK VTK-filter that wraps the ttk::HelloWorld module.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
int FillInputPortInformation(int port, vtkInformation *info) override
int FillOutputPortInformation(int port, vtkInformation *info) override
static void * GetVoidPointer(vtkDataArray *array, vtkIdType start=0)
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
int preconditionTriangulation(ttk::AbstractTriangulation *triangulation) const
Triangulation is a class that provides time and memory efficient traversal methods on triangulations ...
AbstractTriangulation * getData()
Triangulation::Type getType() const
vtkStandardNewMacro(ttkHelloWorld)
#define ttkVtkTemplateMacro(dataType, triangulationType, call)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)