VTK  9.3.1
vtkTooltipItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
15 #ifndef vtkTooltipItem_h
16 #define vtkTooltipItem_h
17 
18 #include "vtkContextItem.h"
19 #include "vtkRenderingContext2DModule.h" // For export macro
20 #include "vtkStdString.h" // For vtkStdString ivars
21 #include "vtkVector.h" // Needed for vtkVector2f
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkPen;
25 class vtkBrush;
26 class vtkTextProperty;
27 
28 class VTKRENDERINGCONTEXT2D_EXPORT vtkTooltipItem : public vtkContextItem
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
37  static vtkTooltipItem* New();
38 
40 
43  vtkSetVector2Macro(Position, float);
44  void SetPosition(const vtkVector2f& pos);
46 
48 
51  vtkGetVector2Macro(Position, float);
52  vtkVector2f GetPositionVector();
54 
56 
59  virtual void SetText(const vtkStdString& text);
60  virtual vtkStdString GetText();
62 
64 
68  vtkGetObjectMacro(Pen, vtkPen);
70 
72 
75  vtkGetObjectMacro(Brush, vtkBrush);
77 
79 
82  vtkGetObjectMacro(TextProperties, vtkTextProperty);
84 
88  void Update() override;
89 
93  bool Paint(vtkContext2D* painter) override;
94 
95 protected:
97  ~vtkTooltipItem() override;
98 
100  float* Position;
105 
106 private:
107  vtkTooltipItem(const vtkTooltipItem&) = delete;
108  void operator=(const vtkTooltipItem&) = delete;
109 };
110 
111 VTK_ABI_NAMESPACE_END
112 #endif // vtkTooltipItem_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
vtkVector2f PositionVector
base class for items that are part of a vtkContextScene.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkTextProperty * TextProperties
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:29
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:28
represent text properties.
vtkBrush * Brush
vtkStdString Text
takes care of drawing 2D axes
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.