Tulip
5.6.0
Large graphs analysis and drawing
|
#include <Algorithm.h>
Public Member Functions | |
Algorithm (const PluginContext *context) | |
std::string | category () const override |
virtual bool | check (std::string &) |
std::string | icon () const override |
virtual bool | run ()=0 |
Public Member Functions inherited from tlp::Plugin | |
virtual std::string | author () const =0 |
virtual std::string | date () const =0 |
void | declareDeprecatedName (const std::string &oldName) |
std::string | deprecatedName () |
virtual std::string | group () const =0 |
virtual int | id () const |
virtual std::string | info () const =0 |
virtual std::string | major () const |
virtual std::string | minor () const |
virtual std::string | name () const =0 |
virtual std::string | programmingLanguage () const |
virtual std::string | release () const =0 |
virtual std::string | tulipMajor () const |
virtual std::string | tulipMinor () const |
virtual std::string | tulipRelease () const =0 |
Public Attributes | |
DataSet * | dataSet |
Graph * | graph |
PluginProgress * | pluginProgress |
Additional Inherited Members | |
Protected Attributes inherited from tlp::Plugin | |
std::string | oldName |
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 46 of file Algorithm.h.
|
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 55 of file Algorithm.h.
|
inlineoverridevirtual |
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 80 of file Algorithm.h.
|
inlinevirtual |
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 91 of file Algorithm.h.
|
inlineoverridevirtual |
The icon (preferably a thumbnail) of the plugin.
Reimplemented from tlp::Plugin.
Definition at line 66 of file Algorithm.h.
|
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.
DataSet* tlp::Algorithm::dataSet |
A DataSet containing parameters for this algorithm, if any. Retrieved from the context at construction.
Definition at line 107 of file Algorithm.h.
Graph* tlp::Algorithm::graph |
The graph this algorithm will be run on. Retrieved from the context at construction.
Definition at line 97 of file Algorithm.h.
PluginProgress* tlp::Algorithm::pluginProgress |
A PluginProgress to give feedback to the user, retrieved from the context. It can be a nullptr pointer, so use with caution.
Definition at line 102 of file Algorithm.h.