vtkScalarBarActor Class Reference

#include <vtkScalarBarActor.h>

Inheritance diagram for vtkScalarBarActor:

Inheritance graph
[legend]
Collaboration diagram for vtkScalarBarActor:

Collaboration graph
[legend]

List of all members.


Detailed Description

Create a scalar bar with labels.

vtkScalarBarActor creates a scalar bar with annotation text. A scalar bar is a legend that indicates to the viewer the correspondence 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 vtkScalarsToColors (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 capabilities include specifying the fraction of the viewport size (both x and y directions) which will control the size of the scalar bar and the number of annotation labels. 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 layer, and compositing operator).

Set the text property/attributes of the title and the labels through the vtkTextProperty objects associated to this actor.

Warning:
If a vtkLogLookupTable is specified as the lookup table to use, then the labels are created using a logarithmic scale.
See also:
vtkActor2D vtkTextProperty vtkTextMapper vtkPolyDataMapper2D
Tests:
vtkScalarBarActor (Tests)

Definition at line 73 of file vtkScalarBarActor.h.


Public Types

enum  { PrecedeScalarBar = 0, SucceedScalarBar }
typedef vtkActor2D Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int HasTranslucentPolygonalGeometry ()
virtual void ReleaseGraphicsResources (vtkWindow *)
void ShallowCopy (vtkProp *prop)
int RenderOpaqueGeometry (vtkViewport *viewport)
virtual int RenderTranslucentPolygonalGeometry (vtkViewport *)
int RenderOverlay (vtkViewport *viewport)
virtual void SetLookupTable (vtkScalarsToColors *)
virtual vtkScalarsToColorsGetLookupTable ()
virtual void SetUseOpacity (int)
virtual int GetUseOpacity ()
virtual void UseOpacityOn ()
virtual void UseOpacityOff ()
virtual void SetMaximumNumberOfColors (int)
virtual int GetMaximumNumberOfColors ()
virtual void SetNumberOfLabels (int)
virtual int GetNumberOfLabels ()
virtual void SetOrientation (int)
virtual int GetOrientation ()
void SetOrientationToHorizontal ()
void SetOrientationToVertical ()
virtual void SetTitleTextProperty (vtkTextProperty *p)
virtual vtkTextPropertyGetTitleTextProperty ()
virtual void SetLabelTextProperty (vtkTextProperty *p)
virtual vtkTextPropertyGetLabelTextProperty ()
virtual void SetLabelFormat (const char *)
virtual char * GetLabelFormat ()
virtual void SetTitle (const char *)
virtual char * GetTitle ()
virtual void SetTextureGridWidth (double)
virtual double GetTextureGridWidth ()
virtual vtkActor2DGetTextureActor ()
virtual void SetTextPosition (int)
virtual int GetTextPosition ()
virtual void SetTextPositionToPrecedeScalarBar ()
virtual void SetTextPositionToSucceedScalarBar ()
virtual void SetMaximumWidthInPixels (int)
virtual int GetMaximumWidthInPixels ()
virtual void SetMaximumHeightInPixels (int)
virtual int GetMaximumHeightInPixels ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkScalarBarActorSafeDownCast (vtkObject *o)
static vtkScalarBarActorNew ()

Protected Member Functions

 vtkScalarBarActor ()
 ~vtkScalarBarActor ()
virtual void AllocateAndSizeLabels (int *labelSize, int *size, vtkViewport *viewport, double *range)
virtual void SizeTitle (int *titleSize, int *size, vtkViewport *viewport)

Protected Attributes

vtkScalarsToColorsLookupTable
vtkTextPropertyTitleTextProperty
vtkTextPropertyLabelTextProperty
int MaximumNumberOfColors
int NumberOfLabels
int NumberOfLabelsBuilt
int Orientation
char * Title
char * LabelFormat
int UseOpacity
double TextureGridWidth
int TextPosition
vtkTextMapper ** TextMappers
vtkActor2D ** TextActors
vtkTextMapperTitleMapper
vtkActor2DTitleActor
vtkPolyDataScalarBar
vtkPolyDataMapper2DScalarBarMapper
vtkActor2DScalarBarActor
vtkPolyDataTexturePolyData
vtkTextureTexture
vtkActor2DTextureActor
vtkTimeStamp BuildTime
int LastSize [2]
int LastOrigin [2]
int MaximumWidthInPixels
int MaximumHeightInPixels

Member Typedef Documentation

Reimplemented from vtkActor2D.

Definition at line 76 of file vtkScalarBarActor.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
PrecedeScalarBar 
SucceedScalarBar 

Definition at line 181 of file vtkScalarBarActor.h.


Constructor & Destructor Documentation

vtkScalarBarActor::vtkScalarBarActor (  )  [protected]

vtkScalarBarActor::~vtkScalarBarActor (  )  [protected]


Member Function Documentation

virtual const char* vtkScalarBarActor::GetClassName (  )  [virtual]

Reimplemented from vtkActor2D.

static int vtkScalarBarActor::IsTypeOf ( const char *  name  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

virtual int vtkScalarBarActor::IsA ( const char *  name  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

static vtkScalarBarActor* vtkScalarBarActor::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkActor2D.

void vtkScalarBarActor::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkActor2D.

static vtkScalarBarActor* vtkScalarBarActor::New (  )  [static]

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

Reimplemented from vtkActor2D.

int vtkScalarBarActor::RenderOpaqueGeometry ( vtkViewport viewport  )  [virtual]

Draw the scalar bar and annotation text to the screen.

Reimplemented from vtkActor2D.

virtual int vtkScalarBarActor::RenderTranslucentPolygonalGeometry ( vtkViewport  )  [inline, virtual]

Draw the scalar bar and annotation text to the screen.

Reimplemented from vtkActor2D.

Definition at line 87 of file vtkScalarBarActor.h.

int vtkScalarBarActor::RenderOverlay ( vtkViewport viewport  )  [virtual]

Draw the scalar bar and annotation text to the screen.

Reimplemented from vtkActor2D.

virtual int vtkScalarBarActor::HasTranslucentPolygonalGeometry (  )  [virtual]

Does this prop have some translucent polygonal geometry?

Reimplemented from vtkActor2D.

virtual void vtkScalarBarActor::ReleaseGraphicsResources ( vtkWindow  )  [virtual]

Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.

Reimplemented from vtkActor2D.

virtual void vtkScalarBarActor::SetLookupTable ( vtkScalarsToColors  )  [virtual]

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.

virtual vtkScalarsToColors* vtkScalarBarActor::GetLookupTable (  )  [virtual]

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.

virtual void vtkScalarBarActor::SetUseOpacity ( int   )  [virtual]

Should be display the opacity as well. This is displayed by changing the opacity of the scalar bar in accordance with the opacity of the given color. For clarity, a texture grid is placed in the background if Opacity is ON. You might also want to play with SetTextureGridWith in that case. [Default: off]

virtual int vtkScalarBarActor::GetUseOpacity (  )  [virtual]

Should be display the opacity as well. This is displayed by changing the opacity of the scalar bar in accordance with the opacity of the given color. For clarity, a texture grid is placed in the background if Opacity is ON. You might also want to play with SetTextureGridWith in that case. [Default: off]

virtual void vtkScalarBarActor::UseOpacityOn (  )  [virtual]

Should be display the opacity as well. This is displayed by changing the opacity of the scalar bar in accordance with the opacity of the given color. For clarity, a texture grid is placed in the background if Opacity is ON. You might also want to play with SetTextureGridWith in that case. [Default: off]

virtual void vtkScalarBarActor::UseOpacityOff (  )  [virtual]

Should be display the opacity as well. This is displayed by changing the opacity of the scalar bar in accordance with the opacity of the given color. For clarity, a texture grid is placed in the background if Opacity is ON. You might also want to play with SetTextureGridWith in that case. [Default: off]

virtual void vtkScalarBarActor::SetMaximumNumberOfColors ( int   )  [virtual]

Set/Get the maximum number of scalar bar segments 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.

virtual int vtkScalarBarActor::GetMaximumNumberOfColors (  )  [virtual]

Set/Get the maximum number of scalar bar segments 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.

virtual void vtkScalarBarActor::SetNumberOfLabels ( int   )  [virtual]

Set/Get the number of annotation labels to show.

virtual int vtkScalarBarActor::GetNumberOfLabels (  )  [virtual]

Set/Get the number of annotation labels to show.

virtual void vtkScalarBarActor::SetOrientation ( int   )  [virtual]

Control the orientation of the scalar bar.

virtual int vtkScalarBarActor::GetOrientation (  )  [virtual]

Control the orientation of the scalar bar.

void vtkScalarBarActor::SetOrientationToHorizontal (  )  [inline]

Control the orientation of the scalar bar.

Definition at line 136 of file vtkScalarBarActor.h.

void vtkScalarBarActor::SetOrientationToVertical (  )  [inline]

Control the orientation of the scalar bar.

Definition at line 138 of file vtkScalarBarActor.h.

virtual void vtkScalarBarActor::SetTitleTextProperty ( vtkTextProperty p  )  [virtual]

Set/Get the title text property.

virtual vtkTextProperty* vtkScalarBarActor::GetTitleTextProperty (  )  [virtual]

Set/Get the title text property.

virtual void vtkScalarBarActor::SetLabelTextProperty ( vtkTextProperty p  )  [virtual]

Set/Get the labels text property.

virtual vtkTextProperty* vtkScalarBarActor::GetLabelTextProperty (  )  [virtual]

Set/Get the labels text property.

virtual void vtkScalarBarActor::SetLabelFormat ( const char *   )  [virtual]

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

virtual char* vtkScalarBarActor::GetLabelFormat (  )  [virtual]

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

virtual void vtkScalarBarActor::SetTitle ( const char *   )  [virtual]

Set/Get the title of the scalar bar actor,

virtual char* vtkScalarBarActor::GetTitle (  )  [virtual]

Set/Get the title of the scalar bar actor,

void vtkScalarBarActor::ShallowCopy ( vtkProp prop  )  [virtual]

Shallow copy of a scalar bar actor. Overloads the virtual vtkProp method.

Reimplemented from vtkActor2D.

virtual void vtkScalarBarActor::SetTextureGridWidth ( double   )  [virtual]

Set the width of the texture grid. Used only if UseOpacity is ON.

virtual double vtkScalarBarActor::GetTextureGridWidth (  )  [virtual]

Set the width of the texture grid. Used only if UseOpacity is ON.

virtual vtkActor2D* vtkScalarBarActor::GetTextureActor (  )  [virtual]

Get the texture actor.. you may want to change some properties on it

virtual void vtkScalarBarActor::SetTextPosition ( int   )  [virtual]

Have the text preceding the scalar bar or suceeding it ? Succeed implies the that the text is Above scalar bar if orientation is horizontal or Right of scalar bar if orientation is vertical. Precede is the opposite

virtual int vtkScalarBarActor::GetTextPosition (  )  [virtual]

Have the text preceding the scalar bar or suceeding it ? Succeed implies the that the text is Above scalar bar if orientation is horizontal or Right of scalar bar if orientation is vertical. Precede is the opposite

virtual void vtkScalarBarActor::SetTextPositionToPrecedeScalarBar (  )  [inline, virtual]

Have the text preceding the scalar bar or suceeding it ? Succeed implies the that the text is Above scalar bar if orientation is horizontal or Right of scalar bar if orientation is vertical. Precede is the opposite

Definition at line 191 of file vtkScalarBarActor.h.

virtual void vtkScalarBarActor::SetTextPositionToSucceedScalarBar (  )  [inline, virtual]

Have the text preceding the scalar bar or suceeding it ? Succeed implies the that the text is Above scalar bar if orientation is horizontal or Right of scalar bar if orientation is vertical. Precede is the opposite

Definition at line 193 of file vtkScalarBarActor.h.

virtual void vtkScalarBarActor::SetMaximumWidthInPixels ( int   )  [virtual]

Set/Get the maximum width and height in pixels. Specifying the size as a relative fraction of the viewport can sometimes undersirably strech the size of the actor too much. These methods allow the user to set bounds on the maximum size of the scalar bar in pixels along any direction. Defaults to unbounded.

virtual int vtkScalarBarActor::GetMaximumWidthInPixels (  )  [virtual]

Set/Get the maximum width and height in pixels. Specifying the size as a relative fraction of the viewport can sometimes undersirably strech the size of the actor too much. These methods allow the user to set bounds on the maximum size of the scalar bar in pixels along any direction. Defaults to unbounded.

virtual void vtkScalarBarActor::SetMaximumHeightInPixels ( int   )  [virtual]

Set/Get the maximum width and height in pixels. Specifying the size as a relative fraction of the viewport can sometimes undersirably strech the size of the actor too much. These methods allow the user to set bounds on the maximum size of the scalar bar in pixels along any direction. Defaults to unbounded.

virtual int vtkScalarBarActor::GetMaximumHeightInPixels (  )  [virtual]

Set/Get the maximum width and height in pixels. Specifying the size as a relative fraction of the viewport can sometimes undersirably strech the size of the actor too much. These methods allow the user to set bounds on the maximum size of the scalar bar in pixels along any direction. Defaults to unbounded.

virtual void vtkScalarBarActor::AllocateAndSizeLabels ( int *  labelSize,
int *  size,
vtkViewport viewport,
double *  range 
) [protected, virtual]

virtual void vtkScalarBarActor::SizeTitle ( int *  titleSize,
int *  size,
vtkViewport viewport 
) [protected, virtual]


Member Data Documentation

Definition at line 213 of file vtkScalarBarActor.h.

Definition at line 214 of file vtkScalarBarActor.h.

Definition at line 215 of file vtkScalarBarActor.h.

Definition at line 217 of file vtkScalarBarActor.h.

Definition at line 218 of file vtkScalarBarActor.h.

Definition at line 219 of file vtkScalarBarActor.h.

Definition at line 220 of file vtkScalarBarActor.h.

char* vtkScalarBarActor::Title [protected]

Definition at line 221 of file vtkScalarBarActor.h.

char* vtkScalarBarActor::LabelFormat [protected]

Definition at line 222 of file vtkScalarBarActor.h.

Definition at line 223 of file vtkScalarBarActor.h.

Definition at line 224 of file vtkScalarBarActor.h.

Definition at line 225 of file vtkScalarBarActor.h.

Definition at line 227 of file vtkScalarBarActor.h.

Definition at line 228 of file vtkScalarBarActor.h.

Definition at line 232 of file vtkScalarBarActor.h.

Definition at line 233 of file vtkScalarBarActor.h.

Definition at line 236 of file vtkScalarBarActor.h.

Definition at line 237 of file vtkScalarBarActor.h.

Definition at line 238 of file vtkScalarBarActor.h.

Definition at line 240 of file vtkScalarBarActor.h.

Definition at line 241 of file vtkScalarBarActor.h.

Definition at line 242 of file vtkScalarBarActor.h.

Definition at line 244 of file vtkScalarBarActor.h.

int vtkScalarBarActor::LastSize[2] [protected]

Definition at line 245 of file vtkScalarBarActor.h.

int vtkScalarBarActor::LastOrigin[2] [protected]

Definition at line 246 of file vtkScalarBarActor.h.

Definition at line 248 of file vtkScalarBarActor.h.

Definition at line 249 of file vtkScalarBarActor.h.


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 18:48:48 2010 for VTK by  doxygen 1.5.6