VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkTextActor Class Reference

An actor that displays text. Scaled or unscaled. More...

#include <vtkTextActor.h>

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

Public Types

enum  { TEXT_SCALE_MODE_NONE = 0, TEXT_SCALE_MODE_PROP, TEXT_SCALE_MODE_VIEWPORT }
 
typedef vtkTexturedActor2D Superclass
 
- Public Types inherited from vtkTexturedActor2D
typedef vtkActor2D Superclass
 
- Public Types inherited from vtkActor2D
typedef vtkProp Superclass
 
- Public Types inherited from vtkProp
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkTextActorNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void ShallowCopy (vtkProp *prop) override
 Shallow copy of this text actor. More...
 
void SetInput (const char *inputString)
 Set the text string to be displayed. More...
 
char * GetInput ()
 
virtual void SetMinimumSize (int, int)
 Set/Get the minimum size in pixels for this actor. More...
 
void SetMinimumSize (int[2])
 
virtual intGetMinimumSize ()
 
virtual void GetMinimumSize (int &, int &)
 
virtual void GetMinimumSize (int[2])
 
virtual void SetMaximumLineHeight (float)
 Set/Get the maximum height of a line of text as a percentage of the vertical area allocated to this scaled text actor. More...
 
virtual float GetMaximumLineHeight ()
 
virtual void SetTextScaleMode (int)
 Set how text should be scaled. More...
 
virtual int GetTextScaleMode ()
 
void SetTextScaleModeToNone ()
 
void SetTextScaleModeToProp ()
 
void SetTextScaleModeToViewport ()
 
virtual void SetUseBorderAlign (vtkTypeBool)
 Turn on or off the UseBorderAlign option. More...
 
virtual vtkTypeBool GetUseBorderAlign ()
 
virtual void UseBorderAlignOn ()
 
virtual void UseBorderAlignOff ()
 
void SetAlignmentPoint (int point)
 This method is being deprecated. More...
 
int GetAlignmentPoint ()
 
void SetOrientation (float orientation)
 Counterclockwise rotation around the Alignment point. More...
 
virtual float GetOrientation ()
 
virtual void SetTextProperty (vtkTextProperty *p)
 Set/Get the text property. More...
 
virtual vtkTextPropertyGetTextProperty ()
 
virtual void GetBoundingBox (vtkViewport *vport, double bbox[4])
 Return the bounding box coordinates of the text in pixels. More...
 
virtual void GetSize (vtkViewport *vport, double size[2])
 Syntactic sugar to get the size of text instead of the entire bounding box. More...
 
virtual int SetConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight)
 Set and return the font size required to make this mapper fit in a given target rectangle (width x height, in pixels). More...
 
virtual void SetNonLinearFontScale (double exponent, int target)
 Enable non-linear scaling of font sizes. More...
 
void SpecifiedToDisplay (double *pos, vtkViewport *vport, int specified)
 This is just a simple coordinate conversion method used in the render process. More...
 
void DisplayToSpecified (double *pos, vtkViewport *vport, int specified)
 This is just a simple coordinate conversion method used in the render process. More...
 
virtual void ComputeScaledFont (vtkViewport *viewport)
 Compute the scale the font should be given the viewport. More...
 
virtual vtkTextPropertyGetScaledTextProperty ()
 Get the scaled font. More...
 
void ReleaseGraphicsResources (vtkWindow *) override
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. More...
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. More...
 
int RenderTranslucentPolygonalGeometry (vtkViewport *) override
 
int RenderOverlay (vtkViewport *viewport) override
 Support the standard render methods. More...
 
vtkTypeBool HasTranslucentPolygonalGeometry () override
 Does this prop have some translucent polygonal geometry? More...
 
- Public Member Functions inherited from vtkTexturedActor2D
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
vtkTexturedActor2DNewInstance () const
 
virtual void SetTexture (vtkTexture *texture)
 Set/Get the texture object to control rendering texture maps. More...
 
virtual vtkTextureGetTexture ()
 
void ReleaseGraphicsResources (vtkWindow *win) override
 Release any graphics resources that are being consumed by this actor. More...
 
int RenderOverlay (vtkViewport *viewport) override
 Support the standard render methods. More...
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS All concrete subclasses must be able to render themselves. More...
 
int RenderTranslucentPolygonalGeometry (vtkViewport *viewport) override
 
vtkMTimeType GetMTime () override
 Return this object's modified time. More...
 
void ShallowCopy (vtkProp *prop) override
 Shallow copy of this vtkTexturedActor2D. More...
 
- Public Member Functions inherited from vtkActor2D
vtkActor2DNewInstance () const
 
virtual void SetMapper (vtkMapper2D *mapper)
 Set/Get the vtkMapper2D which defines the data to be drawn. More...
 
virtual vtkMapper2DGetMapper ()
 
virtual void SetLayerNumber (int)
 Set/Get the layer number in the overlay planes into which to render. More...
 
virtual int GetLayerNumber ()
 
vtkProperty2DGetProperty ()
 Returns this actor's vtkProperty2D. More...
 
virtual void SetProperty (vtkProperty2D *)
 Set this vtkProp's vtkProperty2D. More...
 
virtual vtkCoordinateGetPositionCoordinate ()
 Get the PositionCoordinate instance of vtkCoordinate. More...
 
virtual void SetPosition (float x[2])
 
virtual void SetPosition (float x, float y)
 
virtual floatGetPosition ()
 
void SetDisplayPosition (int, int)
 Set the Prop2D's position in display coordinates. More...
 
virtual vtkCoordinateGetPosition2Coordinate ()
 Access the Position2 instance variable. More...
 
virtual void SetPosition2 (float x[2])
 
virtual void SetPosition2 (float x, float y)
 
virtual floatGetPosition2 ()
 
void SetWidth (double w)
 Set/Get the height and width of the Actor2D. More...
 
double GetWidth ()
 
void SetHeight (double h)
 
double GetHeight ()
 
void GetActors2D (vtkPropCollection *pc) override
 For some exporters and other other operations we must be able to collect all the actors or volumes. More...
 
virtual vtkCoordinateGetActualPositionCoordinate (void)
 Return the actual vtkCoordinate reference that the mapper should use to position the actor. More...
 
virtual vtkCoordinateGetActualPosition2Coordinate (void)
 Return the actual vtkCoordinate reference that the mapper should use to position the actor. More...
 
- Public Member Functions inherited from vtkProp
vtkPropNewInstance () const
 
virtual void GetActors (vtkPropCollection *)
 For some exporters and other other operations we must be able to collect all the actors or volumes. More...
 
virtual void GetVolumes (vtkPropCollection *)
 
virtual void SetVisibility (vtkTypeBool)
 Set/Get visibility of this vtkProp. More...
 
virtual vtkTypeBool GetVisibility ()
 
virtual void VisibilityOn ()
 
virtual void VisibilityOff ()
 
virtual void SetPickable (vtkTypeBool)
 Set/Get the pickable instance variable. More...
 
virtual vtkTypeBool GetPickable ()
 
virtual void PickableOn ()
 
virtual void PickableOff ()
 
virtual void Pick ()
 Method fires PickEvent if the prop is picked. More...
 
virtual void SetDragable (vtkTypeBool)
 Set/Get the value of the dragable instance variable. More...
 
virtual vtkTypeBool GetDragable ()
 
virtual void DragableOn ()
 
virtual void DragableOff ()
 
virtual vtkMTimeType GetRedrawMTime ()
 Return the mtime of anything that would cause the rendered image to appear differently. More...
 
virtual void SetUseBounds (bool)
 In case the Visibility flag is true, tell if the bounds of this prop should be taken into account or ignored during the computation of other bounding boxes, like in vtkRenderer::ResetCamera(). More...
 
virtual bool GetUseBounds ()
 
virtual void UseBoundsOn ()
 
virtual void UseBoundsOff ()
 
virtual doubleGetBounds ()
 Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). More...
 
virtual void InitPathTraversal ()
 vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker). More...
 
virtual vtkAssemblyPathGetNextPath ()
 
virtual int GetNumberOfPaths ()
 
virtual void PokeMatrix (vtkMatrix4x4 *vtkNotUsed(matrix))
 These methods are used by subclasses to place a matrix (if any) in the prop prior to rendering. More...
 
virtual vtkMatrix4x4GetMatrix ()
 
virtual vtkInformationGetPropertyKeys ()
 Set/Get property keys. More...
 
virtual void SetPropertyKeys (vtkInformation *keys)
 
virtual bool HasKeys (vtkInformation *requiredKeys)
 Tells if the prop has all the required keys. More...
 
virtual int RenderVolumetricGeometry (vtkViewport *)
 
virtual bool RenderFilteredOpaqueGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 Render the opaque geometry only if the prop has all the requiredKeys. More...
 
virtual bool RenderFilteredTranslucentPolygonalGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 Render the translucent polygonal geometry only if the prop has all the requiredKeys. More...
 
virtual bool RenderFilteredVolumetricGeometry (vtkViewport *v, vtkInformation *requiredKeys)
 Render the volumetric geometry only if the prop has all the requiredKeys. More...
 
virtual bool RenderFilteredOverlay (vtkViewport *v, vtkInformation *requiredKeys)
 Render in the overlay of the viewport only if the prop has all the requiredKeys. More...
 
virtual vtkTypeBool HasOpaqueGeometry ()
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS Does this prop have some opaque geometry? This method is called during the rendering process to know if there is some opaque geometry. More...
 
virtual double GetEstimatedRenderTime (vtkViewport *)
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS The EstimatedRenderTime may be used to select between different props, for example in LODProp it is used to select the level-of-detail. More...
 
virtual double GetEstimatedRenderTime ()
 
virtual void SetEstimatedRenderTime (double t)
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS This method is used by, for example, the vtkLODProp3D in order to initialize the estimated render time at start-up to some user defined value. More...
 
virtual void RestoreEstimatedRenderTime ()
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDERING PROCESS When the EstimatedRenderTime is first set to 0.0 (in the SetAllocatedRenderTime method) the old value is saved. More...
 
virtual void AddEstimatedRenderTime (double t, vtkViewport *vtkNotUsed(vp))
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS This method is intended to allow the renderer to add to the EstimatedRenderTime in props that require information that the renderer has in order to do this. More...
 
virtual void SetAllocatedRenderTime (double t, vtkViewport *vtkNotUsed(v))
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS The renderer may use the allocated rendering time to determine how to render this actor. More...
 
virtual double GetAllocatedRenderTime ()
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. More...
 
void SetRenderTimeMultiplier (double t)
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS Get/Set the multiplier for the render time. More...
 
virtual double GetRenderTimeMultiplier ()
 
virtual void BuildPaths (vtkAssemblyPaths *paths, vtkAssemblyPath *path)
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS Used to construct assembly paths and perform part traversal. More...
 
virtual bool GetSupportsSelection ()
 WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS Used by vtkHardwareSelector to determine if the prop supports hardware selection. More...
 
virtual void ProcessSelectorPixelBuffers (vtkHardwareSelector *, std::vector< unsigned int > &)
 allows a prop to update a selections color buffers More...
 
virtual int GetNumberOfConsumers ()
 Get the number of consumers. More...
 
void AddConsumer (vtkObject *c)
 Add or remove or get or check a consumer,. More...
 
void RemoveConsumer (vtkObject *c)
 
vtkObjectGetConsumer (int i)
 
int IsConsumer (vtkObject *c)
 
virtual void SetShaderProperty (vtkShaderProperty *property)
 Set/Get the shader property. More...
 
virtual vtkShaderPropertyGetShaderProperty ()
 
virtual bool IsRenderingTranslucentPolygonalGeometry ()
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkTextActorSafeDownCast (vtkObjectBase *o)
 
static vtkTextActorNew ()
 Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8, 0.95). More...
 
static int SetConstrainedFontSize (vtkTextActor *, vtkViewport *, int targetWidth, int targetHeight)
 
static int SetMultipleConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight, vtkTextActor **actors, int nbOfActors, int *maxResultingSize)
 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). More...
 
static float GetFontScale (vtkViewport *viewport)
 Provide a font scaling based on a viewport. More...
 
- Static Public Member Functions inherited from vtkTexturedActor2D
static vtkTexturedActor2DNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkTexturedActor2DSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkActor2D
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkActor2DSafeDownCast (vtkObjectBase *o)
 
static vtkActor2DNew ()
 Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at layer 0. More...
 
- Static Public Member Functions inherited from vtkProp
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkPropSafeDownCast (vtkObjectBase *o)
 
static vtkInformationIntegerKeyGeneralTextureUnit ()
 Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine where you would push or pop items. More...
 
static vtkInformationDoubleVectorKeyGeneralTextureTransform ()
 Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state machine where you would push or pop items. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
virtual bool RenderImage (vtkTextProperty *tprop, vtkViewport *viewport)
 Render Input to Image using the supplied font property. More...
 
virtual bool GetImageBoundingBox (vtkTextProperty *tprop, vtkViewport *viewport, int bbox[4])
 Get the bounding box for Input using the supplied font property. More...
 
 vtkTextActor ()
 
 ~vtkTextActor () override
 
virtual void ComputeRectangle (vtkViewport *viewport)
 
virtual int UpdateRectangle (vtkViewport *viewport)
 Ensure that Rectangle and RectanglePoints are valid and up-to-date. More...
 
- Protected Member Functions inherited from vtkTexturedActor2D
 vtkTexturedActor2D ()
 
 ~vtkTexturedActor2D () override
 
- Protected Member Functions inherited from vtkActor2D
 vtkActor2D ()
 
 ~vtkActor2D () override
 
- Protected Member Functions inherited from vtkProp
 vtkProp ()
 
 ~vtkProp () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int MinimumSize [2]
 
float MaximumLineHeight
 
double FontScaleExponent
 
int TextScaleMode
 
float Orientation
 
vtkTypeBool UseBorderAlign
 
vtkTextPropertyTextProperty
 
vtkImageDataImageData
 
vtkTextRendererTextRenderer
 
vtkTimeStamp BuildTime
 
vtkTransformTransform
 
int LastSize [2]
 
int LastOrigin [2]
 
char * Input
 
bool InputRendered
 
double FormerOrientation
 
int RenderedDPI
 
vtkTextPropertyScaledTextProperty
 
vtkPolyDataRectangle
 
vtkPointsRectanglePoints
 
- Protected Attributes inherited from vtkTexturedActor2D
vtkTextureTexture
 
- Protected Attributes inherited from vtkActor2D
vtkMapper2DMapper
 
int LayerNumber
 
vtkProperty2DProperty
 
vtkCoordinatePositionCoordinate
 
vtkCoordinatePosition2Coordinate
 
- Protected Attributes inherited from vtkProp
vtkTypeBool Visibility
 
vtkTypeBool Pickable
 
vtkTypeBool Dragable
 
bool UseBounds
 
double AllocatedRenderTime
 
double EstimatedRenderTime
 
double SavedEstimatedRenderTime
 
double RenderTimeMultiplier
 
int NumberOfConsumers
 
vtkObject ** Consumers
 
vtkAssemblyPathsPaths
 
vtkInformationPropertyKeys
 
vtkShaderPropertyShaderProperty
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

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.

See also
vtkActor2D vtkPolyDataMapper vtkTextProperty vtkTextRenderer
Examples:
vtkTextActor (Examples)
Tests:
vtkTextActor (Tests)

Definition at line 56 of file vtkTextActor.h.

Member Typedef Documentation

◆ Superclass

Definition at line 59 of file vtkTextActor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TEXT_SCALE_MODE_NONE 
TEXT_SCALE_MODE_PROP 
TEXT_SCALE_MODE_VIEWPORT 

Definition at line 127 of file vtkTextActor.h.

Constructor & Destructor Documentation

◆ vtkTextActor()

vtkTextActor::vtkTextActor ( )
protected

◆ ~vtkTextActor()

vtkTextActor::~vtkTextActor ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkTextActor::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkTextActor::IsA ( const char *  name)
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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkTexturedActor2D.

Reimplemented in vtkScaledTextActor, and vtkOpenGLTextActor.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkTextActor::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkTexturedActor2D.

Reimplemented in vtkScaledTextActor, and vtkOpenGLTextActor.

◆ NewInstance()

vtkTextActor* vtkTextActor::NewInstance ( ) const

◆ PrintSelf()

void vtkTextActor::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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.

Reimplemented in vtkScaledTextActor, and vtkOpenGLTextActor.

◆ New()

static vtkTextActor* vtkTextActor::New ( )
static

Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8, 0.95).

◆ ShallowCopy()

void vtkTextActor::ShallowCopy ( vtkProp prop)
overridevirtual

Shallow copy of this text actor.

Overloads the virtual vtkProp method.

Reimplemented from vtkActor2D.

◆ SetInput()

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 UTF-8 encoding. Convenience method to the underlying mapper

◆ GetInput()

char* vtkTextActor::GetInput ( )

◆ SetMinimumSize() [1/2]

virtual void vtkTextActor::SetMinimumSize ( int  ,
int   
)
virtual

Set/Get the minimum size in pixels for this actor.

Defaults to 10,10. Only valid when TextScaleMode is PROP.

◆ SetMinimumSize() [2/2]

void vtkTextActor::SetMinimumSize ( int  [2])

◆ GetMinimumSize() [1/3]

virtual int* vtkTextActor::GetMinimumSize ( )
virtual

◆ GetMinimumSize() [2/3]

virtual void vtkTextActor::GetMinimumSize ( int ,
int  
)
virtual

◆ GetMinimumSize() [3/3]

virtual void vtkTextActor::GetMinimumSize ( int  [2])
virtual

◆ SetMaximumLineHeight()

virtual void vtkTextActor::SetMaximumLineHeight ( float  )
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.

◆ GetMaximumLineHeight()

virtual float vtkTextActor::GetMaximumLineHeight ( )
virtual

◆ SetTextScaleMode()

virtual void vtkTextActor::SetTextScaleMode ( int  )
virtual

Set how text should be scaled.

If set to vtkTextActor::TEXT_SCALE_MODE_NONE, 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.

◆ GetTextScaleMode()

virtual int vtkTextActor::GetTextScaleMode ( )
virtual

◆ SetTextScaleModeToNone()

void vtkTextActor::SetTextScaleModeToNone ( )
inline

Definition at line 119 of file vtkTextActor.h.

◆ SetTextScaleModeToProp()

void vtkTextActor::SetTextScaleModeToProp ( )
inline

Definition at line 121 of file vtkTextActor.h.

◆ SetTextScaleModeToViewport()

void vtkTextActor::SetTextScaleModeToViewport ( )
inline

Definition at line 123 of file vtkTextActor.h.

◆ SetUseBorderAlign()

virtual void vtkTextActor::SetUseBorderAlign ( vtkTypeBool  )
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

◆ GetUseBorderAlign()

virtual vtkTypeBool vtkTextActor::GetUseBorderAlign ( )
virtual

◆ UseBorderAlignOn()

virtual void vtkTextActor::UseBorderAlignOn ( )
virtual

◆ UseBorderAlignOff()

virtual void vtkTextActor::UseBorderAlignOff ( )
virtual

◆ SetAlignmentPoint()

void vtkTextActor::SetAlignmentPoint ( int  point)

This method is being deprecated.

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.

◆ GetAlignmentPoint()

int vtkTextActor::GetAlignmentPoint ( )

◆ SetOrientation()

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.

◆ GetOrientation()

virtual float vtkTextActor::GetOrientation ( )
virtual

◆ SetTextProperty()

virtual void vtkTextActor::SetTextProperty ( vtkTextProperty p)
virtual

Set/Get the text property.

◆ GetTextProperty()

virtual vtkTextProperty* vtkTextActor::GetTextProperty ( )
virtual

◆ GetBoundingBox()

virtual void vtkTextActor::GetBoundingBox ( vtkViewport vport,
double  bbox[4] 
)
virtual

Return the bounding box coordinates of the text in pixels.

The bbox array is populated with [ xmin, xmax, ymin, ymax ] values in that order.

◆ GetSize()

virtual void vtkTextActor::GetSize ( vtkViewport vport,
double  size[2] 
)
virtual

Syntactic sugar to get the size of text instead of the entire bounding box.

◆ SetConstrainedFontSize() [1/2]

virtual int vtkTextActor::SetConstrainedFontSize ( vtkViewport ,
int  targetWidth,
int  targetHeight 
)
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).

◆ SetConstrainedFontSize() [2/2]

static int vtkTextActor::SetConstrainedFontSize ( vtkTextActor ,
vtkViewport ,
int  targetWidth,
int  targetHeight 
)
static

◆ SetMultipleConstrainedFontSize()

static int vtkTextActor::SetMultipleConstrainedFontSize ( vtkViewport ,
int  targetWidth,
int  targetHeight,
vtkTextActor **  actors,
int  nbOfActors,
int maxResultingSize 
)
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.

◆ SetNonLinearFontScale()

virtual void vtkTextActor::SetNonLinearFontScale ( double  exponent,
int  target 
)
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

◆ SpecifiedToDisplay()

void vtkTextActor::SpecifiedToDisplay ( double pos,
vtkViewport vport,
int  specified 
)

This is just a simple coordinate conversion method used in the render process.

◆ DisplayToSpecified()

void vtkTextActor::DisplayToSpecified ( double pos,
vtkViewport vport,
int  specified 
)

This is just a simple coordinate conversion method used in the render process.

◆ ComputeScaledFont()

virtual void vtkTextActor::ComputeScaledFont ( vtkViewport viewport)
virtual

Compute the scale the font should be given the viewport.

The result is placed in the ScaledTextProperty ivar.

◆ GetScaledTextProperty()

virtual vtkTextProperty* vtkTextActor::GetScaledTextProperty ( )
virtual

Get the scaled font.

Use ComputeScaledFont to set the scale for a given viewport.

◆ GetFontScale()

static float vtkTextActor::GetFontScale ( vtkViewport 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.

◆ ReleaseGraphicsResources()

void vtkTextActor::ReleaseGraphicsResources ( vtkWindow )
overridevirtual

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.

◆ RenderOpaqueGeometry()

int vtkTextActor::RenderOpaqueGeometry ( vtkViewport viewport)
overridevirtual

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.

Reimplemented from vtkActor2D.

◆ RenderTranslucentPolygonalGeometry()

int vtkTextActor::RenderTranslucentPolygonalGeometry ( vtkViewport )
inlineoverridevirtual

Reimplemented from vtkActor2D.

Definition at line 280 of file vtkTextActor.h.

◆ RenderOverlay()

int vtkTextActor::RenderOverlay ( vtkViewport viewport)
overridevirtual

Support the standard render methods.

Reimplemented from vtkActor2D.

Reimplemented in vtkOpenGLTextActor.

◆ HasTranslucentPolygonalGeometry()

vtkTypeBool vtkTextActor::HasTranslucentPolygonalGeometry ( )
overridevirtual

Does this prop have some translucent polygonal geometry?

Reimplemented from vtkActor2D.

◆ RenderImage()

virtual bool vtkTextActor::RenderImage ( vtkTextProperty tprop,
vtkViewport viewport 
)
protectedvirtual

Render Input to Image using the supplied font property.

◆ GetImageBoundingBox()

virtual bool vtkTextActor::GetImageBoundingBox ( vtkTextProperty tprop,
vtkViewport viewport,
int  bbox[4] 
)
protectedvirtual

Get the bounding box for Input using the supplied font property.

◆ ComputeRectangle()

virtual void vtkTextActor::ComputeRectangle ( vtkViewport viewport)
protectedvirtual

◆ UpdateRectangle()

virtual int vtkTextActor::UpdateRectangle ( vtkViewport viewport)
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.

Member Data Documentation

◆ MinimumSize

int vtkTextActor::MinimumSize[2]
protected

Definition at line 304 of file vtkTextActor.h.

◆ MaximumLineHeight

float vtkTextActor::MaximumLineHeight
protected

Definition at line 305 of file vtkTextActor.h.

◆ FontScaleExponent

double vtkTextActor::FontScaleExponent
protected

Definition at line 306 of file vtkTextActor.h.

◆ TextScaleMode

int vtkTextActor::TextScaleMode
protected

Definition at line 307 of file vtkTextActor.h.

◆ Orientation

float vtkTextActor::Orientation
protected

Definition at line 308 of file vtkTextActor.h.

◆ UseBorderAlign

vtkTypeBool vtkTextActor::UseBorderAlign
protected

Definition at line 309 of file vtkTextActor.h.

◆ TextProperty

vtkTextProperty* vtkTextActor::TextProperty
protected

Definition at line 311 of file vtkTextActor.h.

◆ ImageData

vtkImageData* vtkTextActor::ImageData
protected

Definition at line 312 of file vtkTextActor.h.

◆ TextRenderer

vtkTextRenderer* vtkTextActor::TextRenderer
protected

Definition at line 313 of file vtkTextActor.h.

◆ BuildTime

vtkTimeStamp vtkTextActor::BuildTime
protected

Definition at line 314 of file vtkTextActor.h.

◆ Transform

vtkTransform* vtkTextActor::Transform
protected

Definition at line 315 of file vtkTextActor.h.

◆ LastSize

int vtkTextActor::LastSize[2]
protected

Definition at line 316 of file vtkTextActor.h.

◆ LastOrigin

int vtkTextActor::LastOrigin[2]
protected

Definition at line 317 of file vtkTextActor.h.

◆ Input

char* vtkTextActor::Input
protected

Definition at line 318 of file vtkTextActor.h.

◆ InputRendered

bool vtkTextActor::InputRendered
protected

Definition at line 319 of file vtkTextActor.h.

◆ FormerOrientation

double vtkTextActor::FormerOrientation
protected

Definition at line 320 of file vtkTextActor.h.

◆ RenderedDPI

int vtkTextActor::RenderedDPI
protected

Definition at line 321 of file vtkTextActor.h.

◆ ScaledTextProperty

vtkTextProperty* vtkTextActor::ScaledTextProperty
protected

Definition at line 323 of file vtkTextActor.h.

◆ Rectangle

vtkPolyData* vtkTextActor::Rectangle
protected

Definition at line 326 of file vtkTextActor.h.

◆ RectanglePoints

vtkPoints* vtkTextActor::RectanglePoints
protected

Definition at line 327 of file vtkTextActor.h.


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