Tulip
4.6.0
Better Visualization Through Research
|
#include <Algorithm.h>
Public Member Functions | |
Algorithm (const PluginContext *context) | |
virtual std::string | category () const |
virtual bool | check (std::string &) |
std::string | icon () const |
virtual bool | run ()=0 |
Public Attributes | |
DataSet * | dataSet |
Graph * | graph |
PluginProgress * | pluginProgress |
This abstract class describes a basic algorithm plugin.
It inherits on WithParameter and WithDependency for convenience. Basic functionality consists in checking the algorithm can run on the current Graph (e.g. is the graph simple ?), running the algorithm and resetting the algorithm to re-apply it. The algorithm can and should report progress and which task it is performing if it is decomposed in multiple phases (e.g. layouting the graph, coloring it, ...).
Definition at line 45 of file Algorithm.h.
tlp::Algorithm::Algorithm | ( | const PluginContext * | context | ) | [inline] |
Constructs an algorithm and initializes members from the AlgorithmContext.
context | The context this algorithm runs in, containing the graph, a DataSet for the parameters, and a PluginProgress to give feedback to the user about the tasks the algorithm is performing. |
Definition at line 53 of file Algorithm.h.
virtual std::string tlp::Algorithm::category | ( | ) | const [inline, virtual] |
A string identifier for a plugin used for categorization purposes.
Implements tlp::Plugin.
Reimplemented in tlp::StringAlgorithm, tlp::SizeAlgorithm, tlp::LayoutAlgorithm, tlp::IntegerAlgorithm, tlp::DoubleAlgorithm, tlp::ColorAlgorithm, tlp::BooleanAlgorithm, and tlp::PropertyAlgorithm.
Definition at line 77 of file Algorithm.h.
virtual bool tlp::Algorithm::check | ( | std::string & | ) | [inline, virtual] |
Checks whether the algorithm can be applied on this graph or not. If not, the reason why should be reported through the PluginProgress.
errorMessage | A string whose value will be modified to an error message, if the check fails. |
Definition at line 87 of file Algorithm.h.
std::string tlp::Algorithm::icon | ( | ) | const [inline, virtual] |
The icon (preferably a thumbnail) of the plugin.
Reimplemented from tlp::Plugin.
Definition at line 64 of file Algorithm.h.
virtual bool tlp::Algorithm::run | ( | ) | [pure virtual] |
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.
A DataSet containing parameters for this algorithm, if any. Retrieved from the context at construction.
Definition at line 101 of file Algorithm.h.
The graph this algorithm will be run on. Retrieved from the context at construction.
Definition at line 93 of file Algorithm.h.
A PluginProgress to give feedback to the user, retrieved from the context. It can be a NULL pointer, so use with caution.
Definition at line 97 of file Algorithm.h.