Commit 7e94f4ff authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic 'fix_input_array_domains'

5234ed6f Merge remote-tracking branch 'origin/master' into fix_input_array_domains
894426cc Exclude field arrays from filter selections.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !606
parents af641148 5234ed6f
Pipeline #7943 running with stage
......@@ -212,7 +212,7 @@ void vtkSMArrayListDomainInternals::BuildArrayList(
{
continue;
}
assert(acceptable_as != vtkSMInputArrayDomain::ANY);
assert(acceptable_as != vtkSMInputArrayDomain::ANY && acceptable_as != vtkSMInputArrayDomain::ANY_EXCEPT_FIELD);
// iterate over all arrays and add them to the list, if acceptable.
for (int idx=0, maxIdx=attrInfo->GetNumberOfArrays(); idx < maxIdx; ++idx)
......
......@@ -31,17 +31,18 @@ static const char* const vtkSMInputArrayDomainAttributeTypes[] = {
"point",
"cell",
"field",
"any",
"any-except-field",
"vertex",
"edge",
"row",
"any",
NULL
};
//---------------------------------------------------------------------------
vtkSMInputArrayDomain::vtkSMInputArrayDomain()
{
this->AttributeType = vtkSMInputArrayDomain::ANY;
this->AttributeType = vtkSMInputArrayDomain::ANY_EXCEPT_FIELD;
this->NumberOfComponents = 0;
}
......@@ -142,6 +143,29 @@ bool vtkSMInputArrayDomain::IsAttributeTypeAcceptable(
attribute_type == ROW;
}
if (required_type == ANY_EXCEPT_FIELD)
{
// Try out all attribute types except field data sequentially.
int attribute_types_to_try[] =
{
vtkDataObject::POINT,
vtkDataObject::CELL,
vtkDataObject::VERTEX,
vtkDataObject::EDGE,
vtkDataObject::ROW,
-1
};
for (int cc=0; attribute_types_to_try[cc] != -1; ++cc)
{
if (vtkSMInputArrayDomain::IsAttributeTypeAcceptable(
attribute_types_to_try[cc], attribute_type, acceptable_as_type))
{
return true;
}
}
return false;
}
switch (attribute_type)
{
case vtkDataObject::POINT:
......
......@@ -29,17 +29,22 @@
// appropriate.
//
// Supported XML attributes:
// \li \c attribute_type : (optional) value can be 'point', 'cell', 'any',
// 'vertex', 'edge', 'row', 'none'. If no specified,
// 'any' is assumed. This indicates the attribute type
// for acceptable arrays. Note "any" implies all types
// of attribute data (thus doesn't include field data
// since it's not attribute data).
// \li \c attribute_type : (optional) value can be 'point', 'cell', 'field',
// 'vertex', 'edge', 'row', 'none', 'any-except-field', 'any'.
// If not specified, 'any-except-field' is assumed. This
// indicates the attribute type for acceptable arrays.
// \li \c number_of_components : (optional) 0 by default. If non-zero, indicates
// the component count for acceptable arrays.
//
// This domain doesn't support any required properties (to help clean old
// code, we print a warning if any required properties are specified).
//
// .SECTION Note on change in behaviour
// Prior to ParaView 5.0, attribute_type="any" meant all attributes excepting
// field data. For being consistent with general understanding of "any", this
// has been changed to include field data arrays since 5.0. Use
// "any-except-field" for cases where the intention is to match any attribute arrays except
// field data arrays.
#ifndef vtkSMInputArrayDomain_h
#define vtkSMInputArrayDomain_h
......@@ -96,11 +101,12 @@ public:
POINT = vtkDataObject::POINT,
CELL = vtkDataObject::CELL,
FIELD = vtkDataObject::FIELD,
ANY = vtkDataObject::POINT_THEN_CELL,
ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
VERTEX = vtkDataObject::VERTEX,
EDGE = vtkDataObject::EDGE,
ROW = vtkDataObject::ROW,
NUMBER_OF_ATTRIBUTE_TYPES = vtkDataObject::NUMBER_OF_ATTRIBUTE_TYPES
ANY = vtkDataObject::NUMBER_OF_ATTRIBUTE_TYPES,
NUMBER_OF_ATTRIBUTE_TYPES = ANY+1,
};
// Description:
......
......@@ -8333,8 +8333,7 @@ source.</Documentation>
name="input_type">
<DataType value="vtkDataSet" />
</DataTypeDomain>
<InputArrayDomain attribute_type="any"
name="input_array"
<InputArrayDomain name="input_array"
number_of_components="3" />
<Documentation>This property specifies the input to the Stream Tracer
filter.</Documentation>
......
......@@ -21,8 +21,7 @@
name="input_type">
<DataType value="vtkUnstructuredGridBase" />
</DataTypeDomain>
<InputArrayDomain attribute_type="any"
name="input_array_any">
<InputArrayDomain name="input_array_any">
</InputArrayDomain>
<Documentation>Set the input to the representation.</Documentation>
</InputProperty>
......
......@@ -14,8 +14,7 @@
name="input_type">
<DataType value="vtkUnstructuredGridBase" />
</DataTypeDomain>
<InputArrayDomain attribute_type="any"
name="input_array_any">
<InputArrayDomain name="input_array_any">
</InputArrayDomain>
<Documentation>Set the input to the representation.</Documentation>
</InputProperty>
......
......@@ -92,7 +92,7 @@ timestep.
<DataTypeDomain name="input_type">
<DataType value="vtkDataSet" />
</DataTypeDomain>
<InputArrayDomain attribute_type="none"
<InputArrayDomain attribute_type="field"
name="input_array"
number_of_components="1" />
<Documentation>Set the input of the filter.</Documentation>
......
......@@ -4938,8 +4938,7 @@
dataset.</Documentation>
<InputProperty command="SetInputConnection"
name="Input">
<InputArrayDomain attribute_type="any"
name="input_array_any"></InputArrayDomain>
<InputArrayDomain name="input_array_any"></InputArrayDomain>
</InputProperty>
<IntVectorProperty command="SetVisibility"
default_values="1"
......@@ -5200,8 +5199,7 @@
<Documentation>Proxy to show a selection as geometry.</Documentation>
<InputProperty command="SetInputConnection"
name="Input">
<InputArrayDomain attribute_type="any"
name="input_array_any"></InputArrayDomain>
<InputArrayDomain name="input_array_any"></InputArrayDomain>
</InputProperty>
<IntVectorProperty command="SetVisibility"
default_values="1"
......
......@@ -14,8 +14,7 @@
name="input_type">
<DataType value="vtkDataSet" />
</DataTypeDomain>
<InputArrayDomain attribute_type="any"
name="input_array_any">
<InputArrayDomain name="input_array_any">
</InputArrayDomain>
<Documentation>Set the input to the representation.</Documentation>
</InputProperty>
......
......@@ -114,6 +114,17 @@ pqLinePropertyWidget | InteractiveLine | LineSourceWidgetRepresentation | pqLine
pqSpherePropertyWidget | InteractiveSphere | SphereWidgetRepresentation | pqSphereWidget, pqOrbitWidget
pqSplinePropertyWidget | InteractiveSpline or InteractivePolyLine | SplineWidgetRepresentation or PolyLineWidgetRepresentation | pqSplineWidget, pqPolyLineWidget
Changes in 5.0.1
----------------
###Changes to vtkSMInputArrayDomain###
vtkSMInputArrayDomain has changed the meaning of **"any"** attribute type. It
now includes field data arrays. To exclude field data arrays from the field
selection, change this to **"any-except-field"**. This is also the default for
vtkSMInputArrayDomain, hence simply removing the `attribute_type` field is also
an acceptable solution and is the recommended approach so that the XML can work
without changes in earlier versions of ParaView as well.
Changes in 5.0
--------------
......
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