VTK  9.0.3
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 
35 class vtkPen;
36 class vtkBrush;
37 class vtkTextProperty;
38 
39 class VTKRENDERINGCONTEXT2D_EXPORT vtkTooltipItem : public vtkContextItem
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  static vtkTooltipItem* New();
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& title);
71  virtual vtkStdString GetText();
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 
106 protected:
108  ~vtkTooltipItem() override;
109 
111  float* Position;
116 
117 private:
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:38
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:53
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition: vtkIndent.h:34
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:37
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:35
represent text properties.
takes care of drawing 2D axes
static vtkTooltipItem * New()
Creates a 2D Chart object.
virtual void SetText(const vtkStdString &title)
Get/set the text of the item.
void SetPosition(const vtkVector2f &pos)
void Update() override
Update the geometry of the tooltip.
vtkVector2f PositionVector
vtkTextProperty * TextProperties
vtkVector2f GetPositionVector()
vtkStdString Text
bool Paint(vtkContext2D *painter) override
Paint event for the tooltip.
virtual vtkStdString GetText()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkTooltipItem() override
vtkBrush * Brush
@ title
Definition: vtkX3D.h:506