VTK  9.1.0
vtkTooltipItem.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTooltipItem.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
27#ifndef vtkTooltipItem_h
28#define vtkTooltipItem_h
29
30#include "vtkContextItem.h"
31#include "vtkRenderingContext2DModule.h" // For export macro
32#include "vtkStdString.h" // For vtkStdString ivars
33#include "vtkVector.h" // Needed for vtkVector2f
34
35class vtkPen;
36class vtkBrush;
37class vtkTextProperty;
38
39class VTKRENDERINGCONTEXT2D_EXPORT vtkTooltipItem : public vtkContextItem
40{
41public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
49
51
54 vtkSetVector2Macro(Position, float);
55 void SetPosition(const vtkVector2f& pos);
57
59
62 vtkGetVector2Macro(Position, float);
65
67
70 virtual void SetText(const vtkStdString& text);
73
75
79 vtkGetObjectMacro(Pen, vtkPen);
81
83
86 vtkGetObjectMacro(Brush, vtkBrush);
88
90
93 vtkGetObjectMacro(TextProperties, vtkTextProperty);
95
99 void Update() override;
100
104 bool Paint(vtkContext2D* painter) override;
105
106protected:
108 ~vtkTooltipItem() override;
109
111 float* Position;
116
117private:
118 vtkTooltipItem(const vtkTooltipItem&) = delete;
119 void operator=(const vtkTooltipItem&) = delete;
120};
121
122#endif // vtkTooltipItem_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:97
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition: vtkIndent.h:113
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:136
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
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
vtkBrush * Brush