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  virtual void PrintSelf(ostream &os, vtkIndent indent);
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  virtual void Update();
100 
104  virtual bool Paint(vtkContext2D *painter);
105 
106 protected:
109 
111  float* Position;
116 
117 private:
118  vtkTooltipItem(const vtkTooltipItem &) VTK_DELETE_FUNCTION;
119  void operator=(const vtkTooltipItem &) VTK_DELETE_FUNCTION;
120 
121 };
122 
123 #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:58
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition: vtkIndent.h:40
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:40
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
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.
virtual bool Paint(vtkContext2D *painter)
Paint event for the tooltip.
void SetPosition(const vtkVector2f &pos)
vtkVector2f PositionVector
virtual void Update()
Update the geometry of the tooltip.
vtkTextProperty * TextProperties
vtkVector2f GetPositionVector()
vtkStdString Text
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual vtkStdString GetText()
vtkBrush * Brush
@ title
Definition: vtkX3D.h:500