VTK
vtkAbstractContextItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextItem.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 
26 #ifndef __vtkAbstractContextItem_h
27 #define __vtkAbstractContextItem_h
28 
29 #include "vtkObject.h"
30 
31 class vtkContext2D;
33 class vtkContextKeyEvent;
34 class vtkContextScene;
36 class vtkVector2f;
37 
39 {
40 public:
42  virtual void PrintSelf(ostream &os, vtkIndent indent);
43 
47  virtual void Update();
48 
50  virtual bool Paint(vtkContext2D *painter);
51 
54  bool PaintChildren(vtkContext2D *painter);
55 
58  virtual void ReleaseGraphicsResources();
59 
62  unsigned int AddItem(vtkAbstractContextItem* item);
63 
67  bool RemoveItem(vtkAbstractContextItem* item);
68 
72  bool RemoveItem(unsigned int index);
73 
76  vtkAbstractContextItem* GetItem(unsigned int index);
77 
79  unsigned int GetNumberOfItems();
80 
82  void ClearItems();
83 
84 //BTX
86  virtual bool Hit(const vtkContextMouseEvent &mouse);
87 
90  virtual vtkAbstractContextItem* GetPickedItem(const vtkContextMouseEvent &mouse);
91 
94  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
95 
98  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
99 
102  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
103 
106  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
107 
110  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
111 
114  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
115 
119  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
120 
122  virtual bool KeyPressEvent(const vtkContextKeyEvent &key);
123 
125 
126  virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key);
127 //ETX
129 
132  virtual void SetScene(vtkContextScene *scene);
133 
135 
137  vtkContextScene* GetScene()
138  {
139  return this->Scene;
140  }
142 
145  virtual void SetParent(vtkAbstractContextItem *parent);
146 
148 
151  {
152  return this->Parent;
153  }
155 
157  virtual vtkVector2f MapToParent(const vtkVector2f& point);
158 
160  virtual vtkVector2f MapFromParent(const vtkVector2f& point);
161 
163  virtual vtkVector2f MapToScene(const vtkVector2f& point);
164 
166  virtual vtkVector2f MapFromScene(const vtkVector2f& point);
167 
169 
170  vtkGetMacro(Visible, bool);
172 
174 
176  vtkSetMacro(Visible, bool);
178 
179 //BTX
180 protected:
183 
186 
189 
194 
195  bool Visible;
196 
197 private:
198  vtkAbstractContextItem(const vtkAbstractContextItem &); // Not implemented.
199  void operator=(const vtkAbstractContextItem &); // Not implemented.
200 //ETX
201 };
202 
203 #endif //__vtkContextItem_h