VTK  9.2.6
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 =========================================================================*/
23 #ifndef vtkBillboardTextActor3D_h
24 #define vtkBillboardTextActor3D_h
25 
26 #include "vtkNew.h" // For.... vtkNew!
27 #include "vtkProp3D.h"
28 #include "vtkRenderingCoreModule.h" // For export macro
29 #include "vtkSmartPointer.h" // For.... vtkSmartPointer!
30 
31 class vtkActor;
32 class vtkImageData;
33 class vtkPolyData;
34 class vtkPolyDataMapper;
35 class vtkRenderer;
36 class vtkTextProperty;
37 class vtkTextRenderer;
38 class vtkTexture;
39 
40 class VTKRENDERINGCORE_EXPORT vtkBillboardTextActor3D : public vtkProp3D
41 {
42 public:
43  static vtkBillboardTextActor3D* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
55  void GetActors(vtkPropCollection*) override;
56 
61  void UpdateGeometry(vtkViewport* vp);
62 
67  void SetInput(const char* in);
68  vtkGetStringMacro(Input);
76  vtkGetVector2Macro(DisplayOffset, int);
77  vtkSetVector2Macro(DisplayOffset, int);
84  void SetTextProperty(vtkTextProperty* tprop);
85  vtkGetObjectMacro(TextProperty, vtkTextProperty);
92  virtual void SetForceOpaque(bool opaque);
93  virtual bool GetForceOpaque();
94  virtual void ForceOpaqueOn();
95  virtual void ForceOpaqueOff();
96  virtual void SetForceTranslucent(bool trans);
97  virtual bool GetForceTranslucent();
98  virtual void ForceTranslucentOn();
99  virtual void ForceTranslucentOff();
106 
110  int RenderOpaqueGeometry(vtkViewport* vp) override;
111 
117 
118  void ReleaseGraphicsResources(vtkWindow* win) override;
119  double* GetBounds() override;
120  using Superclass::GetBounds;
121 
126  vtkGetVector3Macro(AnchorDC, double);
127 
128 protected:
130  ~vtkBillboardTextActor3D() override;
131 
132  bool InputIsValid();
133 
134  void UpdateInternals(vtkRenderer* ren);
135 
136  bool TextureIsStale(vtkRenderer* ren);
137  void GenerateTexture(vtkRenderer* ren);
138 
139  bool QuadIsStale(vtkRenderer* ren);
140  void GenerateQuad(vtkRenderer* ren);
141 
142  // Used by the opaque pass to tell the translucent pass not to render.
143  void Invalidate();
144  bool IsValid();
145 
146  // Used to sync the internal actor's state.
147  void PreRender();
148 
149  // Text specification:
150  char* Input;
152 
153  // Offset in display coordinates.
154  int DisplayOffset[2];
155 
156  // Cached metadata to determine if things need rebuildin'
159 
160  // We cache this so we can recompute the bounds between renders, if needed.
162 
163  // Rendering stuffies
170 
171  // Display coordinate for anchor position. Z value is in NDC.
172  // Cached for GL2PS export on OpenGL2:
173  double AnchorDC[3];
174 
175 private:
177  void operator=(const vtkBillboardTextActor3D&) = delete;
178 };
179 
180 #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:55
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:224
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:288
record modification and/or execution time
Definition: vtkTimeStamp.h:35
abstract specification for renderers
Definition: vtkRenderer.h:72
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:49
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:309
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:135
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkSmartPointer< vtkRenderer > RenderedRenderer
vtkNew< vtkImageData > Image
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
handles properties associated with a texture map
Definition: vtkTexture.h:68
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:225
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
Definition: vtkProp.h:67
vtkNew< vtkPolyDataMapper > QuadMapper