VTK  9.3.0
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
23VTK_ABI_NAMESPACE_BEGIN
24class vtkPen;
25class vtkBrush;
26class vtkTextProperty;
27
28class VTKRENDERINGCONTEXT2D_EXPORT vtkTooltipItem : public vtkContextItem
29{
30public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
38
40
43 vtkSetVector2Macro(Position, float);
44 void SetPosition(const vtkVector2f& pos);
46
48
51 vtkGetVector2Macro(Position, float);
54
56
59 virtual void SetText(const vtkStdString& text);
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
95protected:
97 ~vtkTooltipItem() override;
98
100 float* Position;
105
106private:
107 vtkTooltipItem(const vtkTooltipItem&) = delete;
108 void operator=(const vtkTooltipItem&) = delete;
109};
110
111VTK_ABI_NAMESPACE_END
112#endif // vtkTooltipItem_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition vtkBrush.h:30
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:29
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:29
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