VTK  9.0.1
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);
61  void SetTextProperty(vtkTextProperty* tprop);
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 
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;
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
virtual void SetForceOpaque(bool)
Force the actor to be treated as opaque or translucent.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
abstract specification for Viewports
Definition: vtkViewport.h:44
virtual void SetForceTranslucent(bool)
Force the actor to be treated as opaque or translucent.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Renders a flagpole (line) with a label at the top that faces the camera.
virtual bool GetForceOpaque()
Force the actor to be treated as opaque or translucent.
abstract specification for renderers
Definition: vtkRenderer.h:67
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,1,1) visibility=1 pickable=1 dragable=1 orientation=(0,0,0).
vtkTextProperty * TextProperty
virtual bool GetForceTranslucent()
Force the actor to be treated as opaque or translucent.
vtkNew< vtkPolyDataMapper > QuadMapper
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkNew< vtkActor > PoleActor
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkNew< vtkLineSource > LineSource
vtkSmartPointer< vtkRenderer > RenderedRenderer
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
virtual void ForceTranslucentOff()
Force the actor to be treated as opaque or translucent.
vtkNew< vtkTextRenderer > TextRenderer
virtual void ForceOpaqueOff()
Force the actor to be treated as opaque or translucent.
double * GetBounds() override
Return a reference to the Prop3D&#39;s composite transform.
represent text properties.
create a line defined by two end points
Definition: vtkLineSource.h:60
map vtkPolyData to graphics primitives
Interface for generating images and path data from string data, using multiple backends.
vtkTimeStamp InputMTime
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some opaque/translucent polygonal geometry?
vtkNew< vtkImageData > Image
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
virtual void ForceOpaqueOn()
Force the actor to be treated as opaque or translucent.
virtual void ForceTranslucentOn()
Force the actor to be treated as opaque or translucent.
vtkNew< vtkActor > QuadActor
vtkNew< vtkPolyData > Quad
vtkNew< vtkPolyDataMapper > PoleMapper
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.