FreeMat

- Main Page
- Related Pages

vtkLegendBoxActor

Section: Visualization Toolkit Hybrid Classes

# Usage

vtkLegendBoxActor is used to associate a symbol with a text string. The user specifies a vtkPolyData to use as the symbol, and a string associated with the symbol. The actor can then be placed in the scene in the same way that any other vtkActor2D can be used.

To use this class, you must define the position of the legend box by using the superclasses' vtkActor2D::Position coordinate and Position2 coordinate. Then define the set of symbols and text strings that make up the menu box. The font attributes of the entries can be set through the vtkTextProperty associated to this actor. The class will scale the symbols and text to fit in the legend box defined by (Position,Position2). Optional features like turning on a border line and setting the spacing between the border and the symbols/text can also be set.

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

      obj = vtkLegendBoxActor

# Methods

The class vtkLegendBoxActor 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 vtkLegendBoxActor class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkLegendBoxActor = obj.NewInstance ()`
- `vtkLegendBoxActor = obj.SafeDownCast (vtkObject o)`
- `obj.SetNumberOfEntries (int num)` - Specify the number of entries in the legend box.
- `int = obj.GetNumberOfEntries ()` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntry (int i, vtkPolyData symbol, string string, double color[3])` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntrySymbol (int i, vtkPolyData symbol)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntryString (int i, string string)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntryColor (int i, double color[3])` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntryColor (int i, double r, double g, double b)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `vtkPolyData = obj.GetEntrySymbol (int i)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `string = obj.GetEntryString (int i)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `double = obj.GetEntryColor (int i)` - Add an entry to the legend box. You must supply a vtkPolyData to be used as a symbol (it can be NULL) and a text string (which also can be NULL). The vtkPolyData is assumed to be defined in the x-y plane, and the text is assumed to be a single line in height. Note that when this method is invoked previous entries are deleted. Also supply a text string and optionally a color. (If a color is not specified, then the entry color is the same as this actor's color.) (Note: use the set methods when you use SetNumberOfEntries().)
- `obj.SetEntryTextProperty (vtkTextProperty p)` - Set/Get the text property.
- `vtkTextProperty = obj.GetEntryTextProperty ()` - Set/Get the text property.
- `obj.SetBorder (int )` - Set/Get the flag that controls whether a border will be drawn around the legend box.
- `int = obj.GetBorder ()` - Set/Get the flag that controls whether a border will be drawn around the legend box.
- `obj.BorderOn ()` - Set/Get the flag that controls whether a border will be drawn around the legend box.
- `obj.BorderOff ()` - Set/Get the flag that controls whether a border will be drawn around the legend box.
- `obj.SetLockBorder (int )` - Set/Get the flag that controls whether the border and legend placement is locked into the rectangle defined by (Position,Position2). If off, then the legend box will adjust its size so that the border fits nicely around the text and symbols. (The ivar is off by default.) Note: the legend box is guaranteed to lie within the original border definition.
- `int = obj.GetLockBorder ()` - Set/Get the flag that controls whether the border and legend placement is locked into the rectangle defined by (Position,Position2). If off, then the legend box will adjust its size so that the border fits nicely around the text and symbols. (The ivar is off by default.) Note: the legend box is guaranteed to lie within the original border definition.
- `obj.LockBorderOn ()` - Set/Get the flag that controls whether the border and legend placement is locked into the rectangle defined by (Position,Position2). If off, then the legend box will adjust its size so that the border fits nicely around the text and symbols. (The ivar is off by default.) Note: the legend box is guaranteed to lie within the original border definition.
- `obj.LockBorderOff ()` - Set/Get the flag that controls whether the border and legend placement is locked into the rectangle defined by (Position,Position2). If off, then the legend box will adjust its size so that the border fits nicely around the text and symbols. (The ivar is off by default.) Note: the legend box is guaranteed to lie within the original border definition.
- `obj.SetBox (int )` - Set/Get the flag that controls whether a box will be drawn/filled corresponding to the legend box.
- `int = obj.GetBox ()` - Set/Get the flag that controls whether a box will be drawn/filled corresponding to the legend box.
- `obj.BoxOn ()` - Set/Get the flag that controls whether a box will be drawn/filled corresponding to the legend box.
- `obj.BoxOff ()` - Set/Get the flag that controls whether a box will be drawn/filled corresponding to the legend box.
- `vtkProperty2D = obj.GetBoxProperty ()` - Get the box vtkProperty2D.
- `obj.SetPadding (int )` - Set/Get the padding between the legend entries and the border. The value is specified in pixels.
- `int = obj.GetPaddingMinValue ()` - Set/Get the padding between the legend entries and the border. The value is specified in pixels.
- `int = obj.GetPaddingMaxValue ()` - Set/Get the padding between the legend entries and the border. The value is specified in pixels.
- `int = obj.GetPadding ()` - Set/Get the padding between the legend entries and the border. The value is specified in pixels.
- `obj.SetScalarVisibility (int )` - Turn on/off flag to control whether the symbol's scalar data is used to color the symbol. If off, the color of the vtkLegendBoxActor is used.
- `int = obj.GetScalarVisibility ()` - Turn on/off flag to control whether the symbol's scalar data is used to color the symbol. If off, the color of the vtkLegendBoxActor is used.
- `obj.ScalarVisibilityOn ()` - Turn on/off flag to control whether the symbol's scalar data is used to color the symbol. If off, the color of the vtkLegendBoxActor is used.
- `obj.ScalarVisibilityOff ()` - Turn on/off flag to control whether the symbol's scalar data is used to color the symbol. If off, the color of the vtkLegendBoxActor is used.
- `obj.ShallowCopy (vtkProp prop)` - Shallow copy of this scaled text actor. Overloads the virtual vtkProp method.