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);
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  virtual void Update();
100 
104  virtual bool Paint(vtkContext2D *painter);
105 
106 protected:
107  vtkTooltipItem();
108  ~vtkTooltipItem();
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
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
vtkVector2f PositionVector
base class for items that are part of a vtkContextScene.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkTextProperty * TextProperties
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
represent text properties.
vtkBrush * Brush
vtkStdString Text
takes care of drawing 2D axes
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.