VTK
vtkBillboardTextActor3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBillboardTextActor3D.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 =========================================================================*/
20 #ifndef vtkBillboardTextActor3D_h
21 #define vtkBillboardTextActor3D_h
22 
23 #include "vtkRenderingCoreModule.h" // For export macro
24 #include "vtkProp3D.h"
25 #include "vtkNew.h" // For.... vtkNew!
26 
27 class vtkActor;
28 class vtkImageData;
29 class vtkPolyData;
30 class vtkPolyDataMapper;
31 class vtkRenderer;
32 class vtkTextProperty;
33 class vtkTextRenderer;
34 class vtkTexture;
35 
36 class VTKRENDERINGCORE_EXPORT vtkBillboardTextActor3D: public vtkProp3D
37 {
38 public:
39  static vtkBillboardTextActor3D* New();
41  void PrintSelf(ostream &os, vtkIndent indent) override;
42 
47  void SetInput(const char *in);
48  vtkGetStringMacro(Input)
56  vtkGetVector2Macro(DisplayOffset, int)
57  vtkSetVector2Macro(DisplayOffset, int)
64  void SetTextProperty(vtkTextProperty *tprop);
65  vtkGetObjectMacro(TextProperty, vtkTextProperty)
72  virtual void SetForceOpaque(bool opaque);
73  virtual bool GetForceOpaque();
74  virtual void ForceOpaqueOn();
75  virtual void ForceOpaqueOff();
76  virtual void SetForceTranslucent(bool trans);
77  virtual bool GetForceTranslucent();
78  virtual void ForceTranslucentOn();
79  virtual void ForceTranslucentOff();
85  int HasTranslucentPolygonalGeometry() override;
86 
90  int RenderOpaqueGeometry(vtkViewport *vp) override;
91 
97 
98  void ReleaseGraphicsResources(vtkWindow *win) override;
99  double *GetBounds() override;
100  using Superclass::GetBounds;
101 
106  vtkGetVector3Macro(AnchorDC, double)
107 
108 protected:
110  ~vtkBillboardTextActor3D() override;
111 
112  bool InputIsValid();
113 
114  bool TextureIsStale(vtkRenderer *ren);
115  void GenerateTexture(vtkRenderer *ren);
116 
117  bool QuadIsStale(vtkRenderer *ren);
118  void GenerateQuad(vtkRenderer *ren);
119 
120  // Used by the opaque pass to tell the translucent pass not to render.
121  void Invalidate();
122  bool IsValid();
123 
124  // Used to sync the internal actor's state.
125  void PreRender();
126 
127  // Text specification:
128  char *Input;
130 
131  // Offset in display coordinates.
132  int DisplayOffset[2];
133 
134  // Cached metadata to determine if things need rebuildin'
137 
138  // Rendering stuffies
145 
146  // Display coordinate for anchor position. Z value is in NDC.
147  // Cached for GL2PS export on OpenGL2:
148  double AnchorDC[3];
149 
150 private:
152  void operator=(const vtkBillboardTextActor3D&) = delete;
153 };
154 
155 #endif // vtkBillboardTextActor3D_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
abstract specification for Viewports
Definition: vtkViewport.h:47
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:222
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:294
record modification and/or execution time
Definition: vtkTimeStamp.h:35
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:303
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:130
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkNew< vtkImageData > Image
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
represent text properties.
map vtkPolyData to graphics primitives
Interface for generating images and path data from string data, using multiple backends.
vtkNew< vtkTextRenderer > TextRenderer
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkNew< vtkPolyDataMapper > QuadMapper