FreeMat

- Main Page
- Related Pages

vtkBalloonRepresentation

Section: Visualization Toolkit Widget Classes

# Usage

The vtkBalloonRepresentation is used to represent the vtkBalloonWidget. This representation is defined by two items: a text string and an image. At least one of these two items must be defined, but it is allowable to specify both, or just an image or just text. If both the text and image are specified, then methods are available for positioning the text and image with respect to each other.

The balloon representation consists of three parts: text, a rectangular frame behind the text, and an image placed next to the frame and sized to match the frame.

The size of the balloon is ultimately controlled by the text properties (i.e., font size). This representation uses a layout policy as follows.

If there is just text and no image, then the text properties and padding are used to control the size of the balloon.

If there is just an image and no text, then the ImageSize[2] member is used to control the image size. (The image will fit into this rectangle, but will not necessarily fill the whole rectangle, i.e., the image is not stretched).

If there is text and an image, the following approach ia used. First, based on the font size and other related properties (e.g., padding), determine the size of the frame. Second, depending on the layout of the image and text frame, control the size of the neighboring image (since the frame and image share a common edge). However, if this results in an image that is smaller than ImageSize[2], then the image size will be set to ImageSize[2] and the frame will be adjusted accordingly. The text is always placed in the center of the frame if the frame is resized.

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

      obj = vtkBalloonRepresentation

# Methods

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

- `string = obj.GetClassName ()` - Standard VTK methods.
- `int = obj.IsA (string name)` - Standard VTK methods.
- `vtkBalloonRepresentation = obj.NewInstance ()` - Standard VTK methods.
- `vtkBalloonRepresentation = obj.SafeDownCast (vtkObject o)` - Standard VTK methods.
- `obj.SetBalloonImage (vtkImageData img)` - Specify/retrieve the image to display in the balloon.
- `vtkImageData = obj.GetBalloonImage ()` - Specify/retrieve the image to display in the balloon.
- `string = obj.GetBalloonText ()` - Specify/retrieve the text to display in the balloon.
- `obj.SetBalloonText (string )` - Specify/retrieve the text to display in the balloon.
- `obj.SetImageSize (int , int )` - Specify the minimum size for the image. Note that this is a bounding rectangle, the image will fit inside of it. However, if the balloon consists of text plus an image, then the image may be bigger than ImageSize[2] to fit into the balloon frame.
- `obj.SetImageSize (int a[2])` - Specify the minimum size for the image. Note that this is a bounding rectangle, the image will fit inside of it. However, if the balloon consists of text plus an image, then the image may be bigger than ImageSize[2] to fit into the balloon frame.
- `int = obj. GetImageSize ()` - Specify the minimum size for the image. Note that this is a bounding rectangle, the image will fit inside of it. However, if the balloon consists of text plus an image, then the image may be bigger than ImageSize[2] to fit into the balloon frame.
- `obj.SetTextProperty (vtkTextProperty p)` - Set/get the text property (relevant only if text is shown).
- `vtkTextProperty = obj.GetTextProperty ()` - Set/get the text property (relevant only if text is shown).
- `obj.SetFrameProperty (vtkProperty2D p)` - Set/get the frame property (relevant only if text is shown). The frame lies behind the text.
- `vtkProperty2D = obj.GetFrameProperty ()` - Set/get the frame property (relevant only if text is shown). The frame lies behind the text.
- `obj.SetImageProperty (vtkProperty2D p)` - Set/get the image property (relevant only if an image is shown).
- `vtkProperty2D = obj.GetImageProperty ()` - Set/get the image property (relevant only if an image is shown).
- `obj.SetBalloonLayout (int )` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `int = obj.GetBalloonLayout ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToImageLeft ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToImageRight ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToImageBottom ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToImageTop ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToTextLeft ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToTextRight ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToTextTop ()` - Specify the layout of the image and text within the balloon. Note that there are reduncies in these methods, for example SetBalloonLayoutToImageLeft() results in the same effect as SetBalloonLayoutToTextRight(). If only text is specified, or only an image is specified, then it doesn't matter how the layout is specified.
- `obj.SetBalloonLayoutToTextBottom ()` - Set/Get the offset from the mouse pointer from which to place the balloon. The representation will try and honor this offset unless there is a collision with the side of the renderer, in which case the balloon will be repositioned to lie within the rendering window.
- `obj.SetOffset (int , int )` - Set/Get the offset from the mouse pointer from which to place the balloon. The representation will try and honor this offset unless there is a collision with the side of the renderer, in which case the balloon will be repositioned to lie within the rendering window.
- `obj.SetOffset (int a[2])` - Set/Get the offset from the mouse pointer from which to place the balloon. The representation will try and honor this offset unless there is a collision with the side of the renderer, in which case the balloon will be repositioned to lie within the rendering window.
- `int = obj. GetOffset ()` - Set/Get the offset from the mouse pointer from which to place the balloon. The representation will try and honor this offset unless there is a collision with the side of the renderer, in which case the balloon will be repositioned to lie within the rendering window.
- `obj.SetPadding (int )` - Set/Get the padding (in pixels) that is used between the text and the frame.
- `int = obj.GetPaddingMinValue ()` - Set/Get the padding (in pixels) that is used between the text and the frame.
- `int = obj.GetPaddingMaxValue ()` - Set/Get the padding (in pixels) that is used between the text and the frame.
- `int = obj.GetPadding ()` - Set/Get the padding (in pixels) that is used between the text and the frame.
- `obj.StartWidgetInteraction (double e[2])` - These are methods that satisfy vtkWidgetRepresentation's API.
- `obj.EndWidgetInteraction (double e[2])` - These are methods that satisfy vtkWidgetRepresentation's API.
- `obj.BuildRepresentation ()` - These are methods that satisfy vtkWidgetRepresentation's API.
- `obj.ReleaseGraphicsResources (vtkWindow w)` - Methods required by vtkProp superclass.
- `int = obj.RenderOverlay (vtkViewport viewport)` - Methods required by vtkProp superclass.