From 5ad9c708256dd629353b26b07e5e51933001e4b9 Mon Sep 17 00:00:00 2001 From: ccolin Date: Sat, 19 Feb 2022 00:39:00 +0100 Subject: [PATCH] specify aspect ratio filter input requirements --- src/aspect_ratio_filter.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/aspect_ratio_filter.cc b/src/aspect_ratio_filter.cc index b32019e..3dc70fa 100644 --- a/src/aspect_ratio_filter.cc +++ b/src/aspect_ratio_filter.cc @@ -1,18 +1,30 @@ #include "aspect_ratio_filter.h" +#include "vtkDataObject.h" #include #include #include #include #include +#include +#include vtkStandardNewMacro(AspectRatioFilter); +// Ensure there is an "angles", 12 floats tuple array in the DataCell. int AspectRatioFilter::FillInputPortInformation(int port, vtkInformation *info) { vtkUnstructuredGridAlgorithm::FillInputPortInformation(port, info); - // Ensure there is an "angles" array in the DataCell. + vtkNew anglesField; + anglesField->Set(vtkDataObject::FIELD_ASSOCIATION(), vtkDataObject::FIELD_ASSOCIATION_CELLS); + anglesField->Set(vtkDataObject::FIELD_NAME(), "angles"); + anglesField->Set(vtkDataObject::FIELD_NUMBER_OF_COMPONENTS(), 12); + anglesField->Set(vtkDataObject::FIELD_ARRAY_TYPE(), VTK_DOUBLE); + + vtkNew fields; + fields->Append(anglesField); + info->Set(vtkAlgorithm::INPUT_REQUIRED_FIELDS(), fields); return 1; }