25 #include <tulip/Plugin.h>
26 #include <tulip/PluginContext.h>
30 static const std::string ALGORITHM_CATEGORY =
"Algorithm";
56 assert(algorithmContext != NULL);
65 return ":/tulip/gui/icons/32/plugin_algorithm.png";
75 virtual bool run() = 0;
78 return ALGORITHM_CATEGORY;
87 virtual bool check(std::string &) {
Graph * graph
The graph this algorithm will be run on. Retrieved from the context at construction.
PluginProgress * pluginProgress
A progress handler to notify the user about the progress state of the algorithm when run...
A container that can store data from any type.
This abstract class describes a basic algorithm plugin.
virtual bool check(std::string &)
Checks whether the algorithm can be applied on this graph or not. If not, the reason why should be re...
PluginProgress * pluginProgress
A PluginProgress to give feedback to the user, retrieved from the context. It can be a NULL pointer...
DataSet * dataSet
Input parameters set by the user when running the plugin.
Algorithm(const PluginContext *context)
Constructs an algorithm and initializes members from the AlgorithmContext.
Contains runtime parameters for a plugin.
virtual bool run()=0
Runs the algorithm. It is a good practice to report progress through the PluginProgress, Even if your algorithm is very fast. Keep in mind that Tulip can handle very large graphs. The PluginProgress should also be used to report errors, if any.
Top-level interface for plug-ins.
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...
DataSet * dataSet
A DataSet containing parameters for this algorithm, if any. Retrieved from the context at constructio...
virtual std::string category() const
A string identifier for a plugin used for categorization purposes.
std::string icon() const
The icon (preferably a thumbnail) of the plugin.
Parameters structure for a tlp::Algorithm.
Graph * graph
The pointer to the tlp::Graph on which the algorithm will be run.