iVS3D v2.0.0
Loading...
Searching...
No Matches
algorithmmanager.h
1#ifndef ALGORITHMMANAGER_H
2#define ALGORITHMMANAGER_H
3
11#include <QDir>
12#include <QCoreApplication>
13#include <QPluginLoader>
14#include <QMap>
15
16#include <QThread>
17
18#include "../iVS3D-pluginInterface/iVS3D-pluginInterface_global.h"
19#include "../iVS3D-pluginInterface/ialgorithm.h"
20#include "signalobject.h"
21
22
35class AlgorithmManager : public QObject
36{
37 Q_OBJECT
38public:
43 static AlgorithmManager &instance();
50 QWidget* getSettingsWidget(QWidget* parent, uint idx);
57 std::vector<uint> sample(std::vector<uint> sharpImages, Progressable* receiver, volatile bool* stopped, int idx, bool useCuda, LogFileParent *logFile);
59 // * @brief getAlgorithmList returns the loaded plugins
60 // * @return QStringList with the names of the loaded plugins
61 // */
62 //QStringList getAlgorithmList();
63 QStringList getAlgorithmNames();
64
70 QString getPluginNameToIndex(int index);
76 QString getPluginFileNameToIndex(int index);
82 QString getPluginNameFromFileName(QString FileName);
88 int getIndexFromFileName(QString FileName);
98 void initializePlugins(Reader *reader, QMap<QString, QMap<QString,QVariant>> allBuffer);
104 void setSettings(int idx, QMap<QString, QVariant> settings);
113 QMap<QString, QVariant> generateSettings(int idx, Progressable *receiver, bool useCuda, volatile bool* stopped);
119 QMap<QString, QVariant> getSettings(int idx);
120
121
122
123 void notifyNewMetaData();
124 void notifySelectedImageIndex(uint index);
125 void notifyKeyframesChanged(std::vector<uint> keyframes);
126 void notifyUpdateBuffer(QString pluginName, QMap<QString, QVariant> buffer);
127
128
129private slots:
130 void slot_updateKeyframes(std::vector<uint> keyframes);
131 void slot_updateBuffer(QMap<QString, QVariant> buffer);
132
133signals:
134 void sig_updateKeyframe(QString pluginName, std::vector<uint> keyframes);
135 void sig_updateBuffer(QString pluginName, QMap<QString, QVariant> buffer);
136
137private:
138 std::vector<IAlgorithm*> m_algorithmList;
140 void loadPlugins();
141 signalObject* m_sigObj;
142 QStringList m_pluginFileNames;
143};
144
145#endif // ALGORITHMMANAGER_H
The AlgorithmManager class is a singleton which is responisble for loading and executing the IAlgorit...
Definition algorithmmanager.h:36
static AlgorithmManager & instance()
instance singleton method
Definition algorithmmanager.cpp:11
QString getPluginNameFromFileName(QString FileName)
getPluginNameFromFileName Takes the name of a plugin file and returns it's translated name.
Definition algorithmmanager.cpp:49
int getAlgorithmCount()
getAlgorithmCount returns the number of loaded IAlgorithms
Definition algorithmmanager.cpp:65
QString getPluginFileNameToIndex(int index)
getPluginFileNameToIndex Takes the index of a plugin and returns it's file name.
Definition algorithmmanager.cpp:44
void setSettings(int idx, QMap< QString, QVariant > settings)
setSettings sets the settings of the indexed plugin
Definition algorithmmanager.cpp:80
QMap< QString, QVariant > generateSettings(int idx, Progressable *receiver, bool useCuda, volatile bool *stopped)
generateSettings returns the generated settings of the indexed plugin
Definition algorithmmanager.cpp:85
void initializePlugins(Reader *reader, QMap< QString, QMap< QString, QVariant > > allBuffer)
initializePlugins calls the initialize method on all loaded IAlgorithms
Definition algorithmmanager.cpp:70
QMap< QString, QVariant > getSettings(int idx)
getSettings gets the settings of the indexed plugin
Definition algorithmmanager.cpp:90
QString getPluginNameToIndex(int index)
getIndexToPluginName Takes the index of a plugin and returns it's translated name.
Definition algorithmmanager.cpp:39
QWidget * getSettingsWidget(QWidget *parent, uint idx)
getSettingsWidget Gets the Settings widget from the algorithm with the given index
Definition algorithmmanager.cpp:17
int getIndexFromFileName(QString FileName)
getIndexFromFileName Takes the name of a plugin file and returns its index.
Definition algorithmmanager.cpp:60
QStringList getAlgorithmNames()
‍**
Definition algorithmmanager.cpp:29
std::vector< uint > sample(std::vector< uint > sharpImages, Progressable *receiver, volatile bool *stopped, int idx, bool useCuda, LogFileParent *logFile)
sample Executes the indexed algorithm
Definition algorithmmanager.cpp:25
The LogFileParent class logs progress as well as information about a process (e.g....
Definition LogFileParent.h:30
The Progressable interface is used to by multithreaded actions such as sampling or exporting to repor...
Definition progressable.h:18
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
Definition signalobject.h:10