vtkCaptionActor2D Class Reference
#include <vtkCaptionActor2D.h>
Inheritance diagram for vtkCaptionActor2D:
[legend]Collaboration diagram for vtkCaptionActor2D:
[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
- Created by:
-
- CVS contributions (if > 5%):
- Schroeder, Will (60%)
- Barre, Sebastien (22%)
- Martin, Ken (10%)
- CVS logs (CVSweb):
.h (/Hybrid/vtkCaptionActor2D
.h)
.cxx (/Hybrid/vtkCaptionActor2D
.cxx)
- Tests:
- vtkCaptionActor2D (Tests)
Definition at line 85 of file vtkCaptionActor2D.h.
Member Typedef Documentation
Constructor & Destructor Documentation
vtkCaptionActor2D::vtkCaptionActor2D |
( |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* vtkCaptionActor2D::GetClassName |
( |
|
) |
[virtual] |
|
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. |
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. |
|
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at layer 0.
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. |
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. |
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 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. Draw the legend box to the screen.
Reimplemented from vtkActor2D.
Definition at line 185 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. Draw the legend box to the screen.
Reimplemented from vtkActor2D. |
Member Data Documentation
The documentation for this class was generated from the following file: