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 
29 #ifndef vtkContextTransform_h
30 #define vtkContextTransform_h
31 
32 #include "vtkRenderingContext2DModule.h" // For export macro
33 #include "vtkAbstractContextItem.h"
34 #include "vtkSmartPointer.h" // Needed for SP ivars.
35 #include "vtkVector.h" // Needed for ivars.
36 
37 class vtkTransform2D;
38 
39 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextTransform : public vtkAbstractContextItem
40 {
41 public:
43  virtual void PrintSelf(ostream &os, vtkIndent indent);
44 
49 
55  virtual void Update();
56 
60  virtual bool Paint(vtkContext2D *painter);
61 
65  virtual void Identity();
66 
71  virtual void Translate(float dx, float dy);
72 
77  virtual void Scale(float dx, float dy);
78 
82  virtual void Rotate(float angle);
83 
88 
93 
98 
100 
104  vtkSetMacro(PanMouseButton, int);
105  vtkGetMacro(PanMouseButton, int);
107 
109 
113  vtkSetMacro(PanModifier, int);
114  vtkGetMacro(PanModifier, int);
116 
118 
122  vtkSetMacro(SecondaryPanMouseButton, int);
123  vtkGetMacro(SecondaryPanMouseButton, int);
125 
127 
131  vtkSetMacro(SecondaryPanModifier, int);
132  vtkGetMacro(SecondaryPanModifier, int);
134 
136 
140  vtkSetMacro(ZoomMouseButton, int);
141  vtkGetMacro(ZoomMouseButton, int);
143 
145 
149  vtkSetMacro(ZoomModifier, int);
150  vtkGetMacro(ZoomModifier, int);
152 
154 
158  vtkSetMacro(SecondaryZoomMouseButton, int);
159  vtkGetMacro(SecondaryZoomMouseButton, int);
161 
163 
167  vtkSetMacro(SecondaryZoomModifier, int);
168  vtkGetMacro(SecondaryZoomModifier, int);
170 
172 
175  vtkSetMacro(ZoomOnMouseWheel, bool);
176  vtkGetMacro(ZoomOnMouseWheel, bool);
177  vtkBooleanMacro(ZoomOnMouseWheel, bool);
179 
181 
184  vtkSetMacro(PanYOnMouseWheel, bool);
185  vtkGetMacro(PanYOnMouseWheel, bool);
186  vtkBooleanMacro(PanYOnMouseWheel, bool);
188 
192  virtual bool Hit(const vtkContextMouseEvent &mouse);
193 
197  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
198 
202  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
203 
207  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
208 
209 protected:
212 
214 
223 
226 
228 
229 private:
230  vtkContextTransform(const vtkContextTransform &) VTK_DELETE_FUNCTION;
231  void operator=(const vtkContextTransform &) VTK_DELETE_FUNCTION;
232 
233 };
234 
235 #endif //vtkContextTransform_h
base class for items that are part of a vtkContextScene.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
data structure to represent mouse events.
all children of this item are transformed by the vtkTransform2D of this item.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
virtual vtkVector2f MapFromParent(const vtkVector2f &point)
Transforms a point from the parent coordinate system.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
virtual void Identity()
Reset the transform to the identity transformation.
virtual vtkTransform2D * GetTransform()
Access the vtkTransform2D that controls object transformation.
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual void Translate(float dx, float dy)
Translate the item by the specified amounts dx and dy in the x and y directions.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse press event.
static vtkContextTransform * New()
Creates a vtkContextTransform object.
virtual vtkVector2f MapToParent(const vtkVector2f &point)
Transforms a point to the parent coordinate system.
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void Scale(float dx, float dy)
Scale the item by the specified amounts dx and dy in the x and y directions.
vtkSmartPointer< vtkTransform2D > Transform
virtual void Rotate(float angle)
Rotate the item by the specified angle.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Returns true if the transform is interactive, false otherwise.
a simple class to control print indentation
Definition: vtkIndent.h:40
describes linear transformations via a 3x3 matrix
@ point
Definition: vtkX3D.h:236
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.