Commit 692b14d6 authored by Cory Quammen's avatar Cory Quammen

Fix array association of pqArraySelectorPropertyWidget

It was set to the domain association in the vtkSMArrayListDomain, but
this corresponds to the original array association. However, that
original array association is not always the one that is required by
the source. E.g., the Contour filter requires "point" data arrays, and
if the input contains cell data arrays and the AutoConvertProperties
setting is enabled, cell data arrays will appear in the widget. Cell
data arrays are not allowed by the Contour filter, and with the prior
setup, cell data arrays would be passed to it. Instead, we need to
pass the point data array that is autoconverted from the cell data
array.

To remedy this, change the array association to the field association
from the vtkSMArrayListDomain. This ensures the required array type is
set where applicable.
parent ebe55edb
......@@ -113,12 +113,13 @@ public:
{
const auto aname = ald->GetString(cc);
const bool is_partial = ald->IsArrayPartial(cc) ? true : false;
const int assoc = ald->GetDomainAssociation(cc);
const int icon_association = ald->GetDomainAssociation(cc);
const int association = ald->GetFieldAssociation(cc);
const bool is_nonestring = (none_string && strcmp(none_string, aname) == 0);
const int index = combobox->count();
combobox->addItem(
is_nonestring ? get_none_icon() : get_icon(assoc), ::get_label(aname, is_partial));
combobox->setItemData(index, assoc, ArrayAssociationRole);
combobox->addItem(is_nonestring ? get_none_icon() : get_icon(icon_association),
::get_label(aname, is_partial));
combobox->setItemData(index, association, ArrayAssociationRole);
combobox->setItemData(index, aname, ArrayNameRole);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment