Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerMarkupsSettingsPanel.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
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 ==============================================================================*/
17 
18 #ifndef __qSlicerMarkupsSettingsPanel_h
19 #define __qSlicerMarkupsSettingsPanel_h
20 
21 // CTK includes
22 #include <ctkVTKObject.h>
23 #include <ctkSettingsPanel.h>
24 
25 // Markups includes
26 #include "qSlicerMarkupsModuleExport.h"
27 class qSlicerMarkupsSettingsPanelPrivate;
29 
30 class Q_SLICER_QTMODULES_MARKUPS_EXPORT qSlicerMarkupsSettingsPanel
31  : public ctkSettingsPanel
32 {
33  Q_OBJECT
34  QVTK_OBJECT
35  Q_PROPERTY(QString defaultGlyphType READ defaultGlyphType WRITE setDefaultGlyphType NOTIFY defaultGlyphTypeChanged)
36  Q_PROPERTY(QColor defaultUnselectedColor READ defaultUnselectedColor WRITE setDefaultUnselectedColor NOTIFY defaultUnselectedColorChanged)
37  Q_PROPERTY(QColor defaultSelectedColor READ defaultSelectedColor WRITE setDefaultSelectedColor NOTIFY defaultSelectedColorChanged)
38  Q_PROPERTY(double defaultGlyphScale READ defaultGlyphScale WRITE setDefaultGlyphScale NOTIFY defaultGlyphScaleChanged)
39  Q_PROPERTY(double defaultTextScale READ defaultTextScale WRITE setDefaultTextScale NOTIFY defaultTextScaleChanged)
40  Q_PROPERTY(double defaultOpacity READ defaultOpacity WRITE setDefaultOpacity NOTIFY defaultOpacityChanged)
41 
42 public:
44  typedef ctkSettingsPanel Superclass;
45 
47  explicit qSlicerMarkupsSettingsPanel(QWidget* parent = 0);
48 
50  virtual ~qSlicerMarkupsSettingsPanel();
51 
59  void setMarkupsLogic(vtkSlicerMarkupsLogic* logic);
60  vtkSlicerMarkupsLogic* markupsLogic()const;
61 
62  QString defaultGlyphType() const;
63  QColor defaultUnselectedColor() const;
64  QColor defaultSelectedColor() const;
65  double defaultGlyphScale() const;
66  double defaultTextScale() const;
67  double defaultOpacity() const;
68 
69 public slots:
70  void setDefaultGlyphType(const QString& type);
71  void setDefaultUnselectedColor(const QColor color);
72  void setDefaultSelectedColor(const QColor color);
73  void setDefaultGlyphScale(const double scale);
74  void setDefaultTextScale(const double scale);
75  void setDefaultOpacity(const double scale);
76 
77 signals:
78  void defaultGlyphTypeChanged(const QString&);
79  void defaultUnselectedColorChanged(QColor);
80  void defaultSelectedColorChanged(QColor);
81  void defaultGlyphScaleChanged(const double);
82  void defaultTextScaleChanged(const double);
83  void defaultOpacityChanged(const double);
84 
85 protected slots:
86  void onMarkupsLogicModified();
87 
88  void onDefaultGlyphTypeChanged(int);
89  void updateMarkupsLogicDefaultGlyphType();
90 
91  void onDefaultSelectedColorChanged(QColor);
92  void updateMarkupsLogicDefaultSelectedColor();
93 
94  void onDefaultUnselectedColorChanged(QColor);
95  void updateMarkupsLogicDefaultUnselectedColor();
96 
97  void onDefaultGlyphScaleChanged(double);
98  void updateMarkupsLogicDefaultGlyphScale();
99 
100  void onDefaultTextScaleChanged(double);
101  void updateMarkupsLogicDefaultTextScale();
102 
103  void onDefaultOpacityChanged(double);
104  void updateMarkupsLogicDefaultOpacity();
105 
106 protected:
107  QScopedPointer<qSlicerMarkupsSettingsPanelPrivate> d_ptr;
108 
109 private:
110  Q_DECLARE_PRIVATE(qSlicerMarkupsSettingsPanel);
111  Q_DISABLE_COPY(qSlicerMarkupsSettingsPanel);
112 };
113 
114 #endif
ctkSettingsPanel Superclass
Superclass typedef.