Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSimpleMarkupsWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. 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 Matthew Holden, PerkLab, Queen's University
16  and was supported through the Applied Cancer Research Unit program of Cancer Care
17  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerSimpleMarkupsWidget_h
22 #define __qSlicerSimpleMarkupsWidget_h
23 
24 // Qt includes
25 #include "qSlicerWidget.h"
26 
27 #include "qMRMLUtils.h"
28 
29 // Markups Widgets includes
30 #include "qSlicerMarkupsModuleWidgetsExport.h"
31 #include "ui_qSlicerSimpleMarkupsWidget.h"
32 
33 
34 class qSlicerSimpleMarkupsWidgetPrivate;
35 
37 class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT
39 {
40  Q_OBJECT
41  Q_PROPERTY(bool enterPlaceModeOnNodeChange READ enterPlaceModeOnNodeChange WRITE setEnterPlaceModeOnNodeChange)
42  Q_PROPERTY(bool jumpToSliceEnabled READ jumpToSliceEnabled WRITE setJumpToSliceEnabled)
43  Q_PROPERTY(bool nodeSelectorVisible READ nodeSelectorVisible WRITE setNodeSelectorVisible)
44  Q_PROPERTY(bool optionsVisible READ optionsVisible WRITE setOptionsVisible)
45  Q_PROPERTY(QColor nodeColor READ nodeColor WRITE setNodeColor)
46  Q_PROPERTY(QColor defaultNodeColor READ defaultNodeColor WRITE setDefaultNodeColor)
47  Q_PROPERTY(int viewGroup READ viewGroup WRITE setViewGroup)
48 
49 public:
51  qSlicerSimpleMarkupsWidget(QWidget *parent=nullptr);
52  ~qSlicerSimpleMarkupsWidget() override;
53 
55  Q_INVOKABLE vtkMRMLNode* currentNode() const;
56 
58  Q_INVOKABLE vtkMRMLNode* getCurrentNode();
59 
62  Q_INVOKABLE vtkMRMLInteractionNode* interactionNode()const;
63 
65  Q_INVOKABLE QTableWidget* tableWidget() const;
66 
68  Q_INVOKABLE qSlicerMarkupsPlaceWidget* markupsPlaceWidget() const;
69 
71  Q_INVOKABLE qMRMLNodeComboBox* markupsSelectorComboBox() const;
72 
74  bool enterPlaceModeOnNodeChange() const;
75 
78  bool jumpToSliceEnabled() const;
79 
81  bool nodeSelectorVisible() const;
82 
84  bool optionsVisible() const;
85 
87  QColor nodeColor() const;
88 
90  QColor defaultNodeColor() const;
91 
94  void setViewGroup(int newViewGroup);
95 
97  int viewGroup()const;
98 
99 public slots:
100 
101  void setMRMLScene(vtkMRMLScene* scene) override;
102 
104  void setCurrentNode(vtkMRMLNode* currentNode);
105 
107  void setNodeBaseName(const QString& newNodeBaseName);
108 
111  void setInteractionNode(vtkMRMLInteractionNode* interactionNode);
112 
114  void setEnterPlaceModeOnNodeChange(bool);
115 
117  void setJumpToSliceEnabled(bool);
118 
120  void setNodeSelectorVisible(bool);
121 
123  void setOptionsVisible(bool);
124 
126  void setNodeColor(QColor color);
127 
129  void setDefaultNodeColor(QColor color);
130 
132  void highlightNthControlPoint(int n);
133 
135  void highlightNthFiducial(int n);
136 
138  void activate();
139 
141  void placeActive(bool place);
142 
143 protected slots:
144 
146  void onMarkupsNodeChanged();
148  void onMarkupsNodeAdded(vtkMRMLNode*);
150  void onMarkupsControlPointsTableContextMenu(const QPoint& position);
151 
153  void onMarkupsControlPointEdited(int row, int column);
154 
156  void onMarkupsControlPointSelected(int row, int column);
157 
159  void updateWidget();
160 
162  void onPointAdded();
163 
164 signals:
165 
167  void markupsNodeChanged();
168 
170  void markupsFiducialNodeChanged();
171 
174  void currentMarkupsControlPointSelectionChanged(int markupIndex);
175 
177  void currentMarkupsFiducialSelectionChanged(int markupIndex);
178 
182  void activeMarkupsPlaceModeChanged(bool enabled);
183 
185  void activeMarkupsFiducialPlaceModeChanged(bool enabled);
186 
189  void updateFinished();
190 
191 protected:
192  QScopedPointer<qSlicerSimpleMarkupsWidgetPrivate> d_ptr;
193 
194  virtual void setup();
195 
196 private:
197  Q_DECLARE_PRIVATE(qSlicerSimpleMarkupsWidget);
198  Q_DISABLE_COPY(qSlicerSimpleMarkupsWidget);
199 
200 };
201 
202 #endif
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
Combobox that automatically displays all the nodes of the scene that match filtering criteria...
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167