FreeMat

- Main Page
- Related Pages

vtkCaptionActor2D

Section: Visualization Toolkit Hybrid Classes

# Usage

vtkCaptionActor2D is a hybrid 2D/3D actor that is used to associate text with a point (the AttachmentPoint) in the scene. The caption can be drawn with a rectangular border and a leader connecting the caption to the attachment point. Optionally, the leader can be glyphed at its endpoint to create arrow heads or other indicators.

To use the caption actor, you normally specify the Position and Position2 coordinates (these are inherited from the vtkActor2D superclass). (Note that Position2 can be set using vtkActor2D's SetWidth() and SetHeight() methods.) Position and Position2 define the size of the caption, and a third point, the AttachmentPoint, defines a point that the caption is associated with. You must also define the caption text, whether you want a border around the caption, and whether you want a leader from the caption to the attachment point. The font attributes of the text can be set through the vtkTextProperty associated to this actor. You also indicate whether you want the leader to be 2D or 3D. (2D leaders are always drawn over the underlying geometry. 3D leaders may be occluded by the geometry.) The leader may also be terminated by an optional glyph (e.g., arrow).

The trickiest part about using this class is setting Position, Position2, and AttachmentPoint correctly. These instance variables are vtkCoordinates, and can be set up in various ways. In default usage, the AttachmentPoint is defined in the world coordinate system, Position is the lower-left corner of the caption and relative to AttachmentPoint (defined in display coordaintes, i.e., pixels), and Position2 is relative to Position and is the upper-right corner (also in display coordinates). However, the user has full control over the coordinates, and can do things like place the caption in a fixed position in the renderer, with the leader moving with the AttachmentPoint.

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

      obj = vtkCaptionActor2D

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkCaptionActor2D = obj.NewInstance ()`
- `vtkCaptionActor2D = obj.SafeDownCast (vtkObject o)`
- `obj.SetCaption (string )` - Define the text to be placed in the caption. The text can be multiple lines (separated by "\n").
- `string = obj.GetCaption ()` - Define the text to be placed in the caption. The text can be multiple lines (separated by "\n").
- `vtkCoordinate = obj.GetAttachmentPointCoordinate ()` - Set/Get the attachment point for the caption. By default, the attachment point is defined in world coordinates, but this can be changed using vtkCoordinate methods.
- `obj.SetAttachmentPoint (double, double, double)` - Set/Get the attachment point for the caption. By default, the attachment point is defined in world coordinates, but this can be changed using vtkCoordinate methods.
- `obj.SetAttachmentPoint (double a[3])` - Set/Get the attachment point for the caption. By default, the attachment point is defined in world coordinates, but this can be changed using vtkCoordinate methods.
- `double = obj.GetAttachmentPoint ()` - Set/Get the attachment point for the caption. By default, the attachment point is defined in world coordinates, but this can be changed using vtkCoordinate methods.
- `obj.SetBorder (int )` - Enable/disable the placement of a border around the text.
- `int = obj.GetBorder ()` - Enable/disable the placement of a border around the text.
- `obj.BorderOn ()` - Enable/disable the placement of a border around the text.
- `obj.BorderOff ()` - Enable/disable the placement of a border around the text.
- `obj.SetLeader (int )` - Enable/disable drawing a "line" from the caption to the attachment point.
- `int = obj.GetLeader ()` - Enable/disable drawing a "line" from the caption to the attachment point.
- `obj.LeaderOn ()` - Enable/disable drawing a "line" from the caption to the attachment point.
- `obj.LeaderOff ()` - Enable/disable drawing a "line" from the caption to the attachment point.
- `obj.SetThreeDimensionalLeader (int )` - Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).
- `int = obj.GetThreeDimensionalLeader ()` - Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).
- `obj.ThreeDimensionalLeaderOn ()` - Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).
- `obj.ThreeDimensionalLeaderOff ()` - Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).
- `obj.SetLeaderGlyph (vtkPolyData )` - Specify a glyph to be used as the leader "head". This could be something like an arrow or sphere. If not specified, no glyph is drawn. Note that the glyph is assumed to be aligned along the x-axis and is rotated about the origin.
- `vtkPolyData = obj.GetLeaderGlyph ()` - Specify a glyph to be used as the leader "head". This could be something like an arrow or sphere. If not specified, no glyph is drawn. Note that the glyph is assumed to be aligned along the x-axis and is rotated about the origin.
- `obj.SetLeaderGlyphSize (double )` - Specify the relative size of the leader head. This is expressed as a fraction of the size (diagonal length) of the renderer. The leader head is automatically scaled so that window resize, zooming or other camera motion results in proportional changes in size to the leader glyph.
- `double = obj.GetLeaderGlyphSizeMinValue ()` - Specify the relative size of the leader head. This is expressed as a fraction of the size (diagonal length) of the renderer. The leader head is automatically scaled so that window resize, zooming or other camera motion results in proportional changes in size to the leader glyph.
- `double = obj.GetLeaderGlyphSizeMaxValue ()` - Specify the relative size of the leader head. This is expressed as a fraction of the size (diagonal length) of the renderer. The leader head is automatically scaled so that window resize, zooming or other camera motion results in proportional changes in size to the leader glyph.
- `double = obj.GetLeaderGlyphSize ()` - Specify the relative size of the leader head. This is expressed as a fraction of the size (diagonal length) of the renderer. The leader head is automatically scaled so that window resize, zooming or other camera motion results in proportional changes in size to the leader glyph.
- `obj.SetMaximumLeaderGlyphSize (int )` - Specify the maximum size of the leader head (if any) in pixels. This is used in conjunction with LeaderGlyphSize to cap the maximum size of the LeaderGlyph.
- `int = obj.GetMaximumLeaderGlyphSizeMinValue ()` - Specify the maximum size of the leader head (if any) in pixels. This is used in conjunction with LeaderGlyphSize to cap the maximum size of the LeaderGlyph.
- `int = obj.GetMaximumLeaderGlyphSizeMaxValue ()` - Specify the maximum size of the leader head (if any) in pixels. This is used in conjunction with LeaderGlyphSize to cap the maximum size of the LeaderGlyph.
- `int = obj.GetMaximumLeaderGlyphSize ()` - Specify the maximum size of the leader head (if any) in pixels. This is used in conjunction with LeaderGlyphSize to cap the maximum size of the LeaderGlyph.
- `obj.SetPadding (int )` - Set/Get the padding between the caption and the border. The value is specified in pixels.
- `int = obj.GetPaddingMinValue ()` - Set/Get the padding between the caption and the border. The value is specified in pixels.
- `int = obj.GetPaddingMaxValue ()` - Set/Get the padding between the caption and the border. The value is specified in pixels.
- `int = obj.GetPadding ()` - Set/Get the padding between the caption and the border. The value is specified in pixels.
- `vtkTextActor = obj.GetTextActor ()` - Get the text actor used by the caption. This is useful if you want to control justification and other characteristics of the text actor.
- `obj.SetCaptionTextProperty (vtkTextProperty p)` - Set/Get the text property.
- `vtkTextProperty = obj.GetCaptionTextProperty ()` - Set/Get the text property.
- `obj.ShallowCopy (vtkProp prop)` - Shallow copy of this scaled text actor. Overloads the virtual vtkProp method.
- `obj.SetAttachEdgeOnly (int )` - Enable/disable whether to attach the arrow only to the edge, NOT the vertices of the caption border.
- `int = obj.GetAttachEdgeOnly ()` - Enable/disable whether to attach the arrow only to the edge, NOT the vertices of the caption border.
- `obj.AttachEdgeOnlyOn ()` - Enable/disable whether to attach the arrow only to the edge, NOT the vertices of the caption border.
- `obj.AttachEdgeOnlyOff ()` - Enable/disable whether to attach the arrow only to the edge, NOT the vertices of the caption border.