Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLPlotView.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Kapteyn Astronomical Institute
4  University of Groningen, Groningen, Netherlands. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Davide Punzo, Kapteyn Astronomical Institute,
16  and was supported through the European Research Council grant nr. 291531.
17 
18 ==============================================================================*/
19 
20 #ifndef __qMRMLPlotView_h
21 #define __qMRMLPlotView_h
22 
23 // CTK includes
24 #include <ctkPimpl.h>
25 #include <ctkVTKChartView.h>
26 
27 #include "qMRMLWidgetsExport.h"
28 
29 class qMRMLPlotViewPrivate;
30 
31 // MRML includes
33 class vtkMRMLScene;
34 
35 // VTK includes
36 class vtkCollection;
37 class vtkStringArray;
38 
44 
45 class QMRML_WIDGETS_EXPORT qMRMLPlotView : public ctkVTKChartView
46 {
47  Q_OBJECT
48 public:
50  typedef ctkVTKChartView Superclass;
51 
53  explicit qMRMLPlotView(QWidget* parent = nullptr);
54  ~qMRMLPlotView() override;
55 
57  vtkMRMLScene* mrmlScene() const;
58 
60  vtkMRMLPlotViewNode* mrmlPlotViewNode()const;
61 
63  QSize sizeHint() const override;
64 
65 public slots:
66 
68  void setMRMLScene(vtkMRMLScene* newScene);
69 
71  void setMRMLPlotViewNode(vtkMRMLPlotViewNode* newPlotViewNode);
72 
74  void fitToContent();
75 
77  void RemovePlotSelections();
78 
82  void saveAsSVG(const QString &fileName);
83 
84 signals:
85 
89  void mrmlSceneChanged(vtkMRMLScene*);
90 
94  void dataSelected(vtkStringArray* mrmlPlotSeriesIDs, vtkCollection* selectionCol);
95 
96 protected slots:
97 
98  void updateMRMLChartAxisRangeFromWidget();
99 
100 protected:
101  QScopedPointer<qMRMLPlotViewPrivate> d_ptr;
102 
104  void keyPressEvent(QKeyEvent* event) override;
105 
106  void keyReleaseEvent(QKeyEvent* event) override;
107 
108 private:
109  Q_DECLARE_PRIVATE(qMRMLPlotView);
110  Q_DISABLE_COPY(qMRMLPlotView);
111 };
112 
113 #endif
MRML node to represent Plot view parameters.
ctkVTKChartView Superclass
Superclass typedef.
Definition: qMRMLPlotView.h:50
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
QScopedPointer< qMRMLPlotViewPrivate > d_ptr
qMRMLPlotView is the display canvas for a Plot.
Definition: qMRMLPlotView.h:45