VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtBarChart.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 _vtkQtBarChart_h 00025 #define _vtkQtBarChart_h 00026 00027 #include "vtkQtChartExport.h" 00028 #include "vtkQtChartSeriesLayer.h" 00029 00030 class vtkQtBarChartInternal; 00031 class vtkQtBarChartOptions; 00032 class vtkQtBarChartSeriesOptions; 00033 00034 00038 class VTKQTCHART_EXPORT vtkQtBarChart : public vtkQtChartSeriesLayer 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 vtkQtBarChart(); 00044 virtual ~vtkQtBarChart(); 00045 00047 00048 virtual void setChartArea(vtkQtChartArea *area); 00049 00050 virtual void setModel(vtkQtChartSeriesModel *model); 00052 00054 00055 00056 00057 00058 00059 vtkQtBarChartOptions *getOptions() const {return this->Options;} 00060 00068 void setOptions(const vtkQtBarChartOptions &options); 00069 00070 virtual QPixmap getSeriesIcon(int series) const; 00072 00074 00075 virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const; 00076 00077 virtual void layoutChart(const QRectF &area); 00078 00079 virtual bool getHelpText(const QPointF &point, QString &text); 00080 00086 virtual void finishInteractiveResize(); 00088 00090 00091 virtual void getSeriesAt(const QPointF &point, 00092 vtkQtChartSeriesSelection &selection) const; 00093 00094 virtual void getPointsAt(const QPointF &point, 00095 vtkQtChartSeriesSelection &selection) const; 00096 00097 virtual void getSeriesIn(const QRectF &area, 00098 vtkQtChartSeriesSelection &selection) const; 00099 00100 virtual void getPointsIn(const QRectF &area, 00101 vtkQtChartSeriesSelection &selection) const; 00103 00105 00106 virtual QRectF boundingRect() const; 00107 00108 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 00109 QWidget *widget=0); 00111 00112 public slots: 00118 void reset(); 00119 00120 private slots: 00125 void prepareSeriesInsert(int first, int last); 00126 00131 void insertSeries(int first, int last); 00132 00137 void startSeriesRemoval(int first, int last); 00138 00143 void finishSeriesRemoval(int first, int last); 00144 00146 void handleAxesCornerChange(); 00147 00149 void handleOutlineChange(); 00150 00155 void updateHighlights(); 00156 00157 protected slots: 00165 virtual void handleOptionsChanged(vtkQtChartSeriesOptions*, 00166 int type, const QVariant& newvalue, const QVariant& oldvalue); 00167 00168 private: 00175 void handleSeriesVisibilityChange(vtkQtChartSeriesOptions* options, bool visible); 00176 00183 bool addSeriesDomain(int series, int &seriesGroup); 00184 00188 void calculateDomain(int seriesGroup); 00189 00193 void createBarList(int seriesGroup); 00194 00198 void buildBarTree(int seriesGroup); 00199 00200 private: 00201 vtkQtBarChartInternal *Internal; 00202 vtkQtBarChartOptions *Options; 00203 bool InModelChange; 00204 bool BuildNeeded; 00205 00206 private: 00207 vtkQtBarChart(const vtkQtBarChart &); 00208 vtkQtBarChart &operator=(const vtkQtBarChart &); 00209 }; 00210 00211 #endif