VTK
dox/GUISupport/Qt/Chart/vtkQtStackedChart.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtStackedChart.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 _vtkQtChartStackedLayer_h
00025 #define _vtkQtChartStackedLayer_h
00026 
00027 #include "vtkQtChartExport.h"
00028 #include "vtkQtChartSeriesLayer.h"
00029 
00030 class vtkQtStackedChartInternal;
00031 class vtkQtStackedChartOptions;
00032 
00033 
00037 class VTKQTCHART_EXPORT vtkQtStackedChart : public vtkQtChartSeriesLayer
00038 {
00039   Q_OBJECT
00040 
00041 public:
00042   vtkQtStackedChart();
00043   virtual ~vtkQtStackedChart();
00044 
00046 
00047   virtual void setChartArea(vtkQtChartArea *area);
00048 
00049   virtual void setModel(vtkQtChartSeriesModel *model);
00051 
00053 
00054 
00055 
00056 
00057 
00058   vtkQtStackedChartOptions *getOptions() const {return this->Options;}
00059 
00067   void setOptions(const vtkQtStackedChartOptions &options);
00068 
00069   virtual QPixmap getSeriesIcon(int series) const;
00071 
00073 
00074   virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const;
00075 
00076   virtual void layoutChart(const QRectF &area);
00077 
00078   virtual bool getHelpText(const QPointF &point, QString &text);
00079 
00085   virtual void finishInteractiveResize();
00087 
00089 
00090   virtual void getSeriesAt(const QPointF &point,
00091       vtkQtChartSeriesSelection &selection) const;
00092 
00093   virtual void getPointsAt(const QPointF &point,
00094       vtkQtChartSeriesSelection &selection) const;
00095 
00096   virtual void getSeriesIn(const QRectF &area,
00097       vtkQtChartSeriesSelection &selection) const;
00098 
00099   virtual void getPointsIn(const QRectF &area,
00100       vtkQtChartSeriesSelection &selection) const;
00102 
00104 
00105   virtual QRectF boundingRect() const;
00106   virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
00107     QWidget *widget=0);
00109 
00110 public slots:
00116   void reset();
00117 
00118 protected slots:
00126   virtual void handleOptionsChanged(vtkQtChartSeriesOptions*,
00127     int type, const QVariant& newvalue, const QVariant& oldvalue);
00128 
00129 private slots:
00134   void prepareSeriesInsert(int first, int last);
00135 
00140   void insertSeries(int first, int last);
00141 
00146   void startSeriesRemoval(int first, int last);
00147 
00152   void finishSeriesRemoval(int first, int last);
00153 
00155   void handleAxesCornerChange();
00156 
00158   void handleSumationChange();
00159 
00161   void handleGradientChange();
00162 
00167   void updateHighlights();
00168 
00170   void seriesVisibilityAnimate(qreal time);
00171 
00173   void seriesVisibilityAnimateFinished();
00174 
00175 private:
00183   void handleSeriesVisibilityChange(
00184     vtkQtChartSeriesOptions* options, bool visible);
00185 
00187   void layoutHighlights();
00188 
00193   void addSeriesDomain(int series, int *seriesGroup);
00194 
00198   void updateItemMap(int seriesGroup);
00199 
00203   void createTable(int seriesGroup);
00204 
00208   void normalizeTable(int seriesGroup);
00209 
00213   void calculateXDomain(int seriesGroup);
00214 
00218   void calculateYDomain(int seriesGroup);
00219 
00223   void createQuadTable(int seriesGroup);
00224 
00228   void buildQuadTree(int seriesGroup);
00229 
00230 private:
00231   vtkQtStackedChartInternal *Internal; 
00232   vtkQtStackedChartOptions *Options;   
00233   bool InModelChange;                  
00234   bool BuildNeeded;                    
00235 };
00236 
00237 #endif