An actor that displays text. Scaled or unscaled. More...
#include <vtkTextActor.h>
Public Types | |
enum | { TEXT_SCALE_MODE_NONE = 0, TEXT_SCALE_MODE_PROP, TEXT_SCALE_MODE_VIEWPORT } |
typedef vtkActor2D | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkTextActor * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | ShallowCopy (vtkProp *prop) |
void | SetMapper (vtkPolyDataMapper2D *mapper) |
virtual void | GetBoundingBox (vtkViewport *vport, double bbox[4]) |
virtual void | GetSize (vtkViewport *vport, double size[2]) |
virtual void | SetNonLinearFontScale (double exponent, int target) |
void | SpecifiedToDisplay (double *pos, vtkViewport *vport, int specified) |
void | DisplayToSpecified (double *pos, vtkViewport *vport, int specified) |
virtual void | ComputeScaledFont (vtkViewport *viewport) |
virtual void | ReleaseGraphicsResources (vtkWindow *) |
void | SetInput (const char *inputString) |
char * | GetInput () |
virtual void | SetMinimumSize (int, int) |
void | SetMinimumSize (int[2]) |
virtual int * | GetMinimumSize () |
virtual void | GetMinimumSize (int &, int &) |
virtual void | GetMinimumSize (int[2]) |
virtual void | SetMaximumLineHeight (float) |
virtual float | GetMaximumLineHeight () |
virtual void | SetTextScaleMode (int) |
virtual int | GetTextScaleMode () |
void | SetTextScaleModeToNone () |
void | SetTextScaleModeToProp () |
void | SetTextScaleModeToViewport () |
virtual void | SetUseBorderAlign (int) |
virtual int | GetUseBorderAlign () |
virtual void | UseBorderAlignOn () |
virtual void | UseBorderAlignOff () |
void | SetAlignmentPoint (int point) |
int | GetAlignmentPoint () |
void | SetOrientation (float orientation) |
virtual float | GetOrientation () |
virtual void | SetTextProperty (vtkTextProperty *p) |
virtual vtkTextProperty * | GetTextProperty () |
virtual vtkTextProperty * | GetScaledTextProperty () |
virtual int | RenderOpaqueGeometry (vtkViewport *viewport) |
virtual int | RenderTranslucentPolygonalGeometry (vtkViewport *) |
virtual int | RenderOverlay (vtkViewport *viewport) |
virtual int | HasTranslucentPolygonalGeometry () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkTextActor * | SafeDownCast (vtkObjectBase *o) |
static vtkTextActor * | New () |
static float | GetFontScale (vtkViewport *viewport) |
static int | SetMultipleConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight, vtkTextActor **actors, int nbOfActors, int *maxResultingSize) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
void | SetMapper (vtkMapper2D *mapper) |
virtual bool | RenderImage (vtkTextProperty *tprop, vtkViewport *viewport) |
vtkTextActor () | |
~vtkTextActor () | |
virtual void | ComputeRectangle (vtkViewport *viewport) |
virtual int | UpdateRectangle (vtkViewport *viewport) |
virtual void | SetTexture (vtkTexture *) |
virtual vtkTexture * | GetTexture () |
virtual bool | GetImageBoundingBox (vtkTextProperty *tprop, vtkViewport *viewport, int bbox[4]) |
Protected Attributes | |
int | MinimumSize [2] |
float | MaximumLineHeight |
double | FontScaleExponent |
int | TextScaleMode |
float | Orientation |
int | UseBorderAlign |
vtkTextProperty * | TextProperty |
vtkImageData * | ImageData |
vtkPolyDataMapper2D * | PDMapper |
vtkTextRenderer * | TextRenderer |
vtkTimeStamp | BuildTime |
vtkTransform * | Transform |
int | LastSize [2] |
int | LastOrigin [2] |
char * | Input |
bool | InputRendered |
double | FormerOrientation |
vtkTextProperty * | ScaledTextProperty |
vtkPolyData * | Rectangle |
vtkPoints * | RectanglePoints |
vtkTexture * | Texture |
static int | SetConstrainedFontSize (vtkTextActor *, vtkViewport *, int targetWidth, int targetHeight) |
virtual int | SetConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight) |
An actor that displays text. Scaled or unscaled.
vtkTextActor can be used to place text annotation into a window. When TextScaleMode is NONE, the text is fixed font and operation is the same as a vtkPolyDataMapper2D/vtkActor2D pair. When TextScaleMode is VIEWPORT, the font resizes such that it maintains a consistent size relative to the viewport in which it is rendered. When TextScaleMode is PROP, the font resizes such that the text fits inside the box defined by the position 1 & 2 coordinates. This class replaces the deprecated vtkScaledTextActor and acts as a convenient wrapper for a vtkTextMapper/vtkActor2D pair. Set the text property/attributes through the vtkTextProperty associated to this actor.
Definition at line 55 of file vtkTextActor.h.
typedef vtkActor2D vtkTextActor::Superclass |
Definition at line 58 of file vtkTextActor.h.
anonymous enum |
Enumerator | |
---|---|
TEXT_SCALE_MODE_NONE | |
TEXT_SCALE_MODE_PROP | |
TEXT_SCALE_MODE_VIEWPORT |
Definition at line 116 of file vtkTextActor.h.
|
protected |
|
protected |
|
static |
|
virtual |
Reimplemented in vtkScaledTextActor.
|
static |
|
protectedvirtual |
Reimplemented in vtkScaledTextActor.
vtkTextActor* vtkTextActor::NewInstance | ( | ) | const |
void vtkTextActor::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
static |
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8, 0.95).
void vtkTextActor::ShallowCopy | ( | vtkProp * | prop | ) |
Shallow copy of this text actor. Overloads the virtual vtkProp method.
void vtkTextActor::SetMapper | ( | vtkPolyDataMapper2D * | mapper | ) |
Override the vtkPolyDataMapper2D that defines the text to be drawn. One will be created by default if none is supplied
void vtkTextActor::SetInput | ( | const char * | inputString | ) |
Set the text string to be displayed. "\n" is recognized as a carriage return/linefeed (line separator). The characters must be in the ISO-8859-1 encoding. Convenience method to the underlying mapper
char* vtkTextActor::GetInput | ( | ) |
Set the text string to be displayed. "\n" is recognized as a carriage return/linefeed (line separator). The characters must be in the ISO-8859-1 encoding. Convenience method to the underlying mapper
|
virtual |
Set/Get the minimum size in pixels for this actor. Defaults to 10,10. Only valid when TextScaleMode is PROP.
void vtkTextActor::SetMinimumSize | ( | int | [2] | ) |
Set/Get the minimum size in pixels for this actor. Defaults to 10,10. Only valid when TextScaleMode is PROP.
|
virtual |
Set/Get the minimum size in pixels for this actor. Defaults to 10,10. Only valid when TextScaleMode is PROP.
|
virtual |
Set/Get the minimum size in pixels for this actor. Defaults to 10,10. Only valid when TextScaleMode is PROP.
|
virtual |
Set/Get the minimum size in pixels for this actor. Defaults to 10,10. Only valid when TextScaleMode is PROP.
|
virtual |
Set/Get the maximum height of a line of text as a percentage of the vertical area allocated to this scaled text actor. Defaults to 1.0. Only valid when TextScaleMode is PROP.
|
virtual |
Set/Get the maximum height of a line of text as a percentage of the vertical area allocated to this scaled text actor. Defaults to 1.0. Only valid when TextScaleMode is PROP.
|
virtual |
Set how text should be scaled. If set to vtkTextActor::TEXT_SCALE_MODE_NONE, the the font size will be fixed by the size given in TextProperty. If set to vtkTextActor::TEXT_SCALE_MODE_PROP, the text will be scaled to fit exactly in the prop as specified by the position 1 & 2 coordinates. If set to vtkTextActor::TEXT_SCALE_MODE_VIEWPORT, the text will be scaled based on the size of the viewport it is displayed in.
|
virtual |
Set how text should be scaled. If set to vtkTextActor::TEXT_SCALE_MODE_NONE, the the font size will be fixed by the size given in TextProperty. If set to vtkTextActor::TEXT_SCALE_MODE_PROP, the text will be scaled to fit exactly in the prop as specified by the position 1 & 2 coordinates. If set to vtkTextActor::TEXT_SCALE_MODE_VIEWPORT, the text will be scaled based on the size of the viewport it is displayed in.
|
inline |
Set how text should be scaled. If set to vtkTextActor::TEXT_SCALE_MODE_NONE, the the font size will be fixed by the size given in TextProperty. If set to vtkTextActor::TEXT_SCALE_MODE_PROP, the text will be scaled to fit exactly in the prop as specified by the position 1 & 2 coordinates. If set to vtkTextActor::TEXT_SCALE_MODE_VIEWPORT, the text will be scaled based on the size of the viewport it is displayed in.
Definition at line 107 of file vtkTextActor.h.
|
inline |
Set how text should be scaled. If set to vtkTextActor::TEXT_SCALE_MODE_NONE, the the font size will be fixed by the size given in TextProperty. If set to vtkTextActor::TEXT_SCALE_MODE_PROP, the text will be scaled to fit exactly in the prop as specified by the position 1 & 2 coordinates. If set to vtkTextActor::TEXT_SCALE_MODE_VIEWPORT, the text will be scaled based on the size of the viewport it is displayed in.
Definition at line 109 of file vtkTextActor.h.
|
inline |
Set how text should be scaled. If set to vtkTextActor::TEXT_SCALE_MODE_NONE, the the font size will be fixed by the size given in TextProperty. If set to vtkTextActor::TEXT_SCALE_MODE_PROP, the text will be scaled to fit exactly in the prop as specified by the position 1 & 2 coordinates. If set to vtkTextActor::TEXT_SCALE_MODE_VIEWPORT, the text will be scaled based on the size of the viewport it is displayed in.
Definition at line 111 of file vtkTextActor.h.
|
virtual |
Turn on or off the UseBorderAlign option. When UseBorderAlign is on, the bounding rectangle is used to align the text, which is the proper behavior when using vtkTextRepresentation
|
virtual |
Turn on or off the UseBorderAlign option. When UseBorderAlign is on, the bounding rectangle is used to align the text, which is the proper behavior when using vtkTextRepresentation
|
virtual |
Turn on or off the UseBorderAlign option. When UseBorderAlign is on, the bounding rectangle is used to align the text, which is the proper behavior when using vtkTextRepresentation
|
virtual |
Turn on or off the UseBorderAlign option. When UseBorderAlign is on, the bounding rectangle is used to align the text, which is the proper behavior when using vtkTextRepresentation
void vtkTextActor::SetAlignmentPoint | ( | int | point | ) |
This method is being depricated. Use SetJustification and SetVerticalJustification in text property instead. Set/Get the Alignment point if zero (default), the text aligns itself to the bottom left corner (which is defined by the PositionCoordinate) otherwise the text aligns itself to corner/midpoint or centre
6 7 8 3 4 5 0 1 2
This is the same as setting the TextProperty's justification. Currently TextActor is not oriented around its AlignmentPoint.
int vtkTextActor::GetAlignmentPoint | ( | ) |
This method is being depricated. Use SetJustification and SetVerticalJustification in text property instead. Set/Get the Alignment point if zero (default), the text aligns itself to the bottom left corner (which is defined by the PositionCoordinate) otherwise the text aligns itself to corner/midpoint or centre
6 7 8 3 4 5 0 1 2
This is the same as setting the TextProperty's justification. Currently TextActor is not oriented around its AlignmentPoint.
void vtkTextActor::SetOrientation | ( | float | orientation | ) |
Counterclockwise rotation around the Alignment point. Units are in degrees and defaults to 0. The orientation in the text property rotates the text in the texture map. It will proba ly not give you the effect you desire.
|
virtual |
Counterclockwise rotation around the Alignment point. Units are in degrees and defaults to 0. The orientation in the text property rotates the text in the texture map. It will proba ly not give you the effect you desire.
|
virtual |
Set/Get the text property.
|
virtual |
Set/Get the text property.
|
virtual |
Return the bounding box coordinates of the text in viewport coordinates. The bbox array is populated with [ xmin, xmax, ymin, ymax ] values in that order.
|
virtual |
Syntactic sugar to get the size of text instead of the entire bounding box.
|
virtual |
Set and return the font size required to make this mapper fit in a given target rectangle (width x height, in pixels). A static version of the method is also available for convenience to other classes (e.g., widgets).
|
static |
Set and return the font size required to make this mapper fit in a given target rectangle (width x height, in pixels). A static version of the method is also available for convenience to other classes (e.g., widgets).
|
static |
Set and return the font size required to make each element of an array of mappers fit in a given rectangle (width x height, in pixels). This font size is the smallest size that was required to fit the largest mapper in this constraint.
|
virtual |
Enable non-linear scaling of font sizes. This is useful in combination with scaled text. With small windows you want to use the entire scaled text area. With larger windows you want to reduce the font size some so that the entire area is not used. These values modify the computed font size as follows: newFontSize = pow(FontSize,exponent)*pow(target,1.0 - exponent) typically exponent should be around 0.7 and target should be around 10
void vtkTextActor::SpecifiedToDisplay | ( | double * | pos, |
vtkViewport * | vport, | ||
int | specified | ||
) |
This is just a simple coordinate conversion method used in the render process.
void vtkTextActor::DisplayToSpecified | ( | double * | pos, |
vtkViewport * | vport, | ||
int | specified | ||
) |
This is just a simple coordinate conversion method used in the render process.
|
virtual |
Compute the scale the font should be given the viewport. The result is placed in the ScaledTextProperty ivar.
|
virtual |
Get the scaled font. Use ComputeScaledFont to set the scale for a given viewport.
|
static |
Provide a font scaling based on a viewport. This is the scaling factor used when the TextScaleMode is set to VIEWPORT and has been made public for other components to use. This scaling assumes that the long dimension of the viewport is meant to be 6 inches (a typical width of text in a paper) and then resizes based on if that long dimension was 72 DPI.
|
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.
|
virtual |
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. Draw the text actor to the screen.
|
inlinevirtual |
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. Draw the text actor to the screen.
Definition at line 237 of file vtkTextActor.h.
|
virtual |
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. Draw the text actor to the screen.
|
virtual |
Does this prop have some translucent polygonal geometry?
|
protected |
Hide access methods that use superclass vtkMapper2D and not vtkImageMapper
|
protectedvirtual |
Render Input to Image using the supplied font property.
|
protectedvirtual |
Get the bounding box for Input using the supplied font property.
|
protectedvirtual |
|
protectedvirtual |
Ensure that Rectangle and RectanglePoints are valid and up-to-date. Unlike ComputeRectangle(), this may do nothing (if the rectangle is valid), or it may render the text to an image and recompute rectangle points by calling ComputeRectangle. Returns a non-zero value upon success or zero upon failure to render the image. This may be called with a NULL viewport when bounds are required before a rendering has occurred.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Definition at line 264 of file vtkTextActor.h.
|
protected |
Definition at line 265 of file vtkTextActor.h.
|
protected |
Definition at line 266 of file vtkTextActor.h.
|
protected |
Definition at line 267 of file vtkTextActor.h.
|
protected |
Definition at line 268 of file vtkTextActor.h.
|
protected |
Definition at line 269 of file vtkTextActor.h.
|
protected |
Definition at line 271 of file vtkTextActor.h.
|
protected |
Definition at line 272 of file vtkTextActor.h.
|
protected |
Definition at line 275 of file vtkTextActor.h.
|
protected |
Definition at line 276 of file vtkTextActor.h.
|
protected |
Definition at line 277 of file vtkTextActor.h.
|
protected |
Definition at line 278 of file vtkTextActor.h.
|
protected |
Definition at line 279 of file vtkTextActor.h.
|
protected |
Definition at line 280 of file vtkTextActor.h.
|
protected |
Definition at line 281 of file vtkTextActor.h.
|
protected |
Definition at line 282 of file vtkTextActor.h.
|
protected |
Definition at line 283 of file vtkTextActor.h.
|
protected |
Definition at line 285 of file vtkTextActor.h.
|
protected |
Definition at line 288 of file vtkTextActor.h.
|
protected |
Definition at line 289 of file vtkTextActor.h.
|
protected |
Definition at line 290 of file vtkTextActor.h.