VTK  9.4.20241121
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
24VTK_ABI_NAMESPACE_BEGIN
25class vtkPen;
26class vtkBrush;
27class vtkTextProperty;
28
29class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkTooltipItem : public vtkContextItem
30{
31public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
39
41
44 vtkSetVector2Macro(Position, float);
45 void SetPosition(const vtkVector2f& pos);
47
49
52 vtkGetVector2Macro(Position, float);
55
57
60 virtual void SetText(const vtkStdString& text);
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
96protected:
98 ~vtkTooltipItem() override;
99
101 float* Position;
106
107private:
108 vtkTooltipItem(const vtkTooltipItem&) = delete;
109 void operator=(const vtkTooltipItem&) = delete;
110};
111
112VTK_ABI_NAMESPACE_END
113#endif // vtkTooltipItem_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition vtkBrush.h:90
Class for drawing 2D primitives to a graphical context.
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition vtkIndent.h:108
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:79
Wrapper around std::string to keep symbols short.
represent text properties.
takes care of drawing 2D axes
virtual void SetText(const vtkStdString &text)
Get/set the text of the item.
void SetPosition(const vtkVector2f &pos)
Set the position of the tooltip (in pixels).
void Update() override
Update the geometry of the tooltip.
vtkVector2f PositionVector
vtkTextProperty * TextProperties
vtkVector2f GetPositionVector()
Get position of the axis (in pixels).
vtkStdString Text
bool Paint(vtkContext2D *painter) override
Paint event for the tooltip.
virtual vtkStdString GetText()
Get/set the text of the item.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTooltipItem * New()
Creates a 2D Chart object.
~vtkTooltipItem() override
#define VTK_MARSHALAUTO