Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkCaptionActor2D Class Reference

#include <vtkCaptionActor2D.h>

Inheritance diagram for vtkCaptionActor2D:

Inheritance graph
[legend]
Collaboration diagram for vtkCaptionActor2D:

Collaboration graph
[legend]
List of all members.

Detailed Description

draw text label associated with a point

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.

See also:
vtkLegendBoxActor vtkTextMapper vtkTextActor vtkTextProperty vtkCoordinate
Tests:
vtkCaptionActor2D (Tests)

Definition at line 73 of file vtkCaptionActor2D.h.
virtual void SetCaption (const char *)
virtual char * GetCaption ()
static vtkCaptionActor2DNew ()

Public Types

typedef vtkActor2D Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void ShallowCopy (vtkProp *prop)
virtual vtkCoordinateGetAttachmentPointCoordinate ()
virtual void SetAttachmentPoint (float x[3])
virtual void SetAttachmentPoint (float x, float y, float z)
virtual float * GetAttachmentPoint ()
virtual void SetBorder (int)
virtual int GetBorder ()
virtual void BorderOn ()
virtual void BorderOff ()
virtual void SetLeader (int)
virtual int GetLeader ()
virtual void LeaderOn ()
virtual void LeaderOff ()
virtual void SetThreeDimensionalLeader (int)
virtual int GetThreeDimensionalLeader ()
virtual void ThreeDimensionalLeaderOn ()
virtual void ThreeDimensionalLeaderOff ()
virtual void SetLeaderGlyph (vtkPolyData *)
virtual vtkPolyDataGetLeaderGlyph ()
virtual void SetLeaderGlyphSize (double)
virtual double GetLeaderGlyphSize ()
virtual void SetMaximumLeaderGlyphSize (int)
virtual int GetMaximumLeaderGlyphSize ()
virtual void SetPadding (int)
virtual int GetPadding ()
virtual vtkTextActorGetTextActor ()
virtual void SetCaptionTextProperty (vtkTextProperty *p)
virtual vtkTextPropertyGetCaptionTextProperty ()
virtual void ReleaseGraphicsResources (vtkWindow *)
int RenderOpaqueGeometry (vtkViewport *viewport)
int RenderTranslucentGeometry (vtkViewport *)
int RenderOverlay (vtkViewport *viewport)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkCaptionActor2DSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkCaptionActor2D ()
 ~vtkCaptionActor2D ()

Protected Attributes

vtkCoordinateAttachmentPointCoordinate
char * Caption
int Border
int Leader
int ThreeDimensionalLeader
double LeaderGlyphSize
int MaximumLeaderGlyphSize
vtkPolyDataLeaderGlyph
int Padding


Member Typedef Documentation

typedef vtkActor2D vtkCaptionActor2D::Superclass
 

Reimplemented from vtkActor2D.

Definition at line 76 of file vtkCaptionActor2D.h.


Constructor & Destructor Documentation

vtkCaptionActor2D::vtkCaptionActor2D  )  [protected]
 

vtkCaptionActor2D::~vtkCaptionActor2D  )  [protected]
 


Member Function Documentation

virtual const char* vtkCaptionActor2D::GetClassName  )  [virtual]
 

Reimplemented from vtkActor2D.

static int vtkCaptionActor2D::IsTypeOf const char *  type  )  [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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

virtual int vtkCaptionActor2D::IsA const char *  type  )  [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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

static vtkCaptionActor2D* vtkCaptionActor2D::SafeDownCast vtkObject o  )  [static]
 

Reimplemented from vtkActor2D.

void vtkCaptionActor2D::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 vtkCaptionActor2D* vtkCaptionActor2D::New  )  [static]
 

Define the text to be placed in the caption. The text can be multiple lines (separated by "\n").

Reimplemented from vtkActor2D.

virtual void vtkCaptionActor2D::SetCaption const char *   )  [virtual]
 

Define the text to be placed in the caption. The text can be multiple lines (separated by "\n").

virtual char* vtkCaptionActor2D::GetCaption  )  [virtual]
 

Define the text to be placed in the caption. The text can be multiple lines (separated by "\n").

virtual vtkCoordinate* vtkCaptionActor2D::GetAttachmentPointCoordinate  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetAttachmentPoint float  x[3]  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetAttachmentPoint float  x,
float  y,
float  z
[virtual]
 

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.

virtual float* vtkCaptionActor2D::GetAttachmentPoint  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetBorder int   )  [virtual]
 

Enable/disable the placement of a border around the text.

virtual int vtkCaptionActor2D::GetBorder  )  [virtual]
 

Enable/disable the placement of a border around the text.

virtual void vtkCaptionActor2D::BorderOn  )  [virtual]
 

Enable/disable the placement of a border around the text.

virtual void vtkCaptionActor2D::BorderOff  )  [virtual]
 

Enable/disable the placement of a border around the text.

virtual void vtkCaptionActor2D::SetLeader int   )  [virtual]
 

Enable/disable drawing a "line" from the caption to the attachment point.

virtual int vtkCaptionActor2D::GetLeader  )  [virtual]
 

Enable/disable drawing a "line" from the caption to the attachment point.

virtual void vtkCaptionActor2D::LeaderOn  )  [virtual]
 

Enable/disable drawing a "line" from the caption to the attachment point.

virtual void vtkCaptionActor2D::LeaderOff  )  [virtual]
 

Enable/disable drawing a "line" from the caption to the attachment point.

virtual void vtkCaptionActor2D::SetThreeDimensionalLeader int   )  [virtual]
 

Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).

virtual int vtkCaptionActor2D::GetThreeDimensionalLeader  )  [virtual]
 

Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).

virtual void vtkCaptionActor2D::ThreeDimensionalLeaderOn  )  [virtual]
 

Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).

virtual void vtkCaptionActor2D::ThreeDimensionalLeaderOff  )  [virtual]
 

Indicate whether the leader is 2D (no hidden line) or 3D (z-buffered).

virtual void vtkCaptionActor2D::SetLeaderGlyph vtkPolyData  )  [virtual]
 

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.

virtual vtkPolyData* vtkCaptionActor2D::GetLeaderGlyph  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetLeaderGlyphSize double   )  [virtual]
 

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.

virtual double vtkCaptionActor2D::GetLeaderGlyphSize  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetMaximumLeaderGlyphSize int   )  [virtual]
 

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.

virtual int vtkCaptionActor2D::GetMaximumLeaderGlyphSize  )  [virtual]
 

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.

virtual void vtkCaptionActor2D::SetPadding int   )  [virtual]
 

Set/Get the padding between the caption and the border. The value is specified in pixels.

virtual int vtkCaptionActor2D::GetPadding  )  [virtual]
 

Set/Get the padding between the caption and the border. The value is specified in pixels.

virtual vtkTextActor* vtkCaptionActor2D::GetTextActor  )  [virtual]
 

Get the text actor used by the caption. This is useful if you want to control justification and other characteristics of the text actor.

virtual void vtkCaptionActor2D::SetCaptionTextProperty vtkTextProperty p  )  [virtual]
 

Set/Get the text property.

virtual vtkTextProperty* vtkCaptionActor2D::GetCaptionTextProperty  )  [virtual]
 

Set/Get the text property.

void vtkCaptionActor2D::ShallowCopy vtkProp prop  )  [virtual]
 

Shallow copy of this scaled text actor. Overloads the virtual vtkProp method.

Reimplemented from vtkActor2D.

virtual void vtkCaptionActor2D::ReleaseGraphicsResources vtkWindow  )  [virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. 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.

int vtkCaptionActor2D::RenderOpaqueGeometry vtkViewport viewport  )  [virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. Draw the legend box to the screen.

Reimplemented from vtkActor2D.

int vtkCaptionActor2D::RenderTranslucentGeometry vtkViewport  )  [inline, virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. 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.

Definition at line 180 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::RenderOverlay vtkViewport viewport  )  [virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. 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.


Member Data Documentation

vtkCoordinate* vtkCaptionActor2D::AttachmentPointCoordinate [protected]
 

Definition at line 189 of file vtkCaptionActor2D.h.

char* vtkCaptionActor2D::Caption [protected]
 

Definition at line 191 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::Border [protected]
 

Definition at line 192 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::Leader [protected]
 

Definition at line 193 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::ThreeDimensionalLeader [protected]
 

Definition at line 194 of file vtkCaptionActor2D.h.

double vtkCaptionActor2D::LeaderGlyphSize [protected]
 

Definition at line 195 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::MaximumLeaderGlyphSize [protected]
 

Definition at line 196 of file vtkCaptionActor2D.h.

vtkPolyData* vtkCaptionActor2D::LeaderGlyph [protected]
 

Definition at line 198 of file vtkCaptionActor2D.h.

int vtkCaptionActor2D::Padding [protected]
 

Definition at line 200 of file vtkCaptionActor2D.h.


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 23:36:36 2008 for VTK by  doxygen 1.4.3-20050530