Tulip  5.2.0
Large graphs analysis and drawing
Plugins system

Classes

class  tlp::Algorithm
 
class  tlp::AlgorithmContext
 
class  tlp::BooleanAlgorithm
 
class  tlp::ColorAlgorithm
 
struct  tlp::Dependency
 
class  tlp::DoubleAlgorithm
 
class  tlp::GlMainView
 
class  tlp::IntegerAlgorithm
 
class  tlp::Interactor
 
class  tlp::InteractorLister
 
class  tlp::LayoutAlgorithm
 
class  tlp::ParameterDescription
 
struct  tlp::ParameterDescriptionList
 
class  tlp::Perspective
 
class  tlp::PerspectiveContext
 
class  tlp::Plugin
 
class  tlp::PluginContext
 
class  tlp::PluginLister
 
struct  tlp::PluginLoader
 
struct  tlp::PluginLoaderTxt
 
class  tlp::PluginProgress
 
class  tlp::ProgressPreviewHandler
 
class  tlp::PropertyAlgorithm
 
class  tlp::SizeAlgorithm
 
class  tlp::StringAlgorithm
 
class  tlp::TemplateAlgorithm< Property >
 
class  tlp::TulipProject
 
class  tlp::View
 
class  tlp::ViewWidget
 
class  tlp::WithDependency
 
struct  tlp::WithParameter
 

Macros

#define PLUGIN(C)
 
#define PLUGININFORMATION(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::demangleClassName (const char *className, bool hideTlp=false)
 
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=nullptr)
 

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 PLUGIN (   C)
Value:
class C##Factory : public tlp::FactoryInterface { \
public: \
C##Factory() { \
} \
~C##Factory() {} \
tlp::Plugin *createPluginObject(tlp::PluginContext *context) { \
C *tmp = new C(context); \
return tmp; \
} \
}; \
\
extern "C" { \
C##Factory C##FactoryInitializer; \
}
static void registerPlugin(FactoryInterface *objectFactory)
Registers a plugin into Tulip.
Contains runtime parameters for a plugin.
Definition: PluginContext.h:42

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 actual Plugin
interface (tlp::Algorithm, tlp::View, etc)
public:
PLUGININFORMATION("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
PLUGININFORMATION
Examples:
clique_import/cliqueimport.cpp, and interactor_plugin/interactor_plugin.cpp.

Definition at line 285 of file Plugin.h.

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

Declare meta-information for a plugin This is an helper macro that defines every function related to a plugin meta-information (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
PLUGINIFORMATION 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 233 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 underlaying 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 62 of file PluginProgress.h.

Function Documentation

std::string tlp::demangleClassName ( const char *  className,
bool  hideTlp = false 
)

Demangles the name of a C++ class.

Parameters
classNameThe mangled name of a class
hideTlpa flag to indicate if the 'tlp::' prefix
Returns
string The demangled name of a Tulip C++ class.

+ Here is the caller graph for this function:

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

Demangles the name of a C++ class defined in the tlp namespace.

Parameters
classNameThe mangled name of a class
Returns
string The demangled name of a Tulip C++ class without the tlp:: prefix

Definition at line 75 of file TlpTools.h.

+ Here is the call graph for this function:

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 = nullptr)

Initializes the Tulip library. Looks for the Tulip plug-ins directory. 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 nullptr
  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.