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 
81  unsigned int GetItemIndex(vtkAbstractContextItem* item);
82 
84  unsigned int GetNumberOfItems();
85 
87  void ClearItems();
88 
91  unsigned int Raise(unsigned int index);
92 
94 
97  virtual unsigned int StackAbove(unsigned int index,
98  unsigned int under);
100 
103  unsigned int Lower(unsigned int index);
104 
106 
109  virtual unsigned int StackUnder(unsigned int child,
110  unsigned int above);
112 
113 //BTX
115  virtual bool Hit(const vtkContextMouseEvent &mouse);
116 
119  virtual vtkAbstractContextItem* GetPickedItem(const vtkContextMouseEvent &mouse);
120 
123  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
124 
127  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
128 
131  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
132 
135  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
136 
139  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
140 
143  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
144 
148  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
149 
151  virtual bool KeyPressEvent(const vtkContextKeyEvent &key);
152 
154 
155  virtual bool KeyReleaseEvent(const vtkContextKeyEvent &key);
156 //ETX
158 
161  virtual void SetScene(vtkContextScene *scene);
162 
164 
167  {
168  return this->Scene;
169  }
171 
174  virtual void SetParent(vtkAbstractContextItem *parent);
175 
177 
180  {
181  return this->Parent;
182  }
184 
186  virtual vtkVector2f MapToParent(const vtkVector2f& point);
187 
189  virtual vtkVector2f MapFromParent(const vtkVector2f& point);
190 
192  virtual vtkVector2f MapToScene(const vtkVector2f& point);
193 
195  virtual vtkVector2f MapFromScene(const vtkVector2f& point);
196 
198 
199  vtkGetMacro(Visible, bool);
201 
203 
205  vtkSetMacro(Visible, bool);
207 
209 
210  vtkGetMacro(Interactive, bool);
212 
214 
215  vtkSetMacro(Interactive, bool);
217 
218 //BTX
219 protected:
222 
225 
228 
233 
235  bool Visible;
236 
240 
241 private:
242  vtkAbstractContextItem(const vtkAbstractContextItem &); // Not implemented.
243  void operator=(const vtkAbstractContextItem &); // Not implemented.
244 //ETX
245 };
246 
247 #endif //vtkContextItem_h
data structure to represent key events.
abstract base class for most VTK objects
Definition: vtkObject.h:61
Private implementation for scene/items.
vtkContextScene * GetScene()
virtual void Update()
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()