VTK
vtkQtChartWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
23 
24 #ifndef _vtkQtChartWidget_h
25 #define _vtkQtChartWidget_h
26 
27 
28 #include "vtkQtChartExport.h"
29 #include <QWidget>
30 #include "vtkQtChartAxis.h" // Needed for enum
31 
32 class vtkQtChartLegend;
33 class vtkQtChartTitle;
34 class vtkQtChartArea;
35 class QGridLayout;
36 class QHBoxLayout;
37 class QPrinter;
38 class QString;
39 class QStringList;
40 class QVBoxLayout;
41 
42 
43 
55 class VTKQTCHART_EXPORT vtkQtChartWidget : public QWidget
56 {
57  Q_OBJECT
58 
59 public:
63  vtkQtChartWidget(QWidget *parent=0);
64  virtual ~vtkQtChartWidget();
65 
70  vtkQtChartTitle *getTitle() const {return this->Title;}
71 
75  void setTitle(vtkQtChartTitle *title);
76 
81  vtkQtChartLegend *getLegend() const {return this->Legend;}
82 
86  void setLegend(vtkQtChartLegend *legend);
87 
92  vtkQtChartArea *getChartArea() const {return this->Charts;}
93 
99  vtkQtChartTitle *getAxisTitle(vtkQtChartAxis::AxisLocation axis) const;
100 
105  void setAxisTitle(vtkQtChartAxis::AxisLocation axis, vtkQtChartTitle *title);
106 
111  virtual QSize sizeHint() const;
112 
113 public slots:
117  void printChart(QPrinter &printer);
118 
122  void saveChart(const QStringList &files);
123 
127  void saveChart(const QString &filename);
128 
129 signals:
133  void newChartTitle(vtkQtChartTitle *title);
134 
138  void newChartLegend(vtkQtChartLegend *legend);
139 
144  void newAxisTitle(vtkQtChartAxis::AxisLocation axis, vtkQtChartTitle *title);
145 
146 private slots:
148  void changeLegendLocation();
149 
150 private:
151  vtkQtChartTitle *Title;
152  vtkQtChartLegend *Legend;
153  vtkQtChartArea *Charts;
154  vtkQtChartTitle *LeftTitle;
155  vtkQtChartTitle *TopTitle;
156  vtkQtChartTitle *RightTitle;
157  vtkQtChartTitle *BottomTitle;
158  QVBoxLayout *TitleLayout;
159  QGridLayout *LegendLayout;
160  QVBoxLayout *TopLayout;
161  QHBoxLayout *ChartLayout;
162 };
163 
164 #endif
The vtkQtChartTitle class is used to draw a chart title.
vtkQtChartLegend * getLegend() const
Gets the chart legend.
vtkQtChartTitle * getTitle() const
Gets the overall title for the chart.
The vtkQtChartWidget class is a container for the chart widgets.
vtkQtChartArea * getChartArea() const
Gets the main chart area.
The vtkQtChartLegend class displays a chart legend.
The vtkQtChartArea class manages the chart axes and layers.