<div dir="ltr"><div>Hi all,</div><div><br></div><div>We have completed the implementation of a new mode for mappingĀ </div><div>scalars to colors for vtkPolyDataMapper (and related classes): VTK_COLOR_MODE_DIRECT_SCALARS.</div><div><br></div><div>If VTK_COLOR_MODE_DIRECT_SCALARS is set, then all arrays types</div><div><div>are treated as colors (integer types are clamped in the range 0-255,</div><div>floating point arrays are clamped in the range 0.0-1.0).</div></div><div><br></div><div>Contrast this mode with the traditional VTK modes:</div><div><div>VTK_COLOR_MODE_DEFAULT: only unsigned char</div></div><div>data arrays are treated as colors (and converted to RGBA if<br></div><div>necessary) all other types are mapped the the color map<br></div><div>VTK_COLOR_MODE_MAP_SCALARS: all arrays are mapped through the color map.<br></div><div><br></div><div><br></div><div>See<br></div><div><a href="http://review.source.kitware.com/#/t/5022/">http://review.source.kitware.com/#/t/5022/</a><br></div><div>For details of the implementation and classes affected.</div><div><br></div><div>Dan</div><div><br></div><div><br></div><div><br></div><div>---------- Forwarded message ----------</div><div>From: Utkarsh Ayachit <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>></div><div>Date: Wed, Nov 12, 2014 at 12:42 PM</div><div>Subject: Scalar coloring modes and polygonal rendering</div><div>To: "<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>></div><div><br></div><div><br></div><div>Folks,</div><div><br></div><div>vtkPolyDataMapper since a long time supports two coloring modes, viz.</div><div>VTK_COLOR_MODE_DEFAULT and VTK_COLOR_MODE_MAP_SCALARS. MapScalars</div><div>indicates always use a vtkScalarsToColors instance to map data values</div><div>to colors. Default means only use the vtkScalarsToColors if the data</div><div>array is not an unsigned char array.</div><div><br></div><div>I am working on a feature request [1] to add support to not use a</div><div>vtkScalarsToColors instance for non-unsigned-char arrays (including</div><div>double/float), assuming they are in the range 0, 1.</div><div><br></div><div>To support this mode without breaking current behavior, I am thinking</div><div>of adding a new VTK_COLOR_MODE_NO_MAP_SCALARS mode which can be used</div><div>to force interpreting the data values as colors directly.</div><div><br></div><div>Any objections to that? Also if any suggestions for the name for this</div><div>new mode are highly welcome.</div><div><br></div><div>Thanks</div><div>Utkarsh</div><div><br></div><div>[1] <a href="http://www.paraview.org/Bug/view.php?id=14943">http://www.paraview.org/Bug/view.php?id=14943</a></div></div>