Skip to content

Writing Plug‐ins

std::gregwar edited this page Jun 27, 2017 · 3 revisions

The main aim of ELVE is to provide basic visualisation and layouting engine; it comes with few elementary features and can then be extended to fit your needs.

This is done trough plugins and there exist a plugin type for each of the stages of the engine:

The first thing you want to do when writing a plugin is following the steps in PluginsTemplates/Readme.md file to create your plugin's skeleton from a template. Then just open .h and .cpp file in your plugin and follow the comments to configure the blank plugin.

Specialised instructions for each plugin type is available on its plugin page.

Plug-in Options

Theses options are the ones beeing passed as arguments when invoking commands from the CLI. They are crucial to controlling the behaviour of the plugins. When writing plugin's, exposing the right set of options is crucial and done this way (sample from The LevelLayout plug-in).

LevelLayout::LevelLayout() {
opts().add_options()
            ("k_const,k",po::value(&mK)->default_value(mK),"base k constant of the springs")
            ("l_zero,l",po::value(&mL0)->default_value(mL0),"length of the springs at rest")
            ("damp,d",po::value(&mDamp)->default_value(mDamp),"damping factor of the points")
            ("unitLength,u",po::value(&mMinUnit)->default_value(mMinUnit),"minimal level unit length in pixels")
            ("iosUnitLength,o",po::value(&mMinIOUnit)->default_value(mMinIOUnit), "minimal space between two I/Os")
            ("repulsion,r",po::value(&mRepulsion)->default_value(mRepulsion),"repulsion force between nodes")
            ("interleave,i","input node interleaving")
            ;
}

Boost-program-options handle is available trough the opts() method. It allows constructing the set of options the user can set when invoking your plugin. For more details about the use of boost options, see boost documentation.

Clone this wiki locally