VTK  9.0.3
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 "vtkNew.h" // For.... vtkNew!
24 #include "vtkProp3D.h"
25 #include "vtkRenderingCoreModule.h" // For export macro
26 #include "vtkSmartPointer.h" // For.... vtkSmartPointer!
27 
28 class vtkActor;
29 class vtkImageData;
30 class vtkPolyData;
31 class vtkPolyDataMapper;
32 class vtkRenderer;
33 class vtkTextProperty;
34 class vtkTextRenderer;
35 class vtkTexture;
36 
37 class VTKRENDERINGCORE_EXPORT vtkBillboardTextActor3D : public vtkProp3D
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
48  void SetInput(const char* in);
49  vtkGetStringMacro(Input);
57  vtkGetVector2Macro(DisplayOffset, int);
58  vtkSetVector2Macro(DisplayOffset, int);
66  vtkGetObjectMacro(TextProperty, vtkTextProperty);
73  virtual void SetForceOpaque(bool opaque);
74  virtual bool GetForceOpaque();
75  virtual void ForceOpaqueOn();
76  virtual void ForceOpaqueOff();
77  virtual void SetForceTranslucent(bool trans);
78  virtual bool GetForceTranslucent();
79  virtual void ForceTranslucentOn();
80  virtual void ForceTranslucentOff();
87 
91  int RenderOpaqueGeometry(vtkViewport* vp) override;
92 
98 
99  void ReleaseGraphicsResources(vtkWindow* win) override;
100  double* GetBounds() override;
101  using Superclass::GetBounds;
102 
107  vtkGetVector3Macro(AnchorDC, double);
108 
109 protected:
112 
113  bool InputIsValid();
114 
116 
119 
122 
123  // Used by the opaque pass to tell the translucent pass not to render.
124  void Invalidate();
125  bool IsValid();
126 
127  // Used to sync the internal actor's state.
128  void PreRender();
129 
130  // Text specification:
131  char* Input;
133 
134  // Offset in display coordinates.
135  int DisplayOffset[2];
136 
137  // Cached metadata to determine if things need rebuildin'
140 
141  // We cache this so we can recompute the bounds between renders, if needed.
143 
144  // Rendering stuffies
151 
152  // Display coordinate for anchor position. Z value is in NDC.
153  // Cached for GL2PS export on OpenGL2:
154  double AnchorDC[3];
155 
156 private:
158  void operator=(const vtkBillboardTextActor3D&) = delete;
159 };
160 
161 #endif // vtkBillboardTextActor3D_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
void SetTextProperty(vtkTextProperty *tprop)
The vtkTextProperty object that controls the rendered text.
vtkNew< vtkTextRenderer > TextRenderer
virtual bool GetForceOpaque()
Force the actor to render during the opaque or translucent pass.
bool TextureIsStale(vtkRenderer *ren)
void SetInput(const char *in)
The UTF-8 encoded string to display.
int RenderTranslucentPolygonalGeometry(vtkViewport *vp) override
Just render in translucent pass, since it can execute multiple times (depth peeling,...
virtual bool GetForceTranslucent()
Force the actor to render during the opaque or translucent pass.
int RenderOpaqueGeometry(vtkViewport *vp) override
Check/update geometry/texture in opaque pass, since it only happens once.
void ReleaseGraphicsResources(vtkWindow *win) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void SetForceTranslucent(bool trans)
Force the actor to render during the opaque or translucent pass.
bool QuadIsStale(vtkRenderer *ren)
virtual void ForceOpaqueOff()
Force the actor to render during the opaque or translucent pass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ForceOpaqueOn()
Force the actor to render during the opaque or translucent pass.
void GenerateQuad(vtkRenderer *ren)
vtkSmartPointer< vtkRenderer > RenderedRenderer
virtual void ForceTranslucentOff()
Force the actor to render during the opaque or translucent pass.
virtual void SetForceOpaque(bool opaque)
Force the actor to render during the opaque or translucent pass.
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
virtual void ForceTranslucentOn()
Force the actor to render during the opaque or translucent pass.
vtkNew< vtkImageData > Image
void GenerateTexture(vtkRenderer *ren)
vtkNew< vtkPolyDataMapper > QuadMapper
void UpdateInternals(vtkRenderer *ren)
static vtkBillboardTextActor3D * New()
vtkTypeBool HasTranslucentPolygonalGeometry() override
Defers to internal actor.
~vtkBillboardTextActor3D() override
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:44
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:126
abstract specification for renderers
Definition: vtkRenderer.h:59
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
handles properties associated with a texture map
Definition: vtkTexture.h:66
record modification and/or execution time
Definition: vtkTimeStamp.h:33
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
int vtkTypeBool
Definition: vtkABI.h:69