Colorbar labels value-dependent non-numeric label support
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Request to add user-supplied strings as color bar labels, for list of classes, thresholds, etc. Patch supplied.
DESCRIPTION: Displaying more descriptive labels than numerical labels next to colorbar legend is required. This patch allows adding colorbar text labels which depend on value with which the label will be mapped by extending syntax of currently existing label format mechanism. If 'Automatic Label Format' is turned off, ParaView will, for every label, search for {value1="string1" value2="string2" ...} in label format and if label's value matches to one of valueN in {}, it will replace entire construct with appropriate string, value is paired with.
For example, In case of %-#6.3g{0="Single" 7="Married"} and Max Number Of Labels set to 5, the following strings will be drawn: "0.000 Single", "2.0", "4.0", "6.0" "7.00 Married". Strings paired with values can be everything, so Values from previous example can be ommited if necessary. Also, all numerical data types values are supported (integer, floating point), so floating point is not necessary.
CHANGES: To make this patch, 2 changes were made (ParaView source patch):
- GetExtendedString() routine is added before definition of vtkPVScalarBarActor class (Ln 56-163) and
- Added preprocessing of specified label format before making output string (Ln 447-451).
patched file: vtkPVScalarBarActor.cxx action: copy to ParaView-3.14.0\ParaViewCore\VTKExtensions