VTK
dox/Charts/vtkAbstractContextItem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkContextItem.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 __vtkAbstractContextItem_h
00027 #define __vtkAbstractContextItem_h
00028 
00029 #include "vtkObject.h"
00030 
00031 class vtkContext2D;
00032 class vtkContextMouseEvent;
00033 class vtkContextKeyEvent;
00034 class vtkContextScene;
00035 class vtkContextScenePrivate;
00036 class vtkVector2f;
00037 
00038 class VTK_CHARTS_EXPORT vtkAbstractContextItem : public vtkObject
00039 {
00040 public:
00041   vtkTypeMacro(vtkAbstractContextItem, vtkObject);
00042   virtual void PrintSelf(ostream &os, vtkIndent indent);
00043 
00047   virtual void Update();
00048 
00050   virtual bool Paint(vtkContext2D *painter);
00051 
00054   bool PaintChildren(vtkContext2D *painter);
00055 
00058   virtual void ReleaseGraphicsResources();
00059 
00062   unsigned int AddItem(vtkAbstractContextItem* item);
00063 
00067   bool RemoveItem(vtkAbstractContextItem* item);
00068 
00072   bool RemoveItem(unsigned int index);
00073 
00076   vtkAbstractContextItem* GetItem(unsigned int index);
00077 
00079   unsigned int GetNumberOfItems();
00080 
00082   void ClearItems();
00083 
00084 //BTX
00086   virtual bool Hit(const vtkContextMouseEvent &mouse);
00087 
00090   virtual vtkAbstractContextItem* GetPickedItem(const vtkContextMouseEvent &mouse);
00091 
00094   virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
00095 
00098   virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
00099 
00102   virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
00103 
00106   virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
00107 
00110   virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
00111 
00114   virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
00115 
00119   virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
00120 
00122   virtual bool KeyPressEvent(const vtkContextKeyEvent &key);
00123 
00125 
00126   virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key);
00127 //ETX
00129 
00132   virtual void SetScene(vtkContextScene *scene);
00133 
00135 
00137   vtkContextScene* GetScene()
00138     {
00139     return this->Scene;
00140     }
00142 
00145   virtual void SetParent(vtkAbstractContextItem *parent);
00146 
00148 
00150   vtkAbstractContextItem* GetParent()
00151     {
00152     return this->Parent;
00153     }
00155 
00157   virtual vtkVector2f MapToParent(const vtkVector2f& point);
00158 
00160   virtual vtkVector2f MapFromParent(const vtkVector2f& point);
00161 
00163   virtual vtkVector2f MapToScene(const vtkVector2f& point);
00164 
00166   virtual vtkVector2f MapFromScene(const vtkVector2f& point);
00167 
00169 
00170   vtkGetMacro(Visible, bool);
00172 
00174 
00176   vtkSetMacro(Visible, bool);
00178 
00179 //BTX
00180 protected:
00181   vtkAbstractContextItem();
00182   ~vtkAbstractContextItem();
00183 
00185   vtkContextScene* Scene;
00186 
00188   vtkAbstractContextItem* Parent;
00189 
00193   vtkContextScenePrivate* Children;
00194 
00195   bool Visible;
00196 
00197 private:
00198   vtkAbstractContextItem(const vtkAbstractContextItem &); // Not implemented.
00199   void operator=(const vtkAbstractContextItem &);   // Not implemented.
00200 //ETX
00201 };
00202 
00203 #endif //__vtkContextItem_h