VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkQtChartInteractor.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00020 00023 00024 #ifndef _vtkQtChartInteractor_h 00025 #define _vtkQtChartInteractor_h 00026 00027 00028 #include "vtkQtChartExport.h" 00029 #include <QObject> 00030 00031 class vtkQtChartArea; 00032 class vtkQtChartContentsSpace; 00033 class vtkQtChartInteractorInternal; 00034 class vtkQtChartInteractorModeList; 00035 class vtkQtChartMouseBox; 00036 class vtkQtChartMouseFunction; 00037 class QCursor; 00038 class QKeyEvent; 00039 class QMouseEvent; 00040 class QRect; 00041 class QWheelEvent; 00042 00043 00072 class VTKQTCHART_EXPORT vtkQtChartInteractor : public QObject 00073 { 00074 Q_OBJECT 00075 00076 public: 00080 vtkQtChartInteractor(QObject *parent=0); 00081 virtual ~vtkQtChartInteractor(); 00082 00084 00085 00086 00087 00088 00089 vtkQtChartArea *getChartArea() const {return this->ChartArea;} 00090 00094 void setChartArea(vtkQtChartArea *area) {this->ChartArea = area;} 00096 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 void setFunction(Qt::MouseButton button, vtkQtChartMouseFunction *function, 00110 Qt::KeyboardModifiers modifiers=Qt::NoModifier); 00111 00117 void setWheelFunction(vtkQtChartMouseFunction *function, 00118 Qt::KeyboardModifiers modifiers=Qt::NoModifier); 00119 00131 void addFunction(Qt::MouseButton button, vtkQtChartMouseFunction *function, 00132 Qt::KeyboardModifiers modifiers=Qt::NoModifier); 00133 00139 void addWheelFunction(vtkQtChartMouseFunction *function, 00140 Qt::KeyboardModifiers modifiers=Qt::NoModifier); 00141 00145 void removeFunction(vtkQtChartMouseFunction *function); 00146 00150 void removeFunctions(Qt::MouseButton button); 00151 00153 void removeWheelFunctions(); 00154 00156 void removeAllFunctions(); 00157 00163 int getNumberOfModes(Qt::MouseButton button) const; 00164 00170 int getMode(Qt::MouseButton button) const; 00171 00176 void setMode(Qt::MouseButton button, int index); 00177 00182 int getNumberOfWheelModes() const; 00183 00188 int getWheelMode() const; 00189 00193 void setWheelMode(int index); 00195 00197 00198 00199 00200 00201 virtual bool keyPressEvent(QKeyEvent *e); 00202 00211 virtual void mousePressEvent(QMouseEvent *e); 00212 00216 virtual void mouseMoveEvent(QMouseEvent *e); 00217 00221 virtual void mouseReleaseEvent(QMouseEvent *e); 00222 00226 virtual void mouseDoubleClickEvent(QMouseEvent *e); 00227 00231 virtual void wheelEvent(QWheelEvent *e); 00233 00234 signals: 00238 void cursorChangeRequested(const QCursor &cursor); 00239 00240 private slots: 00247 void beginState(vtkQtChartMouseFunction *owner); 00248 00255 void endState(vtkQtChartMouseFunction *owner); 00256 00257 private: 00264 void addFunction(vtkQtChartInteractorModeList *list, 00265 vtkQtChartMouseFunction *function, Qt::KeyboardModifiers modifiers); 00266 00270 void removeFunctions(vtkQtChartInteractorModeList *list); 00271 00272 private: 00274 vtkQtChartInteractorInternal *Internal; 00275 vtkQtChartArea *ChartArea; 00276 Qt::KeyboardModifier XModifier; 00277 Qt::KeyboardModifier YModifier; 00278 }; 00279 00280 #endif