VTK
dox/GUISupport/Qt/Chart/vtkQtChartArea.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtChartArea.h
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 _vtkQtChartArea_h
00025 #define _vtkQtChartArea_h
00026 
00027 #include "vtkQtChartExport.h"
00028 #include <QGraphicsView>
00029 
00030 class vtkQtChartAreaInternal;
00031 class vtkQtChartAxisLayer;
00032 class vtkQtChartContentsSpace;
00033 class vtkQtChartInteractor;
00034 class vtkQtChartLayer;
00035 class vtkQtChartMouseBox;
00036 class vtkQtChartStyleManager;
00037 class QCursor;
00038 class QString;
00039 
00040 
00044 class VTKQTCHART_EXPORT vtkQtChartArea : public QGraphicsView
00045 {
00046   Q_OBJECT
00047 
00048 public:
00052   vtkQtChartArea(QWidget *parent=0);
00053   virtual ~vtkQtChartArea();
00054 
00056 
00057 
00058 
00059 
00060 
00061   void addLayer(vtkQtChartLayer *chart);
00062 
00081   void insertLayer(int index, vtkQtChartLayer *chart);
00082 
00086   void removeLayer(vtkQtChartLayer *chart);
00087 
00092   int getNumberOfLayers() const;
00093 
00099   vtkQtChartLayer *getLayer(int index) const;
00100 
00106   vtkQtChartLayer *getLayer(const QString &chartName) const;
00107 
00112   vtkQtChartAxisLayer *getAxisLayer() const;
00113 
00118   int getAxisLayerIndex() const;
00119 
00124   int getGridLayerIndex() const;
00126 
00128 
00129 
00130 
00131 
00132 
00133   vtkQtChartInteractor *getInteractor() const;
00134 
00142   void setInteractor(vtkQtChartInteractor *interactor);
00143 
00148   vtkQtChartContentsSpace *getContentsSpace() const;
00149 
00154   vtkQtChartMouseBox *getMouseBox() const;
00155 
00161   void startInteractiveResize();
00162 
00167   bool isInteractivelyResizing() const;
00168 
00170   void finishInteractiveResize();
00172 
00174 
00175 
00176 
00177 
00178 
00179   vtkQtChartStyleManager *getStyleManager() const;
00180 
00184   void setStyleManager(vtkQtChartStyleManager *manager);
00186 
00189   void setUseOpenGLIfAvailable(bool useOpenGL);
00190 
00191 public slots:
00193   void layoutChart();
00194 
00196   void updateLayout();
00197 
00198 signals:
00200   void delayedLayoutNeeded();
00201 
00206   void layerInserted(int index, vtkQtChartLayer *chart);
00207 
00212   void removingLayer(int index, vtkQtChartLayer *chart);
00213 
00218   void layerRemoved(int index, vtkQtChartLayer *chart);
00219 
00220 protected:
00226   virtual bool viewportEvent(QEvent *e);
00227 
00231   virtual void resizeEvent(QResizeEvent *e);
00232 
00234 
00235 
00236 
00237 
00238 
00239 
00240 
00241 
00242   virtual void keyPressEvent(QKeyEvent *e);
00243 
00247   virtual void mousePressEvent(QMouseEvent *e);
00248 
00252   virtual void mouseMoveEvent(QMouseEvent *e);
00253 
00257   virtual void mouseReleaseEvent(QMouseEvent *e);
00258 
00262   virtual void mouseDoubleClickEvent(QMouseEvent *e);
00263 
00267   virtual void wheelEvent(QWheelEvent *e);
00269 
00270 private slots:
00272   void handleZoomChange();
00273 
00277   void changeCursor(const QCursor &newCursor);
00278 
00279 private:
00280   vtkQtChartAreaInternal *Internal; 
00281 
00282 private:
00283   vtkQtChartArea(const vtkQtChartArea &);
00284   vtkQtChartArea &operator=(const vtkQtChartArea &);
00285 };
00286 
00287 #endif