VTK: Rendering/Context2D/vtkTooltipItem.h Source File

| 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:
31 vtkTypeMacro(vtkTooltipItem, vtkContextItem);
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:
96 vtkTooltipItem();
97 ~vtkTooltipItem() override;
98
99 vtkVector2f PositionVector;
100 float* Position;
101 vtkStdString Text;
102 vtkTextProperty* TextProperties;
103 vtkPen* Pen;
104 vtkBrush* Brush;
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
vtkBrush
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:39
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:35
vtkTooltipItem
takes care of drawing 2D axes
Definition: vtkTooltipItem.h:29
vtkTooltipItem::SetText
virtual void SetText(const vtkStdString &text)
Get/set the text of the item.
vtkTooltipItem::New
static vtkTooltipItem * New()
Creates a 2D Chart object.
vtkTooltipItem::SetPosition
void SetPosition(const vtkVector2f &pos)
Set the position of the tooltip (in pixels).
vtkTooltipItem::Update
void Update() override
Update the geometry of the tooltip.
vtkTooltipItem::PositionVector
vtkVector2f PositionVector
Definition: vtkTooltipItem.h:99
vtkTooltipItem::TextProperties
vtkTextProperty * TextProperties
Definition: vtkTooltipItem.h:102
vtkTooltipItem::GetPositionVector
vtkVector2f GetPositionVector()
Get position of the axis (in pixels).
vtkTooltipItem::Text
vtkStdString Text
Definition: vtkTooltipItem.h:101
vtkTooltipItem::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the tooltip.
vtkTooltipItem::Pen
vtkPen * Pen
Definition: vtkTooltipItem.h:103
vtkTooltipItem::GetText
virtual vtkStdString GetText()
Get/set the text of the item.
vtkTooltipItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTooltipItem::~vtkTooltipItem
~vtkTooltipItem() override
vtkTooltipItem::Position
float * Position
Definition: vtkTooltipItem.h:100
vtkTooltipItem::Brush
vtkBrush * Brush
Definition: vtkTooltipItem.h:104
vtkTooltipItem::vtkTooltipItem
vtkTooltipItem()
vtkVector2f
Definition: vtkVector.h:463
vtkParticleTracerBaseNamespace::Position
struct Position_t Position
Definition: vtkParticleTracerBase.h:55
vtkContextItem.h
vtkStdString.h
vtkVector.h