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 
139 
141 
146  vtkGetMacro(Orientation,float);
148 
150 
154 
158  virtual void GetBoundingBox(vtkViewport* vport, double bbox[4]);
159 
162  virtual void GetSize(vtkViewport* vport, double size[2]);
163 
165 
170  vtkViewport*, int targetWidth, int targetHeight);
172  vtkTextActor*, vtkViewport*, int targetWidth, int targetHeight);
174 
176 
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
226 
228 
231  virtual int RenderOpaqueGeometry(vtkViewport* viewport);
233  virtual int RenderOverlay(vtkViewport* viewport);
235 
237 
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 
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkSetVector2Macro
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:254
vtkTextActor::SetTextScaleModeToNone
void SetTextScaleModeToNone()
Definition: vtkTextActor.h:102
vtkTextActor::SetConstrainedFontSize
virtual int SetConstrainedFontSize(vtkViewport *, int targetWidth, int targetHeight)
vtkTextActor::Orientation
float Orientation
Definition: vtkTextActor.h:259
vtkTextActor::SetTextScaleModeToProp
void SetTextScaleModeToProp()
Definition: vtkTextActor.h:104
vtkTextActor::SetOrientation
void SetOrientation(float orientation)
vtkTextActor::GetSize
virtual void GetSize(vtkViewport *vport, double size[2])
vtkGetVector2Macro
#define vtkGetVector2Macro(name, type)
Definition: vtkSetGet.h:270
vtkTexturedActor2D
actor that draws 2D data with texture support
Definition: vtkTexturedActor2D.h:41
vtkTextActor::FormerOrientation
double FormerOrientation
Definition: vtkTextActor.h:271
vtkTextActor::SetTextProperty
virtual void SetTextProperty(vtkTextProperty *p)
vtkTextActor::New
static vtkTextActor * New()
vtkTextActor::SetAlignmentPoint
void SetAlignmentPoint(int point)
vtkTextActor::RenderImage
virtual bool RenderImage(vtkTextProperty *tprop, vtkViewport *viewport)
vtkTextActor::InputRendered
bool InputRendered
Definition: vtkTextActor.h:270
vtkTextActor::ImageData
vtkImageData * ImageData
Definition: vtkTextActor.h:263
vtkTextActor::UpdateRectangle
virtual int UpdateRectangle(vtkViewport *viewport)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkTextActor::ComputeScaledFont
virtual void ComputeScaledFont(vtkViewport *viewport)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkTexturedActor2D.h
vtkTextActor::MaximumLineHeight
float MaximumLineHeight
Definition: vtkTextActor.h:256
vtkTextActor::GetInput
char * GetInput()
vtkTextActor::SetConstrainedFontSize
static int SetConstrainedFontSize(vtkTextActor *, vtkViewport *, int targetWidth, int targetHeight)
vtkTextActor::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkTextActor.h:232
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkTextActor::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkTextActor::GetImageBoundingBox
virtual bool GetImageBoundingBox(vtkTextProperty *tprop, vtkViewport *viewport, int bbox[4])
vtkTextActor::GetAlignmentPoint
int GetAlignmentPoint()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkTextActor::RectanglePoints
vtkPoints * RectanglePoints
Definition: vtkTextActor.h:278
vtkTextActor::ScaledTextProperty
vtkTextProperty * ScaledTextProperty
Definition: vtkTextActor.h:274
vtkTextActor::~vtkTextActor
~vtkTextActor()
vtkTextActor::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkTextActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextActor::ComputeRectangle
virtual void ComputeRectangle(vtkViewport *viewport)
vtkTextActor::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:55
vtkTextActor::TextProperty
vtkTextProperty * TextProperty
Definition: vtkTextActor.h:262
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRenderingCoreModule.h
vtkTextActor::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkTextActor::SetNonLinearFontScale
virtual void SetNonLinearFontScale(double exponent, int target)
vtkTextActor::BuildTime
vtkTimeStamp BuildTime
Definition: vtkTextActor.h:265
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkTextActor::vtkTextActor
vtkTextActor()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkTextActor::Rectangle
vtkPolyData * Rectangle
Definition: vtkTextActor.h:277
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkTextActor::UseBorderAlign
int UseBorderAlign
Definition: vtkTextActor.h:260
vtkTextActor::GetFontScale
static float GetFontScale(vtkViewport *viewport)
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:262
vtkTextActor::TEXT_SCALE_MODE_PROP
@ TEXT_SCALE_MODE_PROP
Definition: vtkTextActor.h:113
vtkTextActor::SetMultipleConstrainedFontSize
static int SetMultipleConstrainedFontSize(vtkViewport *, int targetWidth, int targetHeight, vtkTextActor **actors, int nbOfActors, int *maxResultingSize)
vtkTextRenderer
Interface for generating images and path data from string data, using multiple backends.
Definition: vtkTextRenderer.h:75
vtkTextActor::SpecifiedToDisplay
void SpecifiedToDisplay(double *pos, vtkViewport *vport, int specified)
vtkTextActor::SetInput
void SetInput(const char *inputString)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkTextActor::TextRenderer
vtkTextRenderer * TextRenderer
Definition: vtkTextActor.h:264
vtkTextActor::GetBoundingBox
virtual void GetBoundingBox(vtkViewport *vport, double bbox[4])
vtkTextActor::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkTextActor::DisplayToSpecified
void DisplayToSpecified(double *pos, vtkViewport *vport, int specified)
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkTextActor::TextScaleMode
int TextScaleMode
Definition: vtkTextActor.h:258
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:828
vtkTextActor::FontScaleExponent
double FontScaleExponent
Definition: vtkTextActor.h:257
vtkTextActor::Input
char * Input
Definition: vtkTextActor.h:269
vtkTextActor::RenderedDPI
int RenderedDPI
Definition: vtkTextActor.h:272
vtkTextActor::Transform
vtkTransform * Transform
Definition: vtkTextActor.h:266
vtkTextActor::SetTextScaleModeToViewport
void SetTextScaleModeToViewport()
Definition: vtkTextActor.h:106
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843