VTK
vtkTextActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextActor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
40 #ifndef __vtkTextActor_h
41 #define __vtkTextActor_h
42 
43 #include "vtkActor2D.h"
44 
45 class vtkTextProperty;
47 class vtkImageData;
49 class vtkTransform;
50 class vtkPolyData;
51 class vtkPoints;
52 class vtkTexture;
53 
55 {
56 public:
57  vtkTypeMacro(vtkTextActor,vtkActor2D);
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
62  static vtkTextActor *New();
63 
66  void ShallowCopy(vtkProp *prop);
67 
70  void SetMapper(vtkPolyDataMapper2D *mapper);
71 
73 
76  void SetInput(const char *inputString);
77  char *GetInput();
79 
81 
83  vtkSetVector2Macro(MinimumSize,int);
84  vtkGetVector2Macro(MinimumSize,int);
86 
88 
91  vtkSetMacro(MaximumLineHeight,float);
92  vtkGetMacro(MaximumLineHeight,float);
94 
96 
103  vtkSetClampMacro(TextScaleMode, int,
104  TEXT_SCALE_MODE_NONE, TEXT_SCALE_MODE_VIEWPORT);
105  vtkGetMacro(TextScaleMode, int);
107  { this->SetTextScaleMode(TEXT_SCALE_MODE_NONE); }
109  { this->SetTextScaleMode(TEXT_SCALE_MODE_PROP); }
111  { this->SetTextScaleMode(TEXT_SCALE_MODE_VIEWPORT); }
113 
114 //BTX
115  enum {
116  TEXT_SCALE_MODE_NONE = 0,
118  TEXT_SCALE_MODE_VIEWPORT
119  };
120 //ETX
121 
123 
125  VTK_LEGACY(void SetScaledText(int));
126  VTK_LEGACY(int GetScaledText());
127  VTK_LEGACY(void ScaledTextOn());
128  VTK_LEGACY(void ScaledTextOff());
130 
132 
135  vtkSetMacro(UseBorderAlign,int);
136  vtkGetMacro(UseBorderAlign,int);
137  vtkBooleanMacro(UseBorderAlign,int);
139 
141 
149  void SetAlignmentPoint(int point);
150  int GetAlignmentPoint();
152 
154 
158  void SetOrientation(float orientation);
159  vtkGetMacro(Orientation,float);
161 
163 
164  virtual void SetTextProperty(vtkTextProperty *p);
165  vtkGetObjectMacro(TextProperty,vtkTextProperty);
167 
175  virtual void SetNonLinearFontScale(double exponent, int target);
176 
179  void SpecifiedToDisplay(double *pos, vtkViewport *vport, int specified);
180 
183  void DisplayToSpecified(double *pos, vtkViewport *vport, int specified);
184 
187  virtual void ComputeScaledFont(vtkViewport *viewport);
188 
190 
192  vtkGetObjectMacro(ScaledTextProperty, vtkTextProperty);
194 
201  static float GetFontScale(vtkViewport *viewport);
202 
203 //BTX
208  virtual void ReleaseGraphicsResources(vtkWindow *);
209 
211 
214  virtual int RenderOpaqueGeometry(vtkViewport* viewport);
216  virtual int RenderOverlay(vtkViewport* viewport);
218 
220 
221  virtual int HasTranslucentPolygonalGeometry();
222 //ETX
224 
225 protected:
228  void SetMapper(vtkMapper2D *mapper);
229 
230  vtkTextActor();
231  ~vtkTextActor();
232 
233  int MinimumSize[2];
237  float Orientation;
239 
242  // This used to be "Mapper" but I changed it to PDMapper because
243  // Mapper is an ivar in Actor2D (bad form).
248  int LastSize[2];
249  int LastOrigin[2];
250  char *Input;
253 
255 
256  // Stuff needed to display the image text as a texture map.
260 
261  virtual void ComputeRectangle(vtkViewport *viewport);
262 
263  // Set/Get the texture object to control rendering texture maps. This will
264  // be a vtkTexture object. An actor does not need to have an associated
265  // texture map and multiple actors can share one texture.
266  // This was added for orienated text which is rendered with a
267  // vtkPolyDataMaper2D and a texture.
268  virtual void SetTexture(vtkTexture*);
269  vtkGetObjectMacro(Texture,vtkTexture);
270 
271 private:
272  vtkTextActor(const vtkTextActor&); // Not implemented.
273  void operator=(const vtkTextActor&); // Not implemented.
274 };
275 
276 
277 #endif
278 
bool InputRendered
Definition: vtkTextActor.h:251
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkPolyData * Rectangle
Definition: vtkTextActor.h:257
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkTextActor.h:215
void SetTextScaleModeToViewport()
Definition: vtkTextActor.h:110
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:45
virtual void SetMapper(vtkMapper2D *mapper)
a actor that draws 2D data
Definition: vtkActor2D.h:43
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkPoints * RectanglePoints
Definition: vtkTextActor.h:258
vtkTextProperty * ScaledTextProperty
Definition: vtkTextActor.h:254
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
vtkImageData * ImageData
Definition: vtkTextActor.h:241
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
double FontScaleExponent
Definition: vtkTextActor.h:235
vtkTimeStamp BuildTime
Definition: vtkTextActor.h:246
vtkTransform * Transform
Definition: vtkTextActor.h:247
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
a simple class to control print indentation
Definition: vtkIndent.h:37
void SetTextScaleModeToProp()
Definition: vtkTextActor.h:108
void PrintSelf(ostream &os, vtkIndent indent)
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
static vtkActor2D * New()
handles properties associated with a texture map
Definition: vtkTexture.h:68
float Orientation
Definition: vtkTextActor.h:237
vtkFreeTypeUtilities * FreeTypeUtilities
Definition: vtkTextActor.h:245
represent text properties.
void SetTextScaleModeToNone()
Definition: vtkTextActor.h:106
#define VTK_RENDERING_EXPORT
float MaximumLineHeight
Definition: vtkTextActor.h:234
FreeType library support.
virtual void ShallowCopy(vtkProp *prop)
vtkTextProperty * TextProperty
Definition: vtkTextActor.h:240
virtual int RenderOverlay(vtkViewport *viewport)
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:33
vtkPolyDataMapper2D * PDMapper
Definition: vtkTextActor.h:244
draw vtkPolyData onto the image plane
vtkTexture * Texture
Definition: vtkTextActor.h:259
represent and manipulate 3D points
Definition: vtkPoints.h:38
double FormerOrientation
Definition: vtkTextActor.h:252