Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CppHotPlugAction.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 __CPP_HOTPLUG_ACTION__
27#define __CPP_HOTPLUG_ACTION__
28
29#include "HotPlugAction.h"
30
31#include <VariantDataModel.h>
32#include <TransformEngine.h>
33
34#include <QLibrary>
35
36namespace camitk {
37
39typedef void (*VoidFunction)(Action*);
40typedef QWidget* (*GetUIFunction)(Action*);
42typedef void (*ParameterChangedFunction)(Action* self, QString parameterName);
43
52 Q_OBJECT
53
54public:
57 CppHotPlugAction(HotPlugActionExtension* actionExtension, const VariantDataModel& data);
58
60 virtual ~CppHotPlugAction() = default;
61
64 virtual bool init() override;
65
67 virtual QWidget* getWidget() override;
68
71 virtual bool needsUpdate() override;
72
74 virtual bool update() override;
75
76public slots:
82 virtual Action::ApplyStatus apply() override;
83
84protected:
86 virtual void parameterChangedEvent(QString parameterName) override;
87
88private:
90 QLibrary actionLib;
91
93 QString actionLibName;
94
97 QDateTime lastLoaded;
98
100 bool updateSucceeded;
101
105 VoidFunction initFunctor;
106
108 ProcessFunction processFunctor;
109
112 GetUIFunction getUIFunctor;
113
118 VoidFunction targetDefinedFunctor;
119
122 ParameterChangedFunction parameterChangedFunctor;
124};
125
126} // namespace camitk
127
128#endif // __CPP_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 Action that can be created on the fly from C++ code It must watch the source code and rebuild when...
Definition CppHotPlugAction.h:51
virtual ~CppHotPlugAction()=default
Default Destructor.
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
Definition Action.cpp:40
QWidget *(* GetUIFunction)(Action *)
Definition CppHotPlugAction.h:40
void(* VoidFunction)(Action *)
function signatures in the UserActionLib
Definition CppHotPlugAction.h:39
void(* ParameterChangedFunction)(Action *self, QString parameterName)
Definition CppHotPlugAction.h:42
Action::ApplyStatus(* ProcessFunction)(Action *self)
Definition CppHotPlugAction.h:41