VTK
dox/Rendering/Context2D/vtkTooltipItem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkTooltipItem.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00026 #ifndef __vtkTooltipItem_h
00027 #define __vtkTooltipItem_h
00028 
00029 #include "vtkRenderingContext2DModule.h" // For export macro
00030 #include "vtkContextItem.h"
00031 #include "vtkVector.h"     // Needed for vtkVector2f
00032 #include "vtkStdString.h"  // For vtkStdString ivars
00033 
00034 class vtkPen;
00035 class vtkBrush;
00036 class vtkTextProperty;
00037 
00038 class VTKRENDERINGCONTEXT2D_EXPORT vtkTooltipItem : public vtkContextItem
00039 {
00040 public:
00041   vtkTypeMacro(vtkTooltipItem, vtkContextItem);
00042   virtual void PrintSelf(ostream &os, vtkIndent indent);
00043 
00045   static vtkTooltipItem *New();
00046 
00048 
00049   vtkSetVector2Macro(Position, float);
00050   void SetPosition(const vtkVector2f &pos);
00052 
00054 
00055   vtkGetVector2Macro(Position, float);
00056   vtkVector2f GetPositionVector();
00058 
00060 
00061   virtual void SetText(const vtkStdString &title);
00062   virtual vtkStdString GetText();
00064 
00066 
00068   vtkGetObjectMacro(Pen, vtkPen);
00070 
00072 
00073   vtkGetObjectMacro(Brush, vtkBrush);
00075 
00077 
00079   vtkGetObjectMacro(TextProperties, vtkTextProperty);
00081 
00083   virtual void Update();
00084 
00086   virtual bool Paint(vtkContext2D *painter);
00087 
00088 //BTX
00089 protected:
00090   vtkTooltipItem();
00091   ~vtkTooltipItem();
00092 
00093   vtkVector2f PositionVector;
00094   float* Position;
00095   vtkStdString Text;
00096   vtkTextProperty* TextProperties;
00097   vtkPen* Pen;
00098   vtkBrush* Brush;
00099 
00100 private:
00101   vtkTooltipItem(const vtkTooltipItem &); // Not implemented.
00102   void operator=(const vtkTooltipItem &);   // Not implemented.
00103 //ETX
00104 };
00105 
00106 #endif //__vtkTooltipItem_h