Overview     Modules     Class Hierarchy     Classes     Members  

tlp::Algorithm Class Reference
[Plugins]

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, ...). More...

#include <Algorithm.h>

Inheritance diagram for tlp::Algorithm:
Collaboration diagram for tlp::Algorithm:

List of all members.

Public Member Functions

  • Algorithm (AlgorithmContext context)
    Constructs an algorithm and initializes members from the AlgorithmContext.
  • virtual ~Algorithm ()
  • virtual bool run ()=0
    Runs the algorithm on the context that was specified during construction.
  • virtual bool check (std::string &)
    Checks if the algorithm can run on the context it was gieven.
  • virtual void reset ()

Public Attributes

  • Graph * graph
    The Graph this algorithm will be run on. Retrieved from the context at construction.
  • PluginProgress * pluginProgress
    A pluginProgress to give feedback to the user, retrieved from the context. It can be a NULL pointer, so use with caution.
  • DataSet * dataSet
    A DataSet containing parameters for this algorithm, if any. Retrived from the context at construction.

Detailed Description

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, ...).


Constructor & Destructor Documentation

tlp::Algorithm::Algorithm ( AlgorithmContext  context  )  [inline]

Constructs an algorithm and initializes members from the AlgorithmContext.

Parameters:
context The context this algorithm runs in, containing the graph, a dataSet for the arameters, and a pluginProgress to give feedback to the user about the tasks the algorithm is performing.
virtual tlp::Algorithm::~Algorithm (  )  [inline, virtual]

Member Function Documentation

virtual bool tlp::Algorithm::check ( std::string &   )  [inline, virtual]

Checks if the algorithm can run on the context it was gieven.

Returns:
Whether the algorithm can be applied or not.
virtual void tlp::Algorithm::reset (  )  [inline, virtual]
virtual bool tlp::Algorithm::run (  )  [pure virtual]

Runs the algorithm on the context that was specified during construction.

Returns:
bool Whether the algorithm was sucessfull or not.

Member Data Documentation

A DataSet containing parameters for this algorithm, if any. Retrived from the context at construction.

The Graph this algorithm will be run on. Retrieved from the context at construction.

A pluginProgress to give feedback to the user, retrieved from the context. It can be a NULL pointer, so use with caution.



Tulip Software by LaBRI Visualization Team    2001 - 2011