Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLScreenShotDialog.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) 2010 Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLScreenShotDialog_h
22 #define __qMRMLScreenShotDialog_h
23 
24 // Qt includes
25 #include <QDialog>
26 #include <QMetaType>
27 #include <QString>
28 
29 // qMRMLWidget includes
30 #include "qMRMLWidgetsExport.h"
31 
32 class qMRMLLayoutManager;
33 class vtkImageData;
34 
35 class qMRMLScreenShotDialogPrivate;
36 
37 class QMRML_WIDGETS_EXPORT qMRMLScreenShotDialog : public QDialog
38 {
39  Q_OBJECT
40  Q_ENUMS(WidgetType)
41  Q_PROPERTY(WidgetType widgetType READ widgetType WRITE setWidgetType)
42 public:
43  typedef QDialog Superclass;
44 
45  enum WidgetType{
46  ThreeD = 0,
47  Red = 1,
48  Yellow = 2,
49  Green = 3,
50  FullLayout = 4
51  };
52 
53  qMRMLScreenShotDialog(QWidget *parent = 0);
55 
56  void setLayoutManager(qMRMLLayoutManager* newlayoutManager);
57  qMRMLLayoutManager* layoutManager()const;
58 
59  void setNameEdit(const QString& newName);
60  QString nameEdit()const;
61 
62  void setDescription(const QString& description);
63  QString description()const;
64 
67  void setData(const QVariant& newData);
68  QVariant data()const;
69 
70  void setWidgetType(WidgetType newType);
71  WidgetType widgetType()const;
72 
73  void setScaleFactor(const double& newScaleFactor);
74  double scaleFactor()const;
75 
76  void setShowScaleFactorSpinBox(const bool& state);
77  bool showScaleFactorSpinBox()const;
78 
80  void setImageData(vtkImageData* screenshot);
81  vtkImageData* imageData()const;
82 
84  void resetDialog();
85 
89  void grabScreenShot(int screenshotWindow);
90 
91 protected slots:
92 
93  void grabScreenShot();
94  void setLastWidgetType(int id);
95 
96 private:
97  QString enumToString(int type);
98 
99 protected:
100  QScopedPointer<qMRMLScreenShotDialogPrivate> d_ptr;
101 
102 private:
103  Q_DECLARE_PRIVATE(qMRMLScreenShotDialog);
104  Q_DISABLE_COPY(qMRMLScreenShotDialog);
105 };
106 
108 
109 #endif
QScopedPointer< qMRMLScreenShotDialogPrivate > d_ptr
Q_DECLARE_METATYPE(QList< QVariantMap >)