00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtChartWidget.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 _vtkQtChartWidget_h 00025 #define _vtkQtChartWidget_h 00026 00027 00028 #include "vtkQtChartExport.h" 00029 #include <QWidget> 00030 #include "vtkQtChartAxis.h" // Needed for enum 00031 00032 class vtkQtChartLegend; 00033 class vtkQtChartTitle; 00034 class vtkQtChartArea; 00035 class QGridLayout; 00036 class QHBoxLayout; 00037 class QPrinter; 00038 class QString; 00039 class QStringList; 00040 class QVBoxLayout; 00041 00042 00043 00055 class VTKQTCHART_EXPORT vtkQtChartWidget : public QWidget 00056 { 00057 Q_OBJECT 00058 00059 public: 00063 vtkQtChartWidget(QWidget *parent=0); 00064 virtual ~vtkQtChartWidget(); 00065 00070 vtkQtChartTitle *getTitle() const {return this->Title;} 00071 00075 void setTitle(vtkQtChartTitle *title); 00076 00081 vtkQtChartLegend *getLegend() const {return this->Legend;} 00082 00086 void setLegend(vtkQtChartLegend *legend); 00087 00092 vtkQtChartArea *getChartArea() const {return this->Charts;} 00093 00099 vtkQtChartTitle *getAxisTitle(vtkQtChartAxis::AxisLocation axis) const; 00100 00105 void setAxisTitle(vtkQtChartAxis::AxisLocation axis, vtkQtChartTitle *title); 00106 00111 virtual QSize sizeHint() const; 00112 00113 public slots: 00117 void printChart(QPrinter &printer); 00118 00122 void saveChart(const QStringList &files); 00123 00127 void saveChart(const QString &filename); 00128 00129 signals: 00133 void newChartTitle(vtkQtChartTitle *title); 00134 00138 void newChartLegend(vtkQtChartLegend *legend); 00139 00144 void newAxisTitle(vtkQtChartAxis::AxisLocation axis, vtkQtChartTitle *title); 00145 00146 private slots: 00148 void changeLegendLocation(); 00149 00150 private: 00151 vtkQtChartTitle *Title; 00152 vtkQtChartLegend *Legend; 00153 vtkQtChartArea *Charts; 00154 vtkQtChartTitle *LeftTitle; 00155 vtkQtChartTitle *TopTitle; 00156 vtkQtChartTitle *RightTitle; 00157 vtkQtChartTitle *BottomTitle; 00158 QVBoxLayout *TitleLayout; 00159 QGridLayout *LegendLayout; 00160 QVBoxLayout *TopLayout; 00161 QHBoxLayout *ChartLayout; 00162 }; 00163 00164 #endif