VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkBalloonRepresentation Class Reference

represent the vtkBalloonWidget More...

#include <vtkBalloonRepresentation.h>

Inheritance diagram for vtkBalloonRepresentation:
[legend]
Collaboration diagram for vtkBalloonRepresentation:
[legend]

Public Types

enum  { ImageLeft =0, ImageRight, ImageBottom, ImageTop }
 
enum  _InteractionState { Outside =0, OnText, OnImage }
 
- Public Types inherited from vtkWidgetRepresentation
typedef vtkProp Superclass
 

Public Member Functions

virtual void SetBalloonImage (vtkImageData *img)
 
virtual vtkImageData * GetBalloonImage ()
 
virtual char * GetBalloonText ()
 
virtual void SetBalloonText (const char *)
 
virtual void SetImageSize (int, int)
 
void SetImageSize (int[2])
 
virtual int * GetImageSize ()
 
virtual void GetImageSize (int &, int &)
 
virtual void GetImageSize (int[2])
 
virtual void SetTextProperty (vtkTextProperty *p)
 
virtual vtkTextProperty * GetTextProperty ()
 
virtual void SetFrameProperty (vtkProperty2D *p)
 
virtual vtkProperty2D * GetFrameProperty ()
 
virtual void SetImageProperty (vtkProperty2D *p)
 
virtual vtkProperty2D * GetImageProperty ()
 
virtual void SetBalloonLayout (int)
 
virtual int GetBalloonLayout ()
 
void SetBalloonLayoutToImageLeft ()
 
void SetBalloonLayoutToImageRight ()
 
void SetBalloonLayoutToImageBottom ()
 
void SetBalloonLayoutToImageTop ()
 
void SetBalloonLayoutToTextLeft ()
 
void SetBalloonLayoutToTextRight ()
 
void SetBalloonLayoutToTextTop ()
 
void SetBalloonLayoutToTextBottom ()
 
virtual void SetOffset (int, int)
 
void SetOffset (int[2])
 
virtual int * GetOffset ()
 
virtual void GetOffset (int &, int &)
 
virtual void GetOffset (int[2])
 
virtual void SetPadding (int)
 
virtual int GetPadding ()
 
virtual void StartWidgetInteraction (double e[2])
 
virtual void EndWidgetInteraction (double e[2])
 
virtual void BuildRepresentation ()
 
virtual int ComputeInteractionState (int X, int Y, int modify=0)
 
virtual void ReleaseGraphicsResources (vtkWindow *w)
 
virtual int RenderOverlay (vtkViewport *viewport)
 
- Public Member Functions inherited from vtkWidgetRepresentation
virtual void PickingManagedOn ()
 
virtual void PickingManagedOff ()
 
virtual void SetPickingManaged (bool)
 
virtual bool GetPickingManaged ()
 
virtual void SetRenderer (vtkRenderer *ren)
 
virtual vtkRenderer * GetRenderer ()
 
virtual void PlaceWidget (double *vtkNotUsed(bounds[6]))
 
virtual void WidgetInteraction (double newEventPos[2])
 
virtual int GetInteractionState ()
 
virtual void Highlight (int vtkNotUsed(highlightOn))
 
virtual void SetPlaceFactor (double)
 
virtual double GetPlaceFactor ()
 
virtual void SetHandleSize (double)
 
virtual double GetHandleSize ()
 
virtual int GetNeedToRender ()
 
virtual void SetNeedToRender (int)
 
virtual void NeedToRenderOn ()
 
virtual void NeedToRenderOff ()
 
virtual double * GetBounds ()
 
virtual void ShallowCopy (vtkProp *prop)
 
virtual void GetActors (vtkPropCollection *)
 
virtual void GetActors2D (vtkPropCollection *)
 
virtual void GetVolumes (vtkPropCollection *)
 
virtual int RenderOverlay (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderOpaqueGeometry (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderTranslucentPolygonalGeometry (vtkViewport *vtkNotUsed(viewport))
 
virtual int RenderVolumetricGeometry (vtkViewport *vtkNotUsed(viewport))
 
virtual int HasTranslucentPolygonalGeometry ()
 
vtkWidgetRepresentationNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 

Static Public Member Functions

static vtkBalloonRepresentationNew ()
 
- Static Public Member Functions inherited from vtkWidgetRepresentation
static int IsTypeOf (const char *type)
 
static vtkWidgetRepresentationSafeDownCast (vtkObjectBase *o)
 

Protected Member Functions

 vtkBalloonRepresentation ()
 
 ~vtkBalloonRepresentation ()
 
void AdjustImageSize (double imageSize[2])
 
void ScaleImage (double imageSize[2], double scale)
 
- Protected Member Functions inherited from vtkWidgetRepresentation
 vtkWidgetRepresentation ()
 
 ~vtkWidgetRepresentation ()
 
void AdjustBounds (double bounds[6], double newBounds[6], double center[3])
 
virtual void RegisterPickers ()
 
virtual void UnRegisterPickers ()
 
virtual void PickersModified ()
 
vtkPickingManager * GetPickingManager ()
 
double SizeHandlesRelativeToViewport (double factor, double pos[3])
 
double SizeHandlesInPixels (double factor, double pos[3])
 
vtkAssemblyPath * GetAssemblyPath (double X, double Y, double Z, vtkAbstractPropPicker *picker)
 

Protected Attributes

char * BalloonText
 
vtkImageData * BalloonImage
 
int BalloonLayout
 
int Padding
 
int Offset [2]
 
int ImageSize [2]
 
vtkTextMapper * TextMapper
 
vtkActor2D * TextActor
 
vtkTextProperty * TextProperty
 
vtkTexture * Texture
 
vtkPolyDataTexturePolyData
 
vtkPoints * TexturePoints
 
vtkPolyDataMapper2D * TextureMapper
 
vtkActor2D * TextureActor
 
vtkProperty2D * ImageProperty
 
vtkPoints * FramePoints
 
vtkCellArrayFramePolygon
 
vtkPolyDataFramePolyData
 
vtkPolyDataMapper2D * FrameMapper
 
vtkActor2D * FrameActor
 
vtkProperty2D * FrameProperty
 
int TextVisible
 
int ImageVisible
 
- Protected Attributes inherited from vtkWidgetRepresentation
vtkWeakPointer< vtkRenderer > Renderer
 
int InteractionState
 
double StartEventPosition [3]
 
double PlaceFactor
 
int Placed
 
double InitialBounds [6]
 
double InitialLength
 
int ValidPick
 
bool PickingManaged
 
double HandleSize
 
int NeedToRender
 
vtkTimeStamp BuildTime
 
typedef vtkWidgetRepresentation Superclass
 
static int IsTypeOf (const char *type)
 
static vtkBalloonRepresentationSafeDownCast (vtkObjectBase *o)
 
virtual int IsA (const char *type)
 
vtkBalloonRepresentationNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkObjectBase * NewInstanceInternal () const
 

Detailed Description

represent the vtkBalloonWidget

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.

See Also
vtkBalloonWidget
Examples:
vtkBalloonRepresentation (Examples)
Tests:
vtkBalloonRepresentation (Tests)

Definition at line 81 of file vtkBalloonRepresentation.h.

Member Typedef Documentation

Standard VTK methods.

Definition at line 89 of file vtkBalloonRepresentation.h.

Member Enumeration Documentation

anonymous enum
Enumerator
ImageLeft 
ImageRight 
ImageBottom 
ImageTop 

Definition at line 134 of file vtkBalloonRepresentation.h.

State is either outside, or inside (on the text portion ot the image).

Enumerator
Outside 
OnText 
OnImage 

Definition at line 187 of file vtkBalloonRepresentation.h.

Constructor & Destructor Documentation

vtkBalloonRepresentation::vtkBalloonRepresentation ( )
protected
vtkBalloonRepresentation::~vtkBalloonRepresentation ( )
protected

Member Function Documentation

static vtkBalloonRepresentation* vtkBalloonRepresentation::New ( )
static

Instantiate the class.

static int vtkBalloonRepresentation::IsTypeOf ( const char *  type)
static

Standard VTK methods.

virtual int vtkBalloonRepresentation::IsA ( const char *  type)
virtual

Standard VTK methods.

Reimplemented from vtkWidgetRepresentation.

static vtkBalloonRepresentation* vtkBalloonRepresentation::SafeDownCast ( vtkObjectBase *  o)
static

Standard VTK methods.

virtual vtkObjectBase* vtkBalloonRepresentation::NewInstanceInternal ( ) const
protectedvirtual

Standard VTK methods.

Reimplemented from vtkWidgetRepresentation.

vtkBalloonRepresentation* vtkBalloonRepresentation::NewInstance ( ) const

Standard VTK methods.

void vtkBalloonRepresentation::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

Standard VTK methods.

virtual void vtkBalloonRepresentation::SetBalloonImage ( vtkImageData *  img)
virtual

Specify/retrieve the image to display in the balloon.

virtual vtkImageData* vtkBalloonRepresentation::GetBalloonImage ( )
virtual

Specify/retrieve the image to display in the balloon.

virtual char* vtkBalloonRepresentation::GetBalloonText ( )
virtual

Specify/retrieve the text to display in the balloon.

virtual void vtkBalloonRepresentation::SetBalloonText ( const char *  )
virtual

Specify/retrieve the text to display in the balloon.

virtual void vtkBalloonRepresentation::SetImageSize ( int  ,
int   
)
virtual

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.

void vtkBalloonRepresentation::SetImageSize ( int  [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.

virtual int* vtkBalloonRepresentation::GetImageSize ( )
virtual

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.

virtual void vtkBalloonRepresentation::GetImageSize ( int &  ,
int &   
)
virtual

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.

virtual void vtkBalloonRepresentation::GetImageSize ( int  [2])
virtual

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.

virtual void vtkBalloonRepresentation::SetTextProperty ( vtkTextProperty *  p)
virtual

Set/get the text property (relevant only if text is shown).

virtual vtkTextProperty* vtkBalloonRepresentation::GetTextProperty ( )
virtual

Set/get the text property (relevant only if text is shown).

virtual void vtkBalloonRepresentation::SetFrameProperty ( vtkProperty2D *  p)
virtual

Set/get the frame property (relevant only if text is shown). The frame lies behind the text.

virtual vtkProperty2D* vtkBalloonRepresentation::GetFrameProperty ( )
virtual

Set/get the frame property (relevant only if text is shown). The frame lies behind the text.

virtual void vtkBalloonRepresentation::SetImageProperty ( vtkProperty2D *  p)
virtual

Set/get the image property (relevant only if an image is shown).

virtual vtkProperty2D* vtkBalloonRepresentation::GetImageProperty ( )
virtual

Set/get the image property (relevant only if an image is shown).

virtual void vtkBalloonRepresentation::SetBalloonLayout ( int  )
virtual

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.

virtual int vtkBalloonRepresentation::GetBalloonLayout ( )
virtual

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.

void vtkBalloonRepresentation::SetBalloonLayoutToImageLeft ( )
inline

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.

Definition at line 145 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToImageRight ( )
inline

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.

Definition at line 146 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToImageBottom ( )
inline

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.

Definition at line 147 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToImageTop ( )
inline

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.

Definition at line 148 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToTextLeft ( )
inline

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.

Definition at line 149 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToTextRight ( )
inline

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.

Definition at line 150 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToTextTop ( )
inline

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.

Definition at line 151 of file vtkBalloonRepresentation.h.

void vtkBalloonRepresentation::SetBalloonLayoutToTextBottom ( )
inline

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.

Definition at line 152 of file vtkBalloonRepresentation.h.

virtual void vtkBalloonRepresentation::SetOffset ( int  ,
int   
)
virtual

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.

void vtkBalloonRepresentation::SetOffset ( int  [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.

virtual int* vtkBalloonRepresentation::GetOffset ( )
virtual

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.

virtual void vtkBalloonRepresentation::GetOffset ( int &  ,
int &   
)
virtual

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.

virtual void vtkBalloonRepresentation::GetOffset ( int  [2])
virtual

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.

virtual void vtkBalloonRepresentation::SetPadding ( int  )
virtual

Set/Get the padding (in pixels) that is used between the text and the frame.

virtual int vtkBalloonRepresentation::GetPadding ( )
virtual

Set/Get the padding (in pixels) that is used between the text and the frame.

virtual void vtkBalloonRepresentation::StartWidgetInteraction ( double  e[2])
virtual

These are methods that satisfy vtkWidgetRepresentation's API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkBalloonRepresentation::EndWidgetInteraction ( double  e[2])
virtual

These are methods that satisfy vtkWidgetRepresentation's API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkBalloonRepresentation::BuildRepresentation ( )
virtual

These are methods that satisfy vtkWidgetRepresentation's API.

Implements vtkWidgetRepresentation.

virtual int vtkBalloonRepresentation::ComputeInteractionState ( int  X,
int  Y,
int  modify = 0 
)
virtual

These are methods that satisfy vtkWidgetRepresentation's API.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkBalloonRepresentation::ReleaseGraphicsResources ( vtkWindow *  w)
virtual

Methods required by vtkProp superclass.

Reimplemented from vtkWidgetRepresentation.

virtual int vtkBalloonRepresentation::RenderOverlay ( vtkViewport *  viewport)
virtual

Methods required by vtkProp superclass.

void vtkBalloonRepresentation::AdjustImageSize ( double  imageSize[2])
protected
void vtkBalloonRepresentation::ScaleImage ( double  imageSize[2],
double  scale 
)
protected

Member Data Documentation

char* vtkBalloonRepresentation::BalloonText
protected

Definition at line 194 of file vtkBalloonRepresentation.h.

vtkImageData* vtkBalloonRepresentation::BalloonImage
protected

Definition at line 195 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::BalloonLayout
protected

Definition at line 198 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::Padding
protected

Definition at line 201 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::Offset[2]
protected

Definition at line 202 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::ImageSize[2]
protected

Definition at line 203 of file vtkBalloonRepresentation.h.

vtkTextMapper* vtkBalloonRepresentation::TextMapper
protected

Definition at line 206 of file vtkBalloonRepresentation.h.

vtkActor2D* vtkBalloonRepresentation::TextActor
protected

Definition at line 207 of file vtkBalloonRepresentation.h.

vtkTextProperty* vtkBalloonRepresentation::TextProperty
protected

Definition at line 208 of file vtkBalloonRepresentation.h.

vtkTexture* vtkBalloonRepresentation::Texture
protected

Definition at line 211 of file vtkBalloonRepresentation.h.

vtkPolyData* vtkBalloonRepresentation::TexturePolyData
protected

Definition at line 212 of file vtkBalloonRepresentation.h.

vtkPoints* vtkBalloonRepresentation::TexturePoints
protected

Definition at line 213 of file vtkBalloonRepresentation.h.

vtkPolyDataMapper2D* vtkBalloonRepresentation::TextureMapper
protected

Definition at line 214 of file vtkBalloonRepresentation.h.

vtkActor2D* vtkBalloonRepresentation::TextureActor
protected

Definition at line 215 of file vtkBalloonRepresentation.h.

vtkProperty2D* vtkBalloonRepresentation::ImageProperty
protected

Definition at line 216 of file vtkBalloonRepresentation.h.

vtkPoints* vtkBalloonRepresentation::FramePoints
protected

Definition at line 219 of file vtkBalloonRepresentation.h.

vtkCellArray* vtkBalloonRepresentation::FramePolygon
protected

Definition at line 220 of file vtkBalloonRepresentation.h.

vtkPolyData* vtkBalloonRepresentation::FramePolyData
protected

Definition at line 221 of file vtkBalloonRepresentation.h.

vtkPolyDataMapper2D* vtkBalloonRepresentation::FrameMapper
protected

Definition at line 222 of file vtkBalloonRepresentation.h.

vtkActor2D* vtkBalloonRepresentation::FrameActor
protected

Definition at line 223 of file vtkBalloonRepresentation.h.

vtkProperty2D* vtkBalloonRepresentation::FrameProperty
protected

Definition at line 224 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::TextVisible
protected

Definition at line 227 of file vtkBalloonRepresentation.h.

int vtkBalloonRepresentation::ImageVisible
protected

Definition at line 228 of file vtkBalloonRepresentation.h.


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