Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerMarkupsModule.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 __qSlicerMarkupsModule_h
19 #define __qSlicerMarkupsModule_h
20 
21 // CTK includes
22 #include <ctkVTKObject.h>
23 
24 // Slicer includes
25 #include "qSlicerLoadableModule.h"
26 
27 #include "qSlicerMarkupsModuleExport.h"
28 
29 #include "vtkSlicerConfigure.h" // For Slicer_HAVE_QT5
30 
32 class vtkMRMLScene;
33 class vtkMRMLMarkupsNode;
34 class qSlicerMarkupsModulePrivate;
36 class vtkObject;
37 
39 class Q_SLICER_QTMODULES_MARKUPS_EXPORT qSlicerMarkupsModule :
41 {
42  Q_OBJECT
43  QVTK_OBJECT;
44  Q_PLUGIN_METADATA(IID "org.slicer.modules.loadable.qSlicerLoadableModule/1.0");
45  Q_INTERFACES(qSlicerLoadableModule);
47  Q_PROPERTY(bool toolBarVisible READ isToolBarVisible WRITE setToolBarVisible)
48  Q_PROPERTY(bool autoShowToolBar READ autoShowToolBar WRITE setAutoShowToolBar)
49 
50 public:
51 
53  explicit qSlicerMarkupsModule(QObject *parent=nullptr);
54  ~qSlicerMarkupsModule() override;
55 
56  qSlicerGetTitleMacro(QTMODULE_TITLE);
57 
59  QString helpText()const override;
60 
62  QString acknowledgementText()const override;
63 
65  QStringList contributors()const override;
66 
68  QIcon icon()const override;
69 
71  QStringList categories()const override;
72 
74  QStringList associatedNodeTypes()const override;
75 
76  void setMRMLScene(vtkMRMLScene* scene) override;
77 
78  static void readDefaultMarkupsDisplaySettings(vtkMRMLMarkupsDisplayNode* markupsDisplayNode);
79  static void writeDefaultMarkupsDisplaySettings(vtkMRMLMarkupsDisplayNode* markupsDisplayNode);
80 
84  Q_INVOKABLE bool autoShowToolBar();
85  Q_INVOKABLE bool isToolBarVisible();
86  Q_INVOKABLE qMRMLMarkupsToolBar* toolBar();
87 
90  Q_INVOKABLE static bool showMarkups(vtkMRMLMarkupsNode* markupsNode);
91 
92 protected:
93 
95  void setup() override;
96 
98  qSlicerAbstractModuleRepresentation * createWidgetRepresentation() override;
99 
101  vtkMRMLAbstractLogic* createLogic() override;
102 
103 public slots:
104  void setToolBarVisible(bool visible);
106  void setAutoShowToolBar(bool autoShow);
107  //void onNodeAddedEvent(vtkObject*, vtkObject*);
108 
109 protected:
110  QScopedPointer<qSlicerMarkupsModulePrivate> d_ptr;
111 
112 
113 private:
114  Q_DECLARE_PRIVATE(qSlicerMarkupsModule);
115  Q_DISABLE_COPY(qSlicerMarkupsModule);
116 
117 };
118 
119 #endif
Superclass for MRML logic classes.
#define qSlicerGetTitleMacro(_TITLE)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57