Add categorical data to vtkLookupTable.

Change-Id: I123e0eb3833a8c5dd5d1c399e70ecffe8ba7ec5c
Color mapping using only annotated values.

This patch implements an "indexed" color mode for `vtkLookupTable`.
When `IndexedLookup` is true, the scalar range and log/linear settings are disabled;
`MapScalars` and `MapValue` require an exact match to an annotated value
in order to return a valid color.
All other values are mapped to `NanColor`.

Change-Id: I9805ab6b4398db479c0ae6b0d239886850c2e187
Test categorical color lookup and Brewer colors.

Change-Id: I920bf7f495b25fdb7cde1743db7965ce73885698
Clarify documentation before changes.

Before we add user-specified annotation, make it clear
that the pre-existing text annotations were all tick marks.

Change-Id: I5ec62932e2768255a8149f725561efe39cbf1baf
Make annotation API more consistent.

+ Make `GetIndex()` work consistently whether `IndexedLookup`
  is true or false.
+ Make `GetIndex()` and `MapValue()` properly handle NaN values
  when `IndexedLookup` is false.
+ Return a `vtkIdType` for the number of annotated values.
  (The previous `vtkVariant` was a cut-and-paste error.)

Change-Id: I4586ab117200cca73b021ce0d01782a7da958b45
Color swatches for categorical scalar bar.

When a `vtkLookupTable` with `IndexedLookup` set to true
is passed to `vtkScalarBarActor`, the scalar bar is not drawn.
Instead, a set of distinct color swatches is rendered -- one
for each annotated value stored in the lookup table.
The labels stored with each annotation are not yet rendered.

Change-Id: I3849e5bf99a58ae8884f4061336545781f7b3c65
Initial annotation labels.

Labels are now allocated and displayed, but
their positions are only computed for vertical layouts and
overlap is not prevented. Leader lines are not rendered yet.

Change-Id: I64ce46cac754dd5dd9b736605c60ec2fe7e79456
Better layout of text in vertical case.

Now annotation text won't overlap.
This requires an uncommitted change to vtkMathTextActor
to properly compute bounding rectangles before the first render.

Change-Id: I40eb512e4406fb83eae5933264fa72fe6498eda0
Label horizontal swatches properly.

Now both horizontal and vertical orientations are annotated
properly in `IndexedLookup` mode.

Change-Id: I4d2bcfecdd2b1bc8f72192a7f5706ac7167d4a67
Leader lines implemented.

The only untested functionality is how the `TextPosition`
setting interacts with label and leader placement.

Change-Id: Ie93e8fe6fb260a990e3da55f03e7c451d8bdb897
Leader lines tested.

Fixes for empty annotation strings and for both
TextPosition values (PrecedeScalarBar and SucceedScalarBar).

Change-Id: I4cff86d1e38c222b8dfa7b2aeb1a2a26afef8842
Move most annotation stuff to `vtkScalarsToColors`.

... which is where it belongs. The only parts remaining
in `vtkLookupTable` are the changes to `MapValue` and
`MapScalarsThroughTable2` which are table-specific.

Change-Id: I47da9d3fb7478d37a560f7019f917952103df9e2
Rendering fixes for vtkMathTextActor.

Now `vtkMathTextActor` inherits from `vtkTextActor`
from the `vtkRenderingFreeType` kit. It uses the `vtkTextActor`
to render as a fallback when a `vtkMathTextUtilities`
instance is not available.

Also, the bounding box is computed properly even before
a render (by assuming a display resolution in order
to decide on a texture image size).

Change-Id: I7f9e41f7714cc4e6e0efb42091dc313e0336fa9d
Test IndexedLookup mode of the scalar bar widget.

This test is a modified version of `TestScalarBarWidget`
that tests the categorical colormap functionality.

Change-Id: I44c98f97e6e49af354789fdba02f34adb5f1b171
Handle annotation insertion w/ empty color table.

Change-Id: If57a5a939ca56b1e0c1aa6934d17137ac9cc14cc
Fixes from Yumin and Gerrit CDash warnings.

Change-Id: Icb5a062c4adaded172e09fed798df7a3e94b464a
Fix `vtkScalarsToColors::DeepCopy`.

Change-Id: If7d25004d069ed17a8178d0331eb63fb1edadba9
Merge topic 'categorical-color' into master

948b677c Fix `vtkScalarsToColors::DeepCopy`.
2af887a6 Fixes from Yumin and Gerrit CDash warnings.
2349de31 Handle annotation insertion w/ empty color table.
478cec1f Test IndexedLookup mode of the scalar bar widget.
83053671 Rendering fixes for vtkMathTextActor.
de162c7b Move most annotation stuff to `vtkScalarsToColors`.
60a7a980 Leader lines tested.
a0645379 Leader lines implemented.
039e2574 Label horizontal swatches properly.
d4c03f44 Better layout of text in vertical case.
c4255f1e Initial annotation labels.
e7f4e894 Color swatches for categorical scalar bar.
dd7fe488 Make annotation API more consistent.
43560e39 Clarify documentation before changes.
1a837f71 Test categorical color lookup and Brewer colors.
ee78433e Color mapping using only annotated values.
649a62b1 Add categorical data to vtkLookupTable.