VTK  9.1.0
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 =========================================================================*/
39 #ifndef vtkBillboardTextActor3D_h
40 #define vtkBillboardTextActor3D_h
41 
42 #include "vtkNew.h" // For.... vtkNew!
43 #include "vtkProp3D.h"
44 #include "vtkRenderingCoreModule.h" // For export macro
45 #include "vtkSmartPointer.h" // For.... vtkSmartPointer!
46 
47 class vtkActor;
48 class vtkImageData;
49 class vtkPolyData;
50 class vtkPolyDataMapper;
51 class vtkRenderer;
52 class vtkTextProperty;
53 class vtkTextRenderer;
54 class vtkTexture;
55 
56 class VTKRENDERINGCORE_EXPORT vtkBillboardTextActor3D : public vtkProp3D
57 {
58 public:
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
71  void GetActors(vtkPropCollection*) override;
72 
78 
83  void SetInput(const char* in);
84  vtkGetStringMacro(Input);
92  vtkGetVector2Macro(DisplayOffset, int);
93  vtkSetVector2Macro(DisplayOffset, int);
101  vtkGetObjectMacro(TextProperty, vtkTextProperty);
108  virtual void SetForceOpaque(bool opaque);
109  virtual bool GetForceOpaque();
110  virtual void ForceOpaqueOn();
111  virtual void ForceOpaqueOff();
112  virtual void SetForceTranslucent(bool trans);
113  virtual bool GetForceTranslucent();
114  virtual void ForceTranslucentOn();
115  virtual void ForceTranslucentOff();
122 
127 
133 
134  void ReleaseGraphicsResources(vtkWindow* win) override;
135  double* GetBounds() override;
136  using Superclass::GetBounds;
137 
142  vtkGetVector3Macro(AnchorDC, double);
143 
144 protected:
147 
148  bool InputIsValid();
149 
151 
154 
157 
158  // Used by the opaque pass to tell the translucent pass not to render.
159  void Invalidate();
160  bool IsValid();
161 
162  // Used to sync the internal actor's state.
163  void PreRender();
164 
165  // Text specification:
166  char* Input;
168 
169  // Offset in display coordinates.
170  int DisplayOffset[2];
171 
172  // Cached metadata to determine if things need rebuildin'
175 
176  // We cache this so we can recompute the bounds between renders, if needed.
178 
179  // Rendering stuffies
186 
187  // Display coordinate for anchor position. Z value is in NDC.
188  // Cached for GL2PS export on OpenGL2:
189  double AnchorDC[3];
190 
191 private:
193  void operator=(const vtkBillboardTextActor3D&) = delete;
194 };
195 
196 #endif // vtkBillboardTextActor3D_h
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:146
vtkBillboardTextActor3D::Invalidate
void Invalidate()
vtkBillboardTextActor3D::SetForceTranslucent
virtual void SetForceTranslucent(bool trans)
Force the actor to render during the opaque or translucent pass.
vtkBillboardTextActor3D::IsValid
bool IsValid()
vtkBillboardTextActor3D::GetForceTranslucent
virtual bool GetForceTranslucent()
Force the actor to render during the opaque or translucent pass.
vtkBillboardTextActor3D::QuadMapper
vtkNew< vtkPolyDataMapper > QuadMapper
Definition: vtkBillboardTextActor3D.h:184
vtkBillboardTextActor3D::ForceOpaqueOn
virtual void ForceOpaqueOn()
Force the actor to render during the opaque or translucent pass.
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:93
vtkBillboardTextActor3D::ForceOpaqueOff
virtual void ForceOpaqueOff()
Force the actor to render during the opaque or translucent pass.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkBillboardTextActor3D::UpdateGeometry
void UpdateGeometry(vtkViewport *vp)
Updates the billboard geometry without performing any rendering, to assist GetActors().
vtkSmartPointer< vtkRenderer >
vtkBillboardTextActor3D::TextureIsStale
bool TextureIsStale(vtkRenderer *ren)
vtkBillboardTextActor3D::GetForceOpaque
virtual bool GetForceOpaque()
Force the actor to render during the opaque or translucent pass.
vtkBillboardTextActor3D
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
Definition: vtkBillboardTextActor3D.h:57
vtkBillboardTextActor3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBillboardTextActor3D::Image
vtkNew< vtkImageData > Image
Definition: vtkBillboardTextActor3D.h:181
vtkBillboardTextActor3D::GetBounds
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
vtkBillboardTextActor3D::SetTextProperty
void SetTextProperty(vtkTextProperty *tprop)
The vtkTextProperty object that controls the rendered text.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkBillboardTextActor3D::QuadIsStale
bool QuadIsStale(vtkRenderer *ren)
vtkBillboardTextActor3D::QuadActor
vtkNew< vtkActor > QuadActor
Definition: vtkBillboardTextActor3D.h:185
vtkBillboardTextActor3D::RenderedRenderer
vtkSmartPointer< vtkRenderer > RenderedRenderer
Definition: vtkBillboardTextActor3D.h:177
vtkBillboardTextActor3D::vtkBillboardTextActor3D
vtkBillboardTextActor3D()
vtkBillboardTextActor3D::New
static vtkBillboardTextActor3D * New()
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:175
vtkBillboardTextActor3D::UpdateInternals
void UpdateInternals(vtkRenderer *ren)
vtkBillboardTextActor3D::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkBillboardTextActor3D::~vtkBillboardTextActor3D
~vtkBillboardTextActor3D() override
vtkBillboardTextActor3D::SetInput
void SetInput(const char *in)
The UTF-8 encoded string to display.
vtkBillboardTextActor3D::InputMTime
vtkTimeStamp InputMTime
Definition: vtkBillboardTextActor3D.h:174
vtkBillboardTextActor3D::PreRender
void PreRender()
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkSmartPointer.h
vtkBillboardTextActor3D::SetForceOpaque
virtual void SetForceOpaque(bool opaque)
Force the actor to render during the opaque or translucent pass.
vtkNew< vtkTextRenderer >
vtkProp::GetBounds
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:154
vtkBillboardTextActor3D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *win) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBillboardTextActor3D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vp) override
Check/update geometry/texture in opaque pass, since it only happens once.
vtkBillboardTextActor3D::RenderedDPI
int RenderedDPI
Definition: vtkBillboardTextActor3D.h:173
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:143
vtkBillboardTextActor3D::Quad
vtkNew< vtkPolyData > Quad
Definition: vtkBillboardTextActor3D.h:183
vtkBillboardTextActor3D::TextRenderer
vtkNew< vtkTextRenderer > TextRenderer
Definition: vtkBillboardTextActor3D.h:180
vtkBillboardTextActor3D::ForceTranslucentOff
virtual void ForceTranslucentOff()
Force the actor to render during the opaque or translucent pass.
vtkBillboardTextActor3D::InputIsValid
bool InputIsValid()
vtkNew.h
vtkTextRenderer
Interface for generating images and path data from string data, using multiple backends.
Definition: vtkTextRenderer.h:75
vtkBillboardTextActor3D::GenerateTexture
void GenerateTexture(vtkRenderer *ren)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkBillboardTextActor3D::Input
char * Input
Definition: vtkBillboardTextActor3D.h:166
vtkBillboardTextActor3D::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Defers to internal actor.
vtkBillboardTextActor3D::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vp) override
Just render in translucent pass, since it can execute multiple times (depth peeling,...
vtkBillboardTextActor3D::ForceTranslucentOn
virtual void ForceTranslucentOn()
Force the actor to render during the opaque or translucent pass.
vtkBillboardTextActor3D::TextProperty
vtkTextProperty * TextProperty
Definition: vtkBillboardTextActor3D.h:167
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkBillboardTextActor3D::GenerateQuad
void GenerateQuad(vtkRenderer *ren)
vtkBillboardTextActor3D::Texture
vtkNew< vtkTexture > Texture
Definition: vtkBillboardTextActor3D.h:182
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp3D.h