Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSegmentEditorScriptedPaintEffect.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __qSlicerSegmentEditorScriptedPaintEffect_h
24 #define __qSlicerSegmentEditorScriptedPaintEffect_h
25 
26 // Segmentations Editor Effects includes
28 
29 #include "qSlicerSegmentationsEditorEffectsExport.h"
30 
31 // Forward Declare PyObject*
32 #ifndef PyObject_HEAD
33 struct _object;
34 typedef _object PyObject;
35 #endif
36 class qSlicerSegmentEditorScriptedPaintEffectPrivate;
37 
49 class Q_SLICER_SEGMENTATIONS_EFFECTS_EXPORT qSlicerSegmentEditorScriptedPaintEffect
51 {
52  Q_OBJECT
53 
54 public:
56  qSlicerSegmentEditorScriptedPaintEffect(QObject* parent = nullptr);
58 
59  Q_INVOKABLE QString pythonSource()const;
60 
63  Q_INVOKABLE bool setPythonSource(const QString newPythonSource);
64 
66  Q_INVOKABLE PyObject* self() const;
67 
70  void setName(QString name) override;
71 
72 // API: Methods that are to be reimplemented in the effect subclasses
73 public:
75  QIcon icon() override;
76 
78  const QString helpText()const override;
79 
82 
84  void activate() override;
85 
87  void deactivate() override;
88 
90  void setupOptionsFrame() override;
91 
93  QCursor createCursor(qMRMLWidget* viewWidget) override;
94 
96  void paintApply(qMRMLWidget* viewWidget) override;
97 
99  void setMRMLDefaults() override;
100 
102  void referenceGeometryChanged() override;
104  void sourceVolumeNodeChanged() override;
106  void masterVolumeNodeChanged() override;
108  void layoutChanged() override;
109 
110 public slots:
112  void updateGUIFromMRML() override;
113 
115  void updateMRMLFromGUI() override;
116 
117 protected:
118  QScopedPointer<qSlicerSegmentEditorScriptedPaintEffectPrivate> d_ptr;
119 
120 private:
121  Q_DECLARE_PRIVATE(qSlicerSegmentEditorScriptedPaintEffect);
123 };
124 
125 #endif
QScopedPointer< qSlicerSegmentEditorScriptedPaintEffectPrivate > d_ptr
void setMRMLDefaults() override
Set default parameters in the parameter MRML node.
void referenceGeometryChanged() override
Perform actions needed on reference geometry change.
qSlicerSegmentEditorAbstractEffect * clone() override
Clone editor effect.
Scripted abstract effect for implementing paint effects in python.
Abstract class for segment editor effects.
virtual void masterVolumeNodeChanged()
Deprecated. Override sourceVolumeNodeChanged() method instead.
virtual QCursor createCursor(qMRMLWidget *viewWidget)
Create a cursor customized for the given effect, potentially for each view.
void updateMRMLFromGUI() override
Update parameter set node from user interface.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
void sourceVolumeNodeChanged() override
Perform actions needed on source volume change.
QIcon icon() override
Get icon for effect to be displayed in segment editor.
void setupOptionsFrame() override
Create options frame widgets, make connections, and add them to the main options frame using...
virtual Q_INVOKABLE void paintApply(qMRMLWidget *viewWidget)
Paint labelmap.
void deactivate() override
Perform actions to deactivate the effect (such as destroy actors, etc.)
void updateGUIFromMRML() override
Update user interface from parameter set node.
const QString helpText() const override
Get help text for effect to be displayed in the help box.
virtual void setName(QString name)
virtual void layoutChanged()
Simple mechanism to let the effects know that the layout has changed.
_object PyObject
virtual Q_INVOKABLE void activate()