VTK
vtkContextTransform.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 
28 #ifndef vtkContextTransform_h
29 #define vtkContextTransform_h
30 
31 #include "vtkRenderingContext2DModule.h" // For export macro
32 #include "vtkAbstractContextItem.h"
33 #include "vtkSmartPointer.h" // Needed for SP ivars.
34 #include "vtkVector.h" // Needed for ivars.
35 
36 class vtkTransform2D;
37 
39 {
40 public:
42  virtual void PrintSelf(ostream &os, vtkIndent indent);
43 
45  static vtkContextTransform *New();
46 
50  virtual void Update();
51 
53  virtual bool Paint(vtkContext2D *painter);
54 
56  virtual void Identity();
57 
60  virtual void Translate(float dx, float dy);
61 
64  virtual void Scale(float dx, float dy);
65 
67  virtual void Rotate(float angle);
68 
70  virtual vtkTransform2D* GetTransform();
71 
73  virtual vtkVector2f MapToParent(const vtkVector2f& point);
74 
77 
79 
81  vtkSetMacro(PanMouseButton, int);
82  vtkGetMacro(PanMouseButton, int);
84 
86 
88  vtkSetMacro(PanModifier, int);
89  vtkGetMacro(PanModifier, int);
91 
93 
95  vtkSetMacro(SecondaryPanMouseButton, int);
96  vtkGetMacro(SecondaryPanMouseButton, int);
98 
100 
102  vtkSetMacro(SecondaryPanModifier, int);
103  vtkGetMacro(SecondaryPanModifier, int);
105 
107 
109  vtkSetMacro(ZoomMouseButton, int);
110  vtkGetMacro(ZoomMouseButton, int);
112 
114 
116  vtkSetMacro(ZoomModifier, int);
117  vtkGetMacro(ZoomModifier, int);
119 
121 
123  vtkSetMacro(SecondaryZoomMouseButton, int);
124  vtkGetMacro(SecondaryZoomMouseButton, int);
126 
128 
130  vtkSetMacro(SecondaryZoomModifier, int);
131  vtkGetMacro(SecondaryZoomModifier, int);
133 
135 
136  vtkSetMacro(ZoomOnMouseWheel, bool);
137  vtkGetMacro(ZoomOnMouseWheel, bool);
138  vtkBooleanMacro(ZoomOnMouseWheel, bool);
140 
142 
143  vtkSetMacro(PanYOnMouseWheel, bool);
144  vtkGetMacro(PanYOnMouseWheel, bool);
145  vtkBooleanMacro(PanYOnMouseWheel, bool);
147 
148 //BTX
150  virtual bool Hit(const vtkContextMouseEvent &mouse);
151 
153  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
154 
157  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
158 
160 
162  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
163 //ETX
165 
166 //BTX
167 protected:
170 
172 
181 
184 
186 
187 private:
188  vtkContextTransform(const vtkContextTransform &); // Not implemented.
189  void operator=(const vtkContextTransform &); // Not implemented.
190 //ETX
191 };
192 
193 #endif //vtkContextTransform_h
virtual vtkVector2f MapFromParent(const vtkVector2f &point)
virtual vtkVector2f MapToParent(const vtkVector2f &point)
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
virtual bool Paint(vtkContext2D *painter)
all children of this item are transformed by the vtkTransform2D of this item.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
#define VTKRENDERINGCONTEXT2D_EXPORT
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkSmartPointer< vtkTransform2D > Transform
describes linear transformations via a 3x3 matrix
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
base class for items that are part of a vtkContextScene.
virtual bool Hit(const vtkContextMouseEvent &mouse)
static vtkObject * New()
virtual void Update()
virtual void PrintSelf(ostream &os, vtkIndent indent)