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 "vtkRenderingCoreModule.h" // For export macro
44 #include "vtkTexturedActor2D.h"
45 
46 class vtkTextProperty;
48 class vtkImageData;
49 class vtkTextRenderer;
50 class vtkTransform;
51 class vtkPolyData;
52 class vtkPoints;
53 
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
62  static vtkTextActor *New();
63 
66  void ShallowCopy(vtkProp *prop);
67 
69 
72  void SetInput(const char *inputString);
73  char *GetInput();
75 
77 
79  vtkSetVector2Macro(MinimumSize,int);
80  vtkGetVector2Macro(MinimumSize,int);
82 
84 
87  vtkSetMacro(MaximumLineHeight,float);
88  vtkGetMacro(MaximumLineHeight,float);
90 
92 
99  vtkSetClampMacro(TextScaleMode, int,
100  TEXT_SCALE_MODE_NONE, TEXT_SCALE_MODE_VIEWPORT);
101  vtkGetMacro(TextScaleMode, int);
103  { this->SetTextScaleMode(TEXT_SCALE_MODE_NONE); }
105  { this->SetTextScaleMode(TEXT_SCALE_MODE_PROP); }
107  { this->SetTextScaleMode(TEXT_SCALE_MODE_VIEWPORT); }
109 
110 //BTX
111  enum {
112  TEXT_SCALE_MODE_NONE = 0,
114  TEXT_SCALE_MODE_VIEWPORT
115  };
116 //ETX
117 
119 
122  vtkSetMacro(UseBorderAlign,int);
123  vtkGetMacro(UseBorderAlign,int);
124  vtkBooleanMacro(UseBorderAlign,int);
126 
128 
136  void SetAlignmentPoint(int point);
137  int GetAlignmentPoint();
139 
141 
145  void SetOrientation(float orientation);
146  vtkGetMacro(Orientation,float);
148 
150 
151  virtual void SetTextProperty(vtkTextProperty *p);
152  vtkGetObjectMacro(TextProperty,vtkTextProperty);
154 
158  virtual void GetBoundingBox(vtkViewport* vport, double bbox[4]);
159 
162  virtual void GetSize(vtkViewport* vport, double size[2]);
163 
165 
169  virtual int SetConstrainedFontSize(
170  vtkViewport*, int targetWidth, int targetHeight);
171  static int SetConstrainedFontSize(
172  vtkTextActor*, vtkViewport*, int targetWidth, int targetHeight);
174 
176 
180  static int SetMultipleConstrainedFontSize(
181  vtkViewport*, int targetWidth, int targetHeight,
182  vtkTextActor** actors, int nbOfActors, int* maxResultingSize);
184 
192  virtual void SetNonLinearFontScale(double exponent, int target);
193 
196  void SpecifiedToDisplay(double *pos, vtkViewport *vport, int specified);
197 
200  void DisplayToSpecified(double *pos, vtkViewport *vport, int specified);
201 
204  virtual void ComputeScaledFont(vtkViewport *viewport);
205 
207 
209  vtkGetObjectMacro(ScaledTextProperty, vtkTextProperty);
211 
218  static float GetFontScale(vtkViewport *viewport);
219 
220 //BTX
225  virtual void ReleaseGraphicsResources(vtkWindow *);
226 
228 
231  virtual int RenderOpaqueGeometry(vtkViewport* viewport);
233  virtual int RenderOverlay(vtkViewport* viewport);
235 
237 
238  virtual int HasTranslucentPolygonalGeometry();
239 //ETX
241 
242 protected:
244  virtual bool RenderImage(vtkTextProperty *tprop, vtkViewport *viewport);
245 
247 
248  virtual bool GetImageBoundingBox(
249  vtkTextProperty *tprop, vtkViewport *viewport, int bbox[4]);
251 
252  vtkTextActor();
253  ~vtkTextActor();
254 
255  int MinimumSize[2];
259  float Orientation;
261 
267  int LastSize[2];
268  int LastOrigin[2];
269  char *Input;
273 
275 
276  // Stuff needed to display the image text as a texture map.
279 
280  virtual void ComputeRectangle(vtkViewport *viewport);
281 
289  virtual int UpdateRectangle(vtkViewport* viewport);
290 
291 private:
292  vtkTextActor(const vtkTextActor&); // Not implemented.
293  void operator=(const vtkTextActor&); // Not implemented.
294 };
295 
296 
297 #endif
bool InputRendered
Definition: vtkTextActor.h:270
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
actor that draws 2D data with texture support
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkPolyData * Rectangle
Definition: vtkTextActor.h:277
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkTextActor.h:232
void SetTextScaleModeToViewport()
Definition: vtkTextActor.h:106
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual void ShallowCopy(vtkProp *prop)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkPoints * RectanglePoints
Definition: vtkTextActor.h:278
vtkTextProperty * ScaledTextProperty
Definition: vtkTextActor.h:274
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkImageData * ImageData
Definition: vtkTextActor.h:263
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
double FontScaleExponent
Definition: vtkTextActor.h:257
vtkTimeStamp BuildTime
Definition: vtkTextActor.h:265
vtkTransform * Transform
Definition: vtkTextActor.h:266
virtual int HasTranslucentPolygonalGeometry()
virtual void ReleaseGraphicsResources(vtkWindow *win)
a simple class to control print indentation
Definition: vtkIndent.h:38
void SetTextScaleModeToProp()
Definition: vtkTextActor.h:104
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
float Orientation
Definition: vtkTextActor.h:259
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextRenderer * TextRenderer
Definition: vtkTextActor.h:264
represent text properties.
void SetTextScaleModeToNone()
Definition: vtkTextActor.h:102
float MaximumLineHeight
Definition: vtkTextActor.h:256
Interface for generating images and path data from string data, using multiple backends.
vtkTextProperty * TextProperty
Definition: vtkTextActor.h:262
#define VTKRENDERINGCORE_EXPORT
virtual int RenderOverlay(vtkViewport *viewport)
static vtkTexturedActor2D * New()
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38
double FormerOrientation
Definition: vtkTextActor.h:271