Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLMarkupsAbstractOptionsWidget.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) The Intervention Centre
4 Oslo University Hospital, Oslo, Norway. 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 Rafael Palomar (The Intervention Centre,
16 Oslo University Hospital) and was supported by The Research Council of Norway
17 through the ALive project (grant nr. 311393).
18
19==============================================================================*/
20
21#ifndef __qMRMLMarkupsAbstractOptionsWidget_h_
22#define __qMRMLMarkupsAbstractOptionsWidget_h_
23
24// Markups Widgets includes
25#include "qSlicerMarkupsModuleWidgetsExport.h"
26
27//MRML includes
28#include <vtkMRMLScene.h>
29#include <vtkMRMLMarkupsNode.h>
30
31// Qt includes
32#include <QWidget>
33
34//-------------------------------------------------------------------------------
36class vtkMRMLNode;
37
38//-------------------------------------------------------------------------------
42class Q_SLICER_MODULE_MARKUPS_WIDGETS_EXPORT qMRMLMarkupsAbstractOptionsWidget
43 : public QWidget
44{
45 Q_OBJECT
46
47 Q_PROPERTY(QString className READ className CONSTANT);
48
49public:
50 typedef QWidget Superclass;
51 qMRMLMarkupsAbstractOptionsWidget(QWidget* parent=nullptr);
53
55 virtual void updateWidgetFromMRML() = 0;
56
58 virtual const QString className() const = 0;
59
60 // Returns the associated markups node
62 {return this->MarkupsNode.GetPointer();}
63
64 // Returns the associated markups node
66 {return this->MRMLScene.GetPointer();}
67
71 virtual bool canManageMRMLMarkupsNode(vtkMRMLMarkupsNode *markupsNode) const = 0;
72
75
76public slots:
78 void setMRMLMarkupsNode(vtkMRMLNode* markupsNode);
80 virtual void setMRMLMarkupsNode(vtkMRMLMarkupsNode* markupsNode) = 0;
84
85protected:
86 vtkWeakPointer<vtkMRMLMarkupsNode> MarkupsNode;
87 vtkWeakPointer<vtkMRMLScene> MRMLScene;
88
89private:
91};
92
93#endif
vtkWeakPointer< vtkMRMLMarkupsNode > MarkupsNode
virtual void updateWidgetFromMRML()=0
Updates the widget based on information from MRML.
virtual void setMRMLMarkupsNode(vtkMRMLMarkupsNode *markupsNode)=0
Sets the vtkMRMLMarkupsNode to operate on.
qMRMLMarkupsAbstractOptionsWidget(QWidget *parent=nullptr)
virtual qMRMLMarkupsAbstractOptionsWidget * createInstance() const =0
Clone options widget . Override to return a new instance of the options widget.
virtual const QString className() const =0
Gets the name of the additional options widget type.
virtual bool canManageMRMLMarkupsNode(vtkMRMLMarkupsNode *markupsNode) const =0
virtual void setMRMLScene(vtkMRMLScene *mrmlScene)
Sets the vtkMRMLNode to operate on.
void setMRMLMarkupsNode(vtkMRMLNode *markupsNode)
Sets the vtkMRMLNode to operate on.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.