File: vtkTextActor3D.h

package info (click to toggle)
vtk 5.0.4-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 51,084 kB
  • ctags: 70,426
  • sloc: cpp: 524,166; ansic: 220,276; tcl: 43,377; python: 14,037; perl: 3,102; java: 1,436; yacc: 1,033; sh: 339; lex: 248; makefile: 197; asm: 154
file content (107 lines) | stat: -rw-r--r-- 3,323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    $RCSfile: vtkTextActor3D.h,v $

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkTextActor3D - An actor that displays text.
// .SECTION Description
// The input text is rendered into a buffer, which in turn is used as a
// texture applied onto a quad (a vtkImageActor is used under the hood).
// .SECTION Warning
// This class is experimental at the moment. 
// - The orientation is not optimized, the quad should be oriented, not
//   the text itself when it is rendered in the buffer (we end up with
//   excessively big textures for 45 degrees angles).
//   This will be fixed first.
// - No checking is done at the moment regarding hardware texture size limits.
// - Alignment is not supported (soon).
// - Multiline is not supported.
// - Need to fix angle out of 0<->360
//
// .SECTION See Also
// vtkProp3D

#ifndef __vtkTextActor3D_h
#define __vtkTextActor3D_h

#include "vtkProp3D.h"

class vtkImageActor;
class vtkImageData;
class vtkTextProperty;

class VTK_RENDERING_EXPORT vtkTextActor3D : public vtkProp3D
{
public:
  static vtkTextActor3D *New();
  vtkTypeRevisionMacro(vtkTextActor3D,vtkProp3D);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Set the text string to be displayed.
  vtkSetStringMacro(Input);
  vtkGetStringMacro(Input);

  // Description:
  // Set/Get the text property.
  virtual void SetTextProperty(vtkTextProperty *p);
  vtkGetObjectMacro(TextProperty,vtkTextProperty);
  
  // Description:
  // Shallow copy of this text actor. Overloads the virtual
  // vtkProp method.
  void ShallowCopy(vtkProp *prop);

  // Description:
  // Get the bounds for this Prop3D as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
  virtual double *GetBounds();

  //BTX
  // Description:
  // 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 void ReleaseGraphicsResources(vtkWindow *);

  // Description:
  // 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.
  int RenderOpaqueGeometry(vtkViewport* viewport);
  int RenderTranslucentGeometry(vtkViewport* viewport);
  int RenderOverlay(vtkViewport* viewport);
  //ETX

protected:
   vtkTextActor3D();
  ~vtkTextActor3D();

  char            *Input;

  vtkImageActor   *ImageActor;
  vtkImageData    *ImageData;
  vtkTextProperty *TextProperty;

  vtkTimeStamp    BuildTime;

  virtual int UpdateImageActor();

private:
  vtkTextActor3D(const vtkTextActor3D&);  // Not implemented.
  void operator=(const vtkTextActor3D&);  // Not implemented.
};


#endif