36 vtkInformationVector **inputVector,
37 vtkInformationVector *outputVector) {
39 const auto input = vtkDataSet::GetData(inputVector[0]);
40 auto output = vtkDataSet::GetData(outputVector);
43#ifndef TTK_ENABLE_KAMIKAZE
45 this->
printErr(
"Input pointer is NULL.");
48 if(!input->GetNumberOfPoints()) {
49 this->
printErr(
"Input has no point.");
52 if(!input->GetPointData()) {
53 this->
printErr(
"Input has no point data.");
57 this->
printErr(
"Output pointer is NULL.");
63 output->ShallowCopy(input);
65 const auto inputScalarField1 = this->GetInputArrayToProcess(0, input);
66 const auto inputScalarField2 = this->GetInputArrayToProcess(1, input);
68#ifndef TTK_ENABLE_KAMIKAZE
69 if(!inputScalarField1 || !inputScalarField2
70 || inputScalarField1->GetDataType() != inputScalarField2->GetDataType()) {
71 this->
printErr(
"Input scalar fields are NULL or have different types.");
78 inputScalarField1->NewInstance()};
82 outputScalarField->SetNumberOfTuples(numberOfPoints);
83 outputScalarField->SetName(DistanceFieldName.data());
84 output->GetPointData()->AddArray(outputScalarField);
87 switch(inputScalarField1->GetDataType()) {
88 vtkTemplateMacro(this->execute<VTK_TT>(
92 DistanceType, numberOfPoints));
95 vtkNew<vtkDoubleArray> meanDistanceArray{};
96 const std::string arrayName =
"L" + DistanceType +
"-distance";
97 meanDistanceArray->SetName(arrayName.c_str());
98 meanDistanceArray->SetNumberOfTuples(1);
99 meanDistanceArray->SetTuple1(0, this->
getResult());
100 output->GetFieldData()->AddArray(meanDistanceArray);