Slicer  5.0
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(QColor defaultActiveColor READ defaultActiveColor WRITE setDefaultActiveColor NOTIFY defaultActiveColorChanged)
39  Q_PROPERTY(double defaultGlyphScale READ defaultGlyphScale WRITE setDefaultGlyphScale NOTIFY defaultGlyphScaleChanged)
40  Q_PROPERTY(double defaultTextScale READ defaultTextScale WRITE setDefaultTextScale NOTIFY defaultTextScaleChanged)
41  Q_PROPERTY(double defaultOpacity READ defaultOpacity WRITE setDefaultOpacity NOTIFY defaultOpacityChanged)
42 
43 public:
45  typedef ctkSettingsPanel Superclass;
46 
48  explicit qSlicerMarkupsSettingsPanel(QWidget* parent = nullptr);
49 
51  ~qSlicerMarkupsSettingsPanel() override;
52 
60  void setMarkupsLogic(vtkSlicerMarkupsLogic* logic);
61  vtkSlicerMarkupsLogic* markupsLogic()const;
62 
63  QString defaultGlyphType() const;
64  QColor defaultUnselectedColor() const;
65  QColor defaultSelectedColor() const;
66  QColor defaultActiveColor() const;
67  double defaultGlyphScale() const;
68  double defaultTextScale() const;
69  double defaultOpacity() const;
70 
71 public slots:
72  void setDefaultGlyphType(const QString& type);
73  void setDefaultUnselectedColor(const QColor color);
74  void setDefaultSelectedColor(const QColor color);
75  void setDefaultActiveColor(const QColor color);
76  void setDefaultGlyphScale(const double scale);
77  void setDefaultTextScale(const double scale);
78  void setDefaultOpacity(const double scale);
79 
80 signals:
81  void defaultGlyphTypeChanged(const QString&);
82  void defaultUnselectedColorChanged(QColor);
83  void defaultSelectedColorChanged(QColor);
84  void defaultActiveColorChanged(QColor);
85  void defaultGlyphScaleChanged(const double);
86  void defaultTextScaleChanged(const double);
87  void defaultOpacityChanged(const double);
88 
89 protected slots:
90  void onMarkupsLogicModified();
91 
92  void onDefaultGlyphTypeChanged(int);
93  void updateMarkupsLogicDefaultGlyphType();
94 
95  void onDefaultSelectedColorChanged(QColor);
96  void updateMarkupsLogicDefaultSelectedColor();
97 
98  void onDefaultUnselectedColorChanged(QColor);
99  void updateMarkupsLogicDefaultUnselectedColor();
100 
101  void onDefaultGlyphScaleChanged(double);
102  void updateMarkupsLogicDefaultGlyphScale();
103 
104  void onDefaultTextScaleChanged(double);
105  void updateMarkupsLogicDefaultTextScale();
106 
107  void onDefaultOpacityChanged(double);
108  void updateMarkupsLogicDefaultOpacity();
109 
110 protected:
111  QScopedPointer<qSlicerMarkupsSettingsPanelPrivate> d_ptr;
112 
113 private:
114  Q_DECLARE_PRIVATE(qSlicerMarkupsSettingsPanel);
115  Q_DISABLE_COPY(qSlicerMarkupsSettingsPanel);
116 };
117 
118 #endif
ctkSettingsPanel Superclass
Superclass typedef.