VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkPen;
26 class vtkBrush;
27 class vtkTextProperty;
28 
29 class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkTooltipItem : public vtkContextItem
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
38  static vtkTooltipItem* New();
39 
41 
44  vtkSetVector2Macro(Position, float);
45  void SetPosition(const vtkVector2f& pos);
47 
49 
52  vtkGetVector2Macro(Position, float);
53  vtkVector2f GetPositionVector();
55 
57 
60  virtual void SetText(const vtkStdString& text);
61  virtual vtkStdString GetText();
63 
65 
69  vtkGetObjectMacro(Pen, vtkPen);
71 
73 
76  vtkGetObjectMacro(Brush, vtkBrush);
78 
80 
83  vtkGetObjectMacro(TextProperties, vtkTextProperty);
85 
89  void Update() override;
90 
94  bool Paint(vtkContext2D* painter) override;
95 
96 protected:
98  ~vtkTooltipItem() override;
99 
101  float* Position;
106 
107 private:
108  vtkTooltipItem(const vtkTooltipItem&) = delete;
109  void operator=(const vtkTooltipItem&) = delete;
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #endif // vtkTooltipItem_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
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:30
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:29
represent text properties.
vtkBrush * Brush
vtkStdString Text
#define VTK_MARSHALAUTO
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.