FreeMat: vtkDynamic2DLabelMapper

FreeMat

- Main Page
- Related Pages

vtkDynamic2DLabelMapper

Section: Visualization Toolkit Rendering Classes

# Usage

vtkDynamic2DLabelMapper is a mapper that renders text at dataset points such that the labels do not overlap. Various items can be labeled including point ids, scalars, vectors, normals, texture coordinates, tensors, and field data components. This mapper assumes that the points are located on the x-y plane and that the camera remains perpendicular to that plane with a y-up axis (this can be constrained using vtkImageInteractor). On the first render, the mapper computes the visiblility of all labels at all scales, and queries this information on successive renders. This causes the first render to be much slower. The visibility algorithm is a greedy approach based on the point id, so the label for a point will be drawn unless the label for a point with lower id overlaps it.

To create an instance of class vtkDynamic2DLabelMapper, simply invoke its constructor as follows

      obj = vtkDynamic2DLabelMapper

# Methods

The class vtkDynamic2DLabelMapper has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkDynamic2DLabelMapper class.

- `string = obj.GetClassName ()` - Instantiate object with %%-#6.3g label format. By default, point ids are labeled.
- `int = obj.IsA (string name)` - Instantiate object with %%-#6.3g label format. By default, point ids are labeled.
- `vtkDynamic2DLabelMapper = obj.NewInstance ()` - Instantiate object with %%-#6.3g label format. By default, point ids are labeled.
- `vtkDynamic2DLabelMapper = obj.SafeDownCast (vtkObject o)` - Instantiate object with %%-#6.3g label format. By default, point ids are labeled.
- `obj.SetPriorityArrayName (string name)` - Set the points array name to use to give priority to labels. Defaults to "priority".
- `obj.SetReversePriority (bool )` - Whether to reverse the priority order (i.e. low values have high priority). Default is off.
- `bool = obj.GetReversePriority ()` - Whether to reverse the priority order (i.e. low values have high priority). Default is off.
- `obj.ReversePriorityOn ()` - Whether to reverse the priority order (i.e. low values have high priority). Default is off.
- `obj.ReversePriorityOff ()` - Whether to reverse the priority order (i.e. low values have high priority). Default is off.
- `obj.SetLabelHeightPadding (float )` - Set the label height padding as a percentage. The percentage is a percentage of your label height. Default is 50%.
- `float = obj.GetLabelHeightPadding ()` - Set the label height padding as a percentage. The percentage is a percentage of your label height. Default is 50%.
- `obj.SetLabelWidthPadding (float )` - Set the label width padding as a percentage. The percentage is a percentage of your label ^height^ (yes, not a typo). Default is 50%.
- `float = obj.GetLabelWidthPadding ()` - Set the label width padding as a percentage. The percentage is a percentage of your label ^height^ (yes, not a typo). Default is 50%.
- `obj.RenderOpaqueGeometry (vtkViewport viewport, vtkActor2D actor)` - Draw non-overlapping labels to the screen.
- `obj.RenderOverlay (vtkViewport viewport, vtkActor2D actor)` - Draw non-overlapping labels to the screen.