Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
Plugins system

Classes

class  tlp::Algorithm
 This abstract class describes a basic algorithm plugin. More...
 
class  tlp::AlgorithmContext
 Parameters structure for a tlp::Algorithm. More...
 
class  tlp::BooleanAlgorithm
 The boolean algorithm takes a graph as input and output its results as a tlp::BooleanProperty. More...
 
class  tlp::ColorAlgorithm
 The color algorithm takes a graph as input and output its results as a tlp::ColorProperty. More...
 
struct  tlp::Dependency
 Represents a plugin's dependency to another plugin. In addition to maganing plugin registration, Tulip also handles a dependency mechanism between plugins. Every Tulip plugin inherits from the tlp::WithDependency interface which allows to declare that another plugin should be loaded in order for this plugin to run. When declaring a dependency, a plugin state the name and the version of the dependecy. This is done by calling tlp::WithDependency::addDependency() More...
 
class  tlp::DoubleAlgorithm
 The double algorithm takes a graph as input and output its results as a tlp::DoubleProperty. More...
 
class  tlp::FactoryInterface
 The base class for plugin factories. More...
 
class  tlp::GlMainView
 An abstract view that displays a GlMainWidget as its central widget. More...
 
class  tlp::IntegerAlgorithm
 The integer algorithm takes a graph as input and output its results as a tlp::IntegerProperty. More...
 
class  tlp::Interactor
 Interactor provides a way to handle user inputs over a view. Basically, The interactor class is an overlay to the Qt's event filtering mechanism. It adds several features like the ability to define priorities, custom cursors, etc. More...
 
class  tlp::InteractorLister
 The InteractorLister class lists compatible interactors for a given tlp::View. More...
 
class  tlp::LayoutAlgorithm
 The layout algorithm takes a graph as input and output its results as a tlp::LayoutProperty. More...
 
class  tlp::ParameterDescription
 Describes a plugin's parameter. More...
 
struct  tlp::ParameterDescriptionList
 This class describes parameters taken by a plugin. More...
 
class  tlp::Perspective
 A Perspective is a Tulip plugin that completely re-defines the user interface. More...
 
class  tlp::PerspectiveContext
 A context data structure for tlp::Perspective instances. More...
 
class  tlp::Plugin
 Top-level interface for plug-ins. More...
 
class  tlp::PluginContext
 Contains runtime parameters for a plugin. More...
 
class  tlp::PluginLibraryLoader
 This class takes care of the actual loading of the libraries. You can use it to load a single plugin (loadPluginLibrary) or all the plugins in a given folder (loadPlugins).0. More...
 
class  tlp::PluginLister
 The PluginLister class is a singleton used to list plugins currently loaded into Tulip and retrieve informations about them. More...
 
struct  tlp::PluginLoader
 A callback class when loading plugins into Tulip. More...
 
struct  tlp::PluginLoaderTxt
 A simple implementation of tlp::PluginLoader to display load state into the console. More...
 
class  tlp::PluginProgress
 PluginProcess subclasses are meant to notify about the progress state of some process (typically a plugin) More...
 
class  tlp::ProgressPreviewHandler
 The ProgressPreviewHandler class handles the way a process handled by a PluginProgress is handled. More...
 
class  tlp::PropertyAlgorithm
 A non-template interface for tlp::TemplateAlgorithm. More...
 
class  tlp::SizeAlgorithm
 The size algorithm takes a graph as input and output its results as a tlp::SizeProperty. More...
 
class  tlp::StringAlgorithm
 The string algorithm takes a graph as input and output its results as a tlp::StringProperty. More...
 
class  tlp::TemplateAlgorithm< Property >
 The TemplateAlgorithm class describes a plugin that can operate on a single graph's property. More...
 
class  tlp::TulipProject
 The TulipProject object handles the content of a Tulip project. More...
 
class  tlp::View
 View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph. More...
 
class  tlp::ViewWidget
 ViewWidget provides convenience functions to allow the user to build a view plugin that displays a QWidget as its main element. More...
 
class  tlp::WithDependency
 Describes the dependencies of a plug-in on other plug-ins, identified by their name and their version number. More...
 
struct  tlp::WithParameter
 This class describes parameters on a plug-in. More...
 

Macros

#define INTERACTORPLUGINVIEWEXTENSION(CLASS_NAME, STRING_CLASS_NAME, BASE_INTERACTOR_STRING_NAME, VIEW_STRING_NAME, AUTHOR, DATE, DESCRIPTION, VERSION)
 
#define INTERACTORPLUGINVIEWEXTENSIONWITHPRIORITY(CLASS_NAME, STRING_CLASS_NAME, BASE_INTERACTOR_STRING_NAME, VIEW_STRING_NAME, AUTHOR, DATE, DESCRIPTION, VERSION, PRIORITY)
 
#define PLUGIN(C)
 
#define PLUGININFORMATIONS(NAME, AUTHOR, DATE, INFO, RELEASE, GROUP)
 

Enumerations

enum  tlp::ParameterDirection { IN_PARAM =0, OUT_PARAM = 1, INOUT_PARAM = 2 }
 
enum  tlp::ProgressState { tlp::TLP_CONTINUE, tlp::TLP_CANCEL, tlp::TLP_STOP }
 

Functions

std::string tlp::demangleTlpClassName (const char *className)
 
std::string tlp::getMajor (const std::string &release)
 
std::string tlp::getMinor (const std::string &release)
 
void tlp::initTulipLib (const char *appDirPath=NULL)
 

Detailed Description

Tulip plugins interfaces Classes in this group are interfaces for the plugins system. You will subclass one of them when creating your own Tulip plugins.

Macro Definition Documentation

#define INTERACTORPLUGINVIEWEXTENSION (   CLASS_NAME,
  STRING_CLASS_NAME,
  BASE_INTERACTOR_STRING_NAME,
  VIEW_STRING_NAME,
  AUTHOR,
  DATE,
  DESCRIPTION,
  VERSION 
)
Value:
class CLASS_NAME : public tlp::Interactor {\
mutable tlp::Interactor* _component;\
public:\
std::string name() const { return std::string(STRING_CLASS_NAME); } \
std::string author() const { return std::string(AUTHOR); }\
std::string date() const { return std::string(DATE); } \
std::string info() const { return std::string(DESCRIPTION); } \
std::string release() const { return std::string(VERSION); }\
std::string tulipRelease() const { return std::string(TULIP_RELEASE); }\
std::string group() const { return getComponent()->group(); }\
CLASS_NAME(const PluginContext *):_component(NULL) {}\
bool isCompatible(const std::string& viewName) const { return viewName == VIEW_STRING_NAME; }\
QWidget* configurationWidget() const { return getComponent()->configurationWidget(); }\
unsigned int priority() const { return getComponent()->priority(); }\
QAction* action() const { return getComponent()->action(); }\
tlp::View* view() const { return getComponent()->view(); }\
QCursor cursor() const { return getComponent()->cursor(); }\
void construct() { getComponent()->construct(); }\
void setView(tlp::View* v) { getComponent()->setView(v); }\
void install(QObject* target) { getComponent()->install(target); }\
void uninstall() { getComponent()->uninstall(); }\
void undoIsDone() { getComponent()->undoIsDone(); }\
tlp::Interactor* getComponent() const {\
if(!_component) {\
_component = tlp::PluginLister::instance()->getPluginObject<Interactor>(BASE_INTERACTOR_STRING_NAME,NULL); assert(_component != NULL);\
}\
return _component;\
}\
};\
PLUGIN(CLASS_NAME)

Copy an existing Tulip interactor and sets it compatible with a given View.

This macro is used when you're making your own View and want to use an existing interactor with it. Interactors are declared to be compatible with a list of View. This macro extends the compatibility of an existing interactor by subclassing it.

Note
: This macro used the same interactor priority as the base interactor. To define your own priority, see INTERACTORPLUGINVIEWEXTENSIONWITHPRIORITY
Parameters
CLASS_NAMEThe name of the interactor class to generate.
STRING_CLASS_NAMEThe name of the interactor plugin to generate (see tlp::Plugin::name())
BASE_INTERACTOR_STRING_NAMEThe name of the interactor to extend
VIEW_STRING_NAMEThe name of the View to set the interactor compatible with
AUTHORsee tlp::Plugin::author()
DATEsee tlp::Plugin::date()
DESCRIPTIONsee tlp::Plugin::info()
VERSIONsee tlp::Plugin::version()

Definition at line 177 of file Interactor.h.

#define INTERACTORPLUGINVIEWEXTENSIONWITHPRIORITY (   CLASS_NAME,
  STRING_CLASS_NAME,
  BASE_INTERACTOR_STRING_NAME,
  VIEW_STRING_NAME,
  AUTHOR,
  DATE,
  DESCRIPTION,
  VERSION,
  PRIORITY 
)
Value:
class CLASS_NAME : public tlp::Interactor {\
mutable tlp::Interactor* _component;\
public:\
std::string name() const { return std::string(STRING_CLASS_NAME); } \
std::string author() const { return std::string(AUTHOR); }\
std::string date() const { return std::string(DATE); } \
std::string info() const { return std::string(DESCRIPTION); } \
std::string release() const { return std::string(VERSION); }\
std::string tulipRelease() const { return std::string(TULIP_RELEASE); }\
std::string group() const { return getComponent()->group(); }\
CLASS_NAME(const PluginContext *):_component(NULL) {}\
bool isCompatible(const std::string& viewName) const { return viewName == VIEW_STRING_NAME; }\
QWidget* configurationWidget() const { return getComponent()->configurationWidget(); }\
unsigned int priority() const { return PRIORITY; }\
QAction* action() const { return getComponent()->action(); }\
tlp::View* view() const { return getComponent()->view(); }\
QCursor cursor() const { return getComponent()->cursor(); }\
void construct() { getComponent()->construct(); }\
void setView(tlp::View* v) { getComponent()->setView(v); }\
void install(QObject* target) { getComponent()->install(target); }\
void uninstall() { getComponent()->uninstall(); }\
void undoIsDone() { getComponent()->undoIsDone(); }\
tlp::Interactor* getComponent() const {\
if(!_component) {\
_component = tlp::PluginLister::instance()->getPluginObject<Interactor>(BASE_INTERACTOR_STRING_NAME,NULL); assert(_component != NULL);\
}\
return _component;\
}\
};\
PLUGIN(CLASS_NAME)

Similar to INTERACTORPLUGINVIEWEXTENSION but allows to define the generated interactor's priority.

See Also
tlp::Interactor::priority()
INTERACTORPLUGINVIEWEXTENSION

Definition at line 216 of file Interactor.h.

#define PLUGIN (   C)
Value:
class C##Factory : public tlp::FactoryInterface { \
public: \
C##Factory() { \
tlp::PluginLister::registerPlugin(this); \
} \
~C##Factory(){} \
tlp::Plugin* createPluginObject(tlp::PluginContext* context) { \
C* tmp = new C(context); \
return tmp; \
} \
}; \
\
extern "C" { \
C##Factory C##FactoryInitializer; \
}

Register a plugin into the plugin system. This macro is mandatory in order to register a plugin into Tulip. This will generate a Factory that will handle the plugin's creation.

Parameters
CThe classname of the plugin.
Note
This macro should be called outside of the class body
// This sample shows a basic skeleton for a plugin class declaration:
class MyPlugin: public tlp::PluginBase { // tlp::PluginBase is replaced by the acutal Plugin interface (tlp::Algorithm, tlp::View, etc)
public:
PLUGININFORMATIONS("My plugin", "Me", "28/09/2012", "My first plugin example", "1.0", "")
// Class declaration and extra methods
};
PLUGIN(MyPlugin) // Register MyPlugin into Tulip
See Also
tlp::Plugin
PLUGININFORMATIONS
Examples:
clique_import/cliqueimport.cpp, and interactor_plugin/interactor_plugin.cpp.

Definition at line 229 of file Plugin.h.

#define PLUGININFORMATIONS (   NAME,
  AUTHOR,
  DATE,
  INFO,
  RELEASE,
  GROUP 
)
Value:
std::string name() const { return NAME; } \
std::string author() const { return AUTHOR; }\
std::string date() const { return DATE; } \
std::string info() const { return INFO; } \
std::string release() const { return RELEASE; }\
std::string tulipRelease() const { return TULIP_MM_RELEASE; }\
std::string group() const { return GROUP; }

Declare meta-informations for a plugin This is an helper macro that defines every function related to a plugin meta-informations (Plugin name, author, etc). When creating a new plugin, this macro avoids having to define pure-virtual methods located into the Plugin interface and put them on the same line.

Note
PLUGINIFORMATIONS should be declared into the Plugin's class body into the public scope
Parameters
NAMEThe plugin name as it will be registered into the plugins system (tlp::Plugin::name())
AUTHORThe author of the plugin (tlp::Plugin::author())
DATEThe creation date (tlp::Plugin::date())
INFOThe plugin's description (tlp::Plugin::info())
RELEASEThe plugin's version number (tlp::Plugin::version())
GROUPThe plugin's group (tlp::Plugin::group()). If the plugin does not belong to any group, set GROUP to "".
See Also
tlp::Plugin
PLUGIN
Examples:
clique_import/cliqueimport.cpp, and interactor_plugin/interactor_plugin.cpp.

Definition at line 194 of file Plugin.h.

Enumeration Type Documentation

The ParameterDirection enum describes how a parameter is passed to a plugin The parameter can be seen as passing parameters to a C++ functions and works as follow: .

  • IN_PARAM: The parameter is passes by value
  • OUT_PARAM: The parameter is a return value
  • INOUT_PARAM: The parameter is passed by reference.

Definition at line 46 of file WithParameter.h.

This enum describes callback actions for the underleying system when calling tlp::PluginProgress::progress(); .

  • TLP_CONTINUE: tells that the process monitored by the the progress should continue.
  • TLP_CANCEL: The process should be cancelled, reverting all changes since it was started.
  • TLP_STOP: The process should stop, leaving all the changes made since the beginning
See Also
tlp::PluginProgress
Enumerator:
TLP_CONTINUE 

The plugin should continue its execution.

TLP_CANCEL 

The plugin should cancel, reverting all performed changes since the plugin was called.

TLP_STOP 

The plugin should stop, leaving the graph in its current state.

Definition at line 57 of file PluginProgress.h.

Function Documentation

std::string tlp::demangleTlpClassName ( const char *  className)

Demangles the name of a C++ class defined in the tlp namespace. Simply removes the 'tlp::' prefix from the class name.

Returns
string The demangled name of a Tulip C++ class.
std::string tlp::getMajor ( const std::string &  release)

Splits the string and returns everything befor the first dot ('.'). This is used to return major version number, as version numbers are formatted as X.Y.Z, X being the major, Y the minor, and Z the patch version.

Returns
string The part of the string before the first dot.
std::string tlp::getMinor ( const std::string &  release)

Splits the string and return the minor version. If the string does not contain any dot, then 0 is returned. If the string contains only one dot (X.Y), then everything after the first dot is returned (Y). If the string is a full version with two dots (X.Y.Z), everything between the first and last dots is returned (Y). If there are more than two dots, everything between the first and last dots is returned.

void tlp::initTulipLib ( const char *  appDirPath = NULL)

Initializes the Tulip library. Looks for the Tulip plug-ins directory, and loads the plug-ins from it. The plug-ins directory can be defined in different ways, given by order of prevalence :

  1. the TLP_DIR environment variable, if it has a value
  2. the appDirPath parameter, if it is not NULL
  3. at that point, the Tulip paths will be retrieved from the path of the loaded Tulip shared library (you must dispose of a standard Tulip installation for that feature to work).
  4. a fallback value of 'C:/Tulip/lib/' on windows, or '/usr/local/lib/' on Unix.