VTK
vtkQtChartMouseZoom.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartMouseZoom.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 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
23 
24 #ifndef _vtkQtChartMouseZoom_h
25 #define _vtkQtChartMouseZoom_h
26 
27 
28 #include "vtkQtChartExport.h"
30 
31 class vtkQtChartArea;
32 class vtkQtChartMouseZoomInternal;
33 class QCursor;
34 class QMouseEvent;
35 
36 
41 class VTKQTCHART_EXPORT vtkQtChartMouseZoom : public vtkQtChartMouseFunction
42 {
43 public:
44  enum ZoomFlags
45  {
48  ZoomYOnly
49  };
50 
51 public:
55  vtkQtChartMouseZoom(QObject *parent=0);
56  virtual ~vtkQtChartMouseZoom();
57 
59 
60  virtual void setMouseOwner(bool owns);
61 
62  virtual bool mousePressEvent(QMouseEvent *e, vtkQtChartArea *chart);
63  virtual bool mouseMoveEvent(QMouseEvent *e, vtkQtChartArea *chart);
64  virtual bool mouseReleaseEvent(QMouseEvent *e, vtkQtChartArea *chart);
65  virtual bool mouseDoubleClickEvent(QMouseEvent *e, vtkQtChartArea *chart);
66  virtual bool wheelEvent(QWheelEvent *e, vtkQtChartArea *chart);
68 
73  ZoomFlags getFlags() const {return this->Flags;}
74 
75 protected:
79  void setFlags(ZoomFlags flags) {this->Flags = flags;}
80 
81 private:
82  vtkQtChartMouseZoomInternal *Internal;
83  ZoomFlags Flags;
84 
85 private:
87  vtkQtChartMouseZoom &operator=(const vtkQtChartMouseZoom &);
88 };
89 
90 
94 class VTKQTCHART_EXPORT vtkQtChartMouseZoomX : public vtkQtChartMouseZoom
95 {
96 public:
100  vtkQtChartMouseZoomX(QObject *parent=0);
102 
103 private:
105  vtkQtChartMouseZoomX &operator=(const vtkQtChartMouseZoomX &);
106 };
107 
108 
112 class VTKQTCHART_EXPORT vtkQtChartMouseZoomY : public vtkQtChartMouseZoom
113 {
114 public:
118  vtkQtChartMouseZoomY(QObject *parent=0);
120 
121 private:
123  vtkQtChartMouseZoomY &operator=(const vtkQtChartMouseZoomY &);
124 };
125 
126 
130 class VTKQTCHART_EXPORT vtkQtChartMouseZoomBox : public vtkQtChartMouseFunction
131 {
132 public:
136  vtkQtChartMouseZoomBox(QObject *parent=0);
137  virtual ~vtkQtChartMouseZoomBox();
138 
140 
141  virtual void setMouseOwner(bool owns);
142 
143  virtual bool mousePressEvent(QMouseEvent *e, vtkQtChartArea *chart);
144  virtual bool mouseMoveEvent(QMouseEvent *e, vtkQtChartArea *chart);
145  virtual bool mouseReleaseEvent(QMouseEvent *e, vtkQtChartArea *chart);
146  virtual bool mouseDoubleClickEvent(QMouseEvent *e, vtkQtChartArea *chart);
148 
149 private:
150  QCursor *ZoomCursor;
151 
152 private:
155 };
156 
157 #endif
The vtkQtChartMouseZoom class zooms the contents in response to mouse events.
The vtkQtChartMouseFunction class is the base class for all chart mouse functions.
virtual bool mouseMoveEvent(QMouseEvent *e, vtkQtChartArea *chart)=0
Called to handle the mouse move event.
virtual bool mouseReleaseEvent(QMouseEvent *e, vtkQtChartArea *chart)=0
Called to handle the mouse release event.
ZoomFlags getFlags() const
Gets the zoom flags used during interaction.
The vtkQtChartMouseZoomBox class zooms the contents to a rectangle.
Zoom only in the x-direction.
virtual bool mousePressEvent(QMouseEvent *e, vtkQtChartArea *chart)=0
Called to handle the mouse press event.
virtual bool mouseDoubleClickEvent(QMouseEvent *e, vtkQtChartArea *chart)=0
Called to handle the double click event.
virtual void setMouseOwner(bool owns)
Sets whether or not the function owns the mouse.
virtual bool wheelEvent(QWheelEvent *e, vtkQtChartArea *chart)
Called to handle the wheel event.
The vtkQtChartMouseZoomY class zooms the contents in the y-direction.
The vtkQtChartArea class manages the chart axes and layers.
Zoom in both directions.
void setFlags(ZoomFlags flags)
Sets the zoom flags to use during interaction.
The vtkQtChartMouseZoomX class zooms the contents in the x-direction.