Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
HotPlugAction.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26#ifndef __HOTPLUG_ACTION__
27#define __HOTPLUG_ACTION__
28
29#include "Action.h"
30
32
34namespace camitk {
35
41 Q_OBJECT
42
43public:
45 HotPlugAction(HotPlugActionExtension* actionExtension, const VariantDataModel& data);
46
48 virtual ~HotPlugAction() = default;
49
52 virtual bool init() = 0;
53
55 virtual QWidget* getWidget() override = 0;
56
58 virtual bool event(QEvent* e) override;
59
64 virtual bool needsUpdate();
65
70 virtual bool update();
71
72public slots:
78 virtual Action::ApplyStatus apply() override = 0;
79
80protected:
83 virtual void parameterChangedEvent(QString parameterName) = 0;
84
87
88private:
90 bool initializationPending;
91
94 void createParameters(VariantDataModel parameters);
95
98 Property* createParameter(VariantDataModel parameterData);
99
105 void setParameterAttributes(Property* parameter, VariantDataModel parameterData);
106};
107
108} // namespace camitk
109
110#endif // __HOTPLUG_ACTION__
#define CAMITK_API
Definition CamiTKAPI.h:66
VariantDataModel encapsulates QVariant and can be used as a model for any type of QVariant supported ...
Definition VariantDataModel.h:124
Action class is an abstract class that enables you to build a action (generally an algorithm that wor...
Definition Action.h:215
ApplyStatus
describes what happened during the application of an algorithm (i.e. results of the apply method)
Definition Action.h:231
An ActionExtension that can be created on the fly from a camitk extension file.
Definition HotPlugActionExtension.h:44
An Action that can be created on the fly.
Definition HotPlugAction.h:40
virtual QWidget * getWidget() override=0
Calls user-defined targetDefined() and getUI()
virtual bool init()=0
calls user-defined init()
virtual void parameterChangedEvent(QString parameterName)=0
called when a parameter was changed by an event reimplemented in inherited class
virtual Action::ApplyStatus apply() override=0
this method is automatically called when the action is triggered.
virtual ~HotPlugAction()=default
Default Destructor.
HotPlugActionExtension * hotPlugExtension
where the action is managed
Definition HotPlugAction.h:86
This class describes a property that can be used in components and actions or any class that needs to...
Definition Property.h:306
Definition Action.cpp:40