Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSegmentEditorPaintEffect.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 Csaba Pinter, 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 __qSlicerSegmentEditorPaintEffect_h
22 #define __qSlicerSegmentEditorPaintEffect_h
23 
24 // Segmentations Editor Effects includes
25 #include "qSlicerSegmentationsEditorEffectsExport.h"
26 
28 
29 class qSlicerSegmentEditorPaintEffectPrivate;
30 class vtkPolyData;
31 
33 class Q_SLICER_SEGMENTATIONS_EFFECTS_EXPORT qSlicerSegmentEditorPaintEffect :
35 {
36  Q_OBJECT
37 
38 public:
39  Q_PROPERTY(double minimumPaintPointDistance READ minimumPaintPointDistance WRITE setMinimumPaintPointDistance)
40  Q_PROPERTY(bool delayedPaint READ delayedPaint WRITE setDelayedPaint)
41 
43  qSlicerSegmentEditorPaintEffect(QObject* parent = nullptr);
45 
46 public:
48  QIcon icon() override;
49 
51  const QString helpText()const override;
52 
54  qSlicerSegmentEditorAbstractEffect* clone() override;
55 
57  void deactivate() override;
58 
63  bool processInteractionEvents(vtkRenderWindowInteractor* callerInteractor, unsigned long eid, qMRMLWidget* viewWidget) override;
64 
69  void processViewNodeEvents(vtkMRMLAbstractViewNode* callerViewNode, unsigned long eid, qMRMLWidget* viewWidget) override;
70 
72  void setupOptionsFrame() override;
73 
75  void setMRMLDefaults() override;
76 
78  void referenceGeometryChanged() override;
79 
85  Q_INVOKABLE double minimumPaintPointDistance();
86 
88  Q_INVOKABLE bool delayedPaint();
89 
90  // returns extent of the brushes
91  Q_INVOKABLE QList<int> paintBrushesIntoLabelmap(vtkOrientedImageData* labelmap, qMRMLWidget* viewWidget);
92 
93  Q_INVOKABLE void clearBrushes();
94 
97  Q_INVOKABLE QFrame* paintOptionsFrame();
98 
99  Q_INVOKABLE void setColorSmudgeCheckboxVisible(bool show);
100 
102  Q_INVOKABLE virtual void paintApply(qMRMLWidget* viewWidget);
103 
104 public slots:
106  void updateGUIFromMRML() override;
107 
109  void updateMRMLFromGUI() override;
110 
112  void setMinimumPaintPointDistance(double dist);
113 
115  void setDelayedPaint(bool delayed);
116 
117 protected:
120  bool m_AlwaysErase;
121 
123  bool m_Erase;
124 
125 protected:
126  QScopedPointer<qSlicerSegmentEditorPaintEffectPrivate> d_ptr;
127 
128 private:
129  Q_DECLARE_PRIVATE(qSlicerSegmentEditorPaintEffect);
130  Q_DISABLE_COPY(qSlicerSegmentEditorPaintEffect);
131 };
132 
133 #endif
Abstract class for segment editor effects.
Image data containing orientation information.
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35