VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkQtBarChart.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 _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 00075 vtkQtBarChartSeriesOptions *getBarSeriesOptions(int series) const; 00076 00077 virtual QPixmap getSeriesIcon(int series) const; 00079 00081 00082 virtual void getLayerDomain(vtkQtChartLayerDomain &domain) const; 00083 00084 virtual void layoutChart(const QRectF &area); 00085 00086 virtual bool getHelpText(const QPointF &point, QString &text); 00087 00093 virtual void finishInteractiveResize(); 00095 00097 00098 virtual void getSeriesAt(const QPointF &point, 00099 vtkQtChartSeriesSelection &selection) const; 00100 00101 virtual void getPointsAt(const QPointF &point, 00102 vtkQtChartSeriesSelection &selection) const; 00103 00104 virtual void getSeriesIn(const QRectF &area, 00105 vtkQtChartSeriesSelection &selection) const; 00106 00107 virtual void getPointsIn(const QRectF &area, 00108 vtkQtChartSeriesSelection &selection) const; 00110 00112 00113 virtual QRectF boundingRect() const; 00114 00115 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 00116 QWidget *widget=0); 00118 00119 public slots: 00125 void reset(); 00126 00127 protected: 00133 virtual vtkQtChartSeriesOptions *createOptions(QObject *parent); 00134 00138 virtual void setupOptions(vtkQtChartSeriesOptions *options); 00139 00140 private slots: 00145 void prepareSeriesInsert(int first, int last); 00146 00151 void insertSeries(int first, int last); 00152 00157 void startSeriesRemoval(int first, int last); 00158 00163 void finishSeriesRemoval(int first, int last); 00164 00166 void handleAxesCornerChange(); 00167 00169 void handleOutlineChange(); 00170 00177 void handleSeriesVisibilityChange(bool visible); 00178 00182 void handleSeriesPenChange(const QPen &pen); 00183 00187 void handleSeriesBrushChange(const QBrush &brush); 00188 00193 void updateHighlights(); 00194 00195 private: 00202 bool addSeriesDomain(int series, int &seriesGroup); 00203 00207 void calculateDomain(int seriesGroup); 00208 00212 void createBarList(int seriesGroup); 00213 00217 void buildBarTree(int seriesGroup); 00218 00219 private: 00220 vtkQtBarChartInternal *Internal; 00221 vtkQtBarChartOptions *Options; 00222 bool InModelChange; 00223 bool BuildNeeded; 00224 00225 private: 00226 vtkQtBarChart(const vtkQtBarChart &); 00227 vtkQtBarChart &operator=(const vtkQtBarChart &); 00228 }; 00229 00230 #endif