VTK  9.0.3
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 
33 class vtkActor;
34 class vtkImageData;
35 class vtkLineSource;
36 class vtkPolyData;
37 class vtkPolyDataMapper;
38 class vtkRenderer;
39 class vtkTextProperty;
40 class vtkTextRenderer;
41 
42 class VTKRENDERINGCORE_EXPORT vtkFlagpoleLabel : public vtkActor
43 {
44 public:
45  static vtkFlagpoleLabel* New();
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() override;
71  void ForceOpaqueOn() override;
72  void ForceOpaqueOff() override;
73  void SetForceTranslucent(bool trans) override;
74  bool GetForceTranslucent() override;
75  void ForceTranslucentOn() override;
76  void ForceTranslucentOff() override;
83 
87  int RenderOpaqueGeometry(vtkViewport* vp) override;
88 
94 
95  void ReleaseGraphicsResources(vtkWindow* win) override;
96  double* GetBounds() override;
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 
119 protected:
121  ~vtkFlagpoleLabel() override;
122 
123  bool InputIsValid();
124 
126 
129 
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;
143 
144  // Cached metadata to determine if things need rebuildin'
147 
148  // We cache this so we can recompute the bounds between renders, if needed.
150 
151  // Rendering stuffies
157 
161 
162  double TopPosition[3];
163  double BasePosition[3];
164  double FlagSize;
165 
166 private:
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 ReleaseGraphicsResources(vtkWindow *win) override
Release any graphics resources that are being consumed by this actor.
void SetTextProperty(vtkTextProperty *tprop)
The vtkTextProperty object that controls the rendered text.
vtkSmartPointer< vtkRenderer > RenderedRenderer
void GenerateQuad(vtkRenderer *ren)
vtkNew< vtkActor > QuadActor
vtkNew< vtkPolyDataMapper > PoleMapper
void ForceOpaqueOff() override
Force the actor to render during the opaque or translucent pass.
void SetInput(const char *in)
The UTF-8 encoded string to display.
vtkNew< vtkLineSource > LineSource
int RenderTranslucentPolygonalGeometry(vtkViewport *vp) override
Just render in translucent pass, since it can execute multiple times (depth peeling,...
vtkTextProperty * TextProperty
vtkNew< vtkActor > PoleActor
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkNew< vtkPolyDataMapper > QuadMapper
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkImageData > Image
vtkNew< vtkTextRenderer > TextRenderer
int RenderOpaqueGeometry(vtkViewport *vp) override
Check/update geometry/texture in opaque pass, since it only happens once.
void SetTopPosition(double x, double y, double z)
void GenerateTexture(vtkRenderer *ren)
void ForceOpaqueOn() override
Force the actor to render during the opaque or translucent pass.
~vtkFlagpoleLabel() override
bool GetForceTranslucent() override
Force the actor to render during the opaque or translucent pass.
void UpdateInternals(vtkRenderer *ren)
void SetForceOpaque(bool opaque) override
Force the actor to render during the opaque or translucent pass.
void ForceTranslucentOn() override
Force the actor to render during the opaque or translucent pass.
vtkTimeStamp InputMTime
vtkNew< vtkPolyData > Quad
void SetForceTranslucent(bool trans) override
Force the actor to render during the opaque or translucent pass.
bool QuadIsStale(vtkRenderer *ren)
bool TextureIsStale(vtkRenderer *ren)
bool GetForceOpaque() override
Force the actor to render during the opaque or translucent pass.
void SetBasePosition(double x, double y, double z)
vtkTypeBool HasTranslucentPolygonalGeometry() override
Defers to internal actor.
void ForceTranslucentOff() override
Force the actor to render during the opaque or translucent pass.
static vtkFlagpoleLabel * New()
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
create a line defined by two end points
Definition: vtkLineSource.h:61
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
double * GetBounds() override=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
abstract specification for renderers
Definition: vtkRenderer.h:68
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
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:38
int vtkTypeBool
Definition: vtkABI.h:69