Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSegmentEditorEffectFactory.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 __qSlicerSegmentEditorEffectFactory_h
24 #define __qSlicerSegmentEditorEffectFactory_h
25 
26 // Segmentations Editor Effects includes
27 #include "qSlicerSegmentationsEditorEffectsExport.h"
28 
29 // Qt includes
30 #include <QObject>
31 #include <QList>
32 
34 class qSlicerSegmentEditorEffectFactoryCleanup;
35 
39 class Q_SLICER_SEGMENTATIONS_EFFECTS_EXPORT qSlicerSegmentEditorEffectFactory : public QObject
40 {
41  Q_OBJECT
42 
43 public:
46  Q_INVOKABLE static qSlicerSegmentEditorEffectFactory* instance();
47 
48 public:
51  Q_INVOKABLE bool registerEffect(qSlicerSegmentEditorAbstractEffect* effect);
52 
54  Q_INVOKABLE QList<qSlicerSegmentEditorAbstractEffect*> registeredEffects() { return m_RegisteredEffects; };
55 
60 
61 signals:
63  void effectRegistered(QString);
64 
65 protected:
68 
69 private:
71  static void cleanup();
72 
73 private:
74  qSlicerSegmentEditorEffectFactory(QObject* parent=nullptr);
76 
77  Q_DISABLE_COPY(qSlicerSegmentEditorEffectFactory);
78  friend class qSlicerSegmentEditorEffectFactoryCleanup;
79  friend class PythonQtWrapper_qSlicerSegmentEditorEffectFactory; // Allow Python wrapping without enabling direct instantiation
80 
81 private:
83  static qSlicerSegmentEditorEffectFactory* m_Instance;
84 };
85 
86 #endif
Abstract class for segment editor effects.
Q_INVOKABLE QList< qSlicerSegmentEditorAbstractEffect * > registeredEffects()
Get list of registered effects.
Singleton class managing segment editor effect plugins.
QList< qSlicerSegmentEditorAbstractEffect * > m_RegisteredEffects
List of registered effect instances.