VTK  9.2.6
vtkFlagpoleLabel.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkFlagpoleLabel.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=========================================================================*/
25#ifndef vtkFlagpoleLabel_h
26#define vtkFlagpoleLabel_h
27
28#include "vtkActor.h"
29#include "vtkNew.h" // For.... vtkNew!
30#include "vtkRenderingCoreModule.h" // For export macro
31#include "vtkSmartPointer.h" // For.... vtkSmartPointer!
32
33class vtkActor;
34class vtkImageData;
35class vtkLineSource;
36class vtkPolyData;
38class vtkRenderer;
39class vtkTextProperty;
40class vtkTextRenderer;
41
42class VTKRENDERINGCORE_EXPORT vtkFlagpoleLabel : public vtkActor
43{
44public:
46 vtkTypeMacro(vtkFlagpoleLabel, vtkActor);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
53 void SetInput(const char* in);
54 vtkGetStringMacro(Input);
62 vtkGetObjectMacro(TextProperty, vtkTextProperty);
69 void SetForceOpaque(bool opaque) override;
70 bool GetForceOpaque() VTK_FUTURE_CONST override;
71 void ForceOpaqueOn() override;
72 void ForceOpaqueOff() override;
73 void SetForceTranslucent(bool trans) override;
74 bool GetForceTranslucent() VTK_FUTURE_CONST override;
75 void ForceTranslucentOn() override;
76 void ForceTranslucentOff() override;
82 vtkTypeBool HasTranslucentPolygonalGeometry() override;
83
87 int RenderOpaqueGeometry(vtkViewport* vp) override;
88
93 int RenderTranslucentPolygonalGeometry(vtkViewport* vp) override;
94
95 void ReleaseGraphicsResources(vtkWindow* win) override;
96 double* GetBounds() override;
97 using Superclass::GetBounds;
98
102 vtkGetVector3Macro(BasePosition, double);
103 void SetBasePosition(double x, double y, double z);
104
108 vtkGetVector3Macro(TopPosition, double);
109 void SetTopPosition(double x, double y, double z);
110
116 vtkGetMacro(FlagSize, double);
117 vtkSetMacro(FlagSize, double);
118
119protected:
121 ~vtkFlagpoleLabel() override;
122
123 bool InputIsValid();
124
125 void UpdateInternals(vtkRenderer* ren);
126
127 bool TextureIsStale(vtkRenderer* ren);
128 void GenerateTexture(vtkRenderer* ren);
129
130 bool QuadIsStale(vtkRenderer* ren);
131 void GenerateQuad(vtkRenderer* ren);
132
133 // Used by the opaque pass to tell the translucent pass not to render.
134 void Invalidate();
135 bool IsValid();
136
137 // Used to sync the internal actor's state.
138 void PreRender();
139
140 // Text specification:
141 char* Input;
142 vtkTextProperty* TextProperty;
143
144 // Cached metadata to determine if things need rebuildin'
145 int RenderedDPI;
146 vtkTimeStamp InputMTime;
147
148 // We cache this so we can recompute the bounds between renders, if needed.
149 vtkSmartPointer<vtkRenderer> RenderedRenderer;
150
151 // Rendering stuffies
152 vtkNew<vtkTextRenderer> TextRenderer;
156 vtkNew<vtkActor> QuadActor;
157
160 vtkNew<vtkActor> PoleActor;
161
162 double TopPosition[3];
163 double BasePosition[3];
164 double FlagSize;
165
166private:
167 vtkFlagpoleLabel(const vtkFlagpoleLabel&) = delete;
168 void operator=(const vtkFlagpoleLabel&) = delete;
169};
170
171#endif // vtkFlagpoleLabel_h
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
Renders a flagpole (line) with a label at the top that faces the camera.
void SetTextProperty(vtkTextProperty *tprop)
The vtkTextProperty object that controls the rendered text.
bool GetForceOpaque() VTK_FUTURE_CONST override
Force the actor to render during the opaque or translucent pass.
void SetInput(const char *in)
The UTF-8 encoded string to display.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetForceOpaque(bool opaque) override
Force the actor to render during the opaque or translucent pass.
static vtkFlagpoleLabel * New()
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
create a line defined by two end points
Allocate and hold a VTK object.
Definition vtkNew.h:56
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
abstract specification for renderers
Definition vtkRenderer.h:67
Hold a reference to a vtkObjectBase instance.
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69