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 vtkContextScene;
35 class vtkVector2f;
36 
38 {
39 public:
41  virtual void PrintSelf(ostream &os, vtkIndent indent);
42 
46  virtual void Update();
47 
49  virtual bool Paint(vtkContext2D *painter);
50 
53  bool PaintChildren(vtkContext2D *painter);
54 
57  virtual void ReleaseGraphicsResources();
58 
61  unsigned int AddItem(vtkAbstractContextItem* item);
62 
66  bool RemoveItem(vtkAbstractContextItem* item);
67 
71  bool RemoveItem(unsigned int index);
72 
75  vtkAbstractContextItem* GetItem(unsigned int index);
76 
78  unsigned int GetNumberOfItems();
79 
81  void ClearItems();
82 
83 //BTX
85  virtual bool Hit(const vtkContextMouseEvent &mouse);
86 
89  virtual vtkAbstractContextItem* GetPickedItem(const vtkContextMouseEvent &mouse);
90 
93  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
94 
97  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
98 
101  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
102 
105  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
106 
109  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
110 
113  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse);
114 
116 
119  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
120 //ETX
122 
125  virtual void SetScene(vtkContextScene *scene);
126 
128 
131  {
132  return this->Scene;
133  }
135 
138  virtual void SetParent(vtkAbstractContextItem *parent);
139 
141 
144  {
145  return this->Parent;
146  }
148 
150  virtual vtkVector2f MapToParent(const vtkVector2f& point);
151 
153  virtual vtkVector2f MapFromParent(const vtkVector2f& point);
154 
156  virtual vtkVector2f MapToScene(const vtkVector2f& point);
157 
159  virtual vtkVector2f MapFromScene(const vtkVector2f& point);
160 
162 
163  vtkGetMacro(Visible, bool);
165 
167 
169  vtkSetMacro(Visible, bool);
171 
172 //BTX
173 protected:
176 
179 
182 
187 
188  bool Visible;
189 
190 private:
191  vtkAbstractContextItem(const vtkAbstractContextItem &); // Not implemented.
192  void operator=(const vtkAbstractContextItem &); // Not implemented.
193 //ETX
194 };
195 
196 #endif //__vtkContextItem_h
#define VTK_CHARTS_EXPORT
abstract base class for most VTK objects
Definition: vtkObject.h:60
Private implementation for scene/items.
vtkContextScene * GetScene()
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
virtual void PrintSelf(ostream &os, vtkIndent indent)
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkAbstractContextItem * Parent
base class for items that are part of a vtkContextScene.
vtkContextScenePrivate * Children
vtkAbstractContextItem * GetParent()