Color separate blocks with different scalar arrays
vtkCompositePolyDataMapper
can now color separate blocks with different scalar arrays. In order to use this functionality, turn on ScalarVisibility
and select a ScalarMode
and/or a ColorMode
.
You can choose which scalar array or component of an array is used to map colors by overriding these parameters per block. Refer to vtkMapper
documentation. Here's a summary:
-
ArrayAccessMode:
VTK_GET_ARRAY_BY_ID
orVTK_GET_ARRAY_BY_NAME
- ArrayComponent: which component should be used to map an array?
- ArrayId: Applicable when arrays are accessed by indices. this integer is an index of the vtkDataArray on the point/cell data.
- ArrayName: Applicable when arrays are accessed by names.
- FieldDataTupleId: this integer is an index of the vtkDataArray on the field data.
The new unit test colors a partitoned dataset collection with 5 leaf vtkPolyData
. Four quads are colored by different scalar arrays each with a dedicated lookup table. The last quad does not have any scalars, so it is colored by a special NaN color.
TestCompositePolyDataMapperOverrideScalarArray
Edited by Jaswant Panchumarti (Kitware)