Documentation for vtkScalarBarActor

vtkScalarBarActor - Create a scalar bar with labels

Super Class: vtkActor2D

Description:

vtkScalarBarActor creates a scalar bar with annotation text. A scalar bar is a legend that indicates to the viewer the correspondance between color value and data value. The legend consists of a rectangular bar made of rectangular pieces each colored a constant value. Since vtkScalarBarActor is a subclass of vtkActor2D, it is drawn in the image plane (i.e., in the renderer's viewport) on top of the 3D graphics window. To use vtkScalarBarActor you must associate a vtkLookupTable (or subclass) with it. The lookup table defines the colors and the range of scalar values used to map scalar data. Typically, the number of colors shown in the scalar bar is not equal to the number of colors in the lookup table, in which case sampling of the lookup table is performed. Other optional capibilities include specifying the fraction of the viewport size (both x and y directions) which will control the size of the scalar bar, the number of annotation labels, and the font attributes of the annotation text. The actual position of the scalar bar on the screen is controlled by using the vtkActor2D::SetPosition() method (by default the scalar bar is centered in the viewport). Other features include the ability to orient the scalar bar horizontally of vertically and controlling the format (printf style) with which to print the labels on the scalar bar. Also, the vtkScalarBarActor's property is applied to the scalar bar and annotation (including color, layer, and compositing operator).

 

See Also:

vtkActor2D vtkTextMapper vtkPolyDataMapper2D

 

Methods:

void vtkScalarBarActor ()
void vtkScalarBarActor ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
static vtkScalarBarActor *New ()
void Render (vtkViewport *)
void SetLookupTable (vtkLookupTable *)
vtkLookupTable *GetLookupTable ()
void SetWidth (float )
float GetWidth ()
void SetHeight (float )
float GetHeight ()
void SetMaximumNumberOfColors (int )
int GetMaximumNumberOfColors ()
void SetNumberOfLabels (int )
int GetNumberOfLabels ()
void SetOrientation (int )
int GetOrientation ()
void SetOrientationToHorizontal ()
void SetOrientationToVertical ()
void SetFontSize (int )
int GetFontSize ()
void SetBold (int )
int GetBold ()
void BoldOn ()
void BoldOff ()
void SetItalic (int )
int GetItalic ()
void ItalicOn ()
void ItalicOff ()
void SetShadow (int )
int GetShadow ()
void ShadowOn ()
void ShadowOff ()
void SetFontFamily (int )
int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
void SetLabelFormat (char *)
char *GetLabelFormat ()
void SetTitle (char *)
char *GetTitle ()

 

Detailed Method Descriptions:

Instantiate object with 64 maximum colors; 5 labels; font size 12 of font Arial (bolding, italic, shadows on); %%-#6.3g label format, no title, and vertical orientation. The initial scalar bar size is (0.05 x 0.8) of the viewport size.

static vtkScalarBarActor *New ()

Draw the scalar bar and annotation text to the screen.

void Render (vtkViewport *)

Set/Get the vtkLookupTable to use. The lookup table specifies the number of colors to use in the table (if not overridden), as well as the scalar range.

void SetLookupTable (vtkLookupTable *)
vtkLookupTable *GetLookupTable ()

Set/Get the width of the scalar bar. The value is expressed as a fraction of the viewport. (Note: if the orientation of the scalar bar is vertical, then the width is in the direction of the viewport x-axis. If the orientation is horizontal, the width is in the direction of the viewport y-axis.)

void SetWidth (float )
float GetWidth ()

Set/Get the height of the scalar bar. The value is expressed as a fraction of the viewport. (Note: if the orientation of the scalar bar is vertical, then the height is in the direction of the viewport y-axis. If the orientation is horizontal, the height is in the direction of the viewport x-axis.)

void SetHeight (float )
float GetHeight ()

Set/Get the maximum number of scalar bar segements to show. This may differ from the number of colors in the lookup table, in which case the colors are samples from the lookup table.

void SetMaximumNumberOfColors (int )
int GetMaximumNumberOfColors ()

Set/Get the number of annotation labels to show.

void SetNumberOfLabels (int )
int GetNumberOfLabels ()

Control the orientation of the scalar bar.

void SetOrientation (int )
int GetOrientation ()
void SetOrientationToHorizontal ()
void SetOrientationToVertical ()

Set/Get suggested font size used to annotate the scalar bar. (Suggested because not all font sizes may be available.) Value is expressed in points

void SetFontSize (int )
int GetFontSize ()

Enable/Disable bolding annotation text.

void SetBold (int )
int GetBold ()
void BoldOn ()
void BoldOff ()

Enable/Disable italicizing annotation text.

void SetItalic (int )
int GetItalic ()
void ItalicOn ()
void ItalicOff ()

Enable/Disable creating shadows on the annotation text. Shadows make the text easier to read.

void SetShadow (int )
int GetShadow ()
void ShadowOn ()
void ShadowOff ()

Set/Get the font family for the annotation text. Three font types are available: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES).

void SetFontFamily (int )
int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()

Set/Get the format with which to print the labels on the scalar bar.

void SetLabelFormat (char *)
char *GetLabelFormat ()

Set/Get the title of the scalar bar actor,

void SetTitle (char *)
char *GetTitle ()