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 "vtkRenderingContext2DModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkContext2D;
34 class vtkContextKeyEvent;
35 class vtkContextScene;
37 class vtkVector2f;
38 
40 {
41 public:
43  virtual void PrintSelf(ostream &os, vtkIndent indent);
44 
48  virtual void Update();
49 
51  virtual bool Paint(vtkContext2D *painter);
52 
55  virtual bool PaintChildren(vtkContext2D *painter);
56 
59  virtual void ReleaseGraphicsResources();
60 
63  unsigned int AddItem(vtkAbstractContextItem* item);
64 
68  bool RemoveItem(vtkAbstractContextItem* item);
69 
73  bool RemoveItem(unsigned int index);
74 
77  vtkAbstractContextItem* GetItem(unsigned int index);
78 
80  unsigned int GetNumberOfItems();
81 
83  void ClearItems();
84 
85 //BTX
87  virtual bool Hit(const vtkContextMouseEvent &mouse);
88 
91  virtual vtkAbstractContextItem* GetPickedItem(const vtkContextMouseEvent &mouse);
92 
95  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
96 
99  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
100 
103  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
104 
107  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
108 
111  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
112 
115  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
116 
120  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
121 
123  virtual bool KeyPressEvent(const vtkContextKeyEvent &key);
124 
126 
127  virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key);
128 //ETX
130 
133  virtual void SetScene(vtkContextScene *scene);
134 
136 
139  {
140  return this->Scene;
141  }
143 
146  virtual void SetParent(vtkAbstractContextItem *parent);
147 
149 
152  {
153  return this->Parent;
154  }
156 
158  virtual vtkVector2f MapToParent(const vtkVector2f& point);
159 
161  virtual vtkVector2f MapFromParent(const vtkVector2f& point);
162 
164  virtual vtkVector2f MapToScene(const vtkVector2f& point);
165 
167  virtual vtkVector2f MapFromScene(const vtkVector2f& point);
168 
170 
171  vtkGetMacro(Visible, bool);
173 
175 
177  vtkSetMacro(Visible, bool);
179 
181 
182  vtkGetMacro(Interactive, bool);
184 
186 
187  vtkSetMacro(Interactive, bool);
189 
190 //BTX
191 protected:
194 
197 
200 
205 
207  bool Visible;
208 
212 
213 private:
214  vtkAbstractContextItem(const vtkAbstractContextItem &); // Not implemented.
215  void operator=(const vtkAbstractContextItem &); // Not implemented.
216 //ETX
217 };
218 
219 #endif //__vtkContextItem_h
data structure to represent key events.
abstract base class for most VTK objects
Definition: vtkObject.h:61
GLuint index
Definition: vtkgl.h:11983
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
Private implementation for scene/items.
vtkContextScene * GetScene()
virtual void Update()
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTKRENDERINGCONTEXT2D_EXPORT
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkAbstractContextItem * Parent
base class for items that are part of a vtkContextScene.
vtkContextScenePrivate * Children
vtkAbstractContextItem * GetParent()
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69