VTK
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 "vtkRenderingContext2DModule.h" // For export macro
31 #include "vtkContextItem.h"
32 #include "vtkVector.h" // Needed for vtkVector2f
33 #include "vtkStdString.h" // For vtkStdString ivars
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);
63  vtkVector2f GetPositionVector();
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:
107  vtkTooltipItem();
108  ~vtkTooltipItem() override;
109 
111  float* Position;
116 
117 private:
118  vtkTooltipItem(const vtkTooltipItem &) = delete;
119  void operator=(const vtkTooltipItem &) = delete;
120 
121 };
122 
123 #endif //vtkTooltipItem_h
vtkBrush
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:40
vtkStdString.h
vtkTooltipItem::Pen
vtkPen * Pen
Definition: vtkTooltipItem.h:114
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkVector.h
vtkTooltipItem::TextProperties
vtkTextProperty * TextProperties
Definition: vtkTooltipItem.h:113
vtkTooltipItem
takes care of drawing 2D axes
Definition: vtkTooltipItem.h:39
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkContextItem.h
vtkTooltipItem::PositionVector
vtkVector2f PositionVector
Definition: vtkTooltipItem.h:110
vtkX3D::title
Definition: vtkX3D.h:500
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTooltipItem::Position
float * Position
Definition: vtkTooltipItem.h:111
vtkContextItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:34
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkTooltipItem::Text
vtkStdString Text
Definition: vtkTooltipItem.h:112
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
vtkTooltipItem::Brush
vtkBrush * Brush
Definition: vtkTooltipItem.h:115
vtkVector2f
Definition: vtkVector.h:418
vtkAbstractContextItem::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.