ELVE  1
ELVE Logic Visualization Explorer
Elve::LayoutPlugin Class Reference

The LayoutPlugin abstract class. More...

#include <LayoutPlugin.h>

Public Member Functions

 LayoutPlugin ()
 LayoutPlugin.
 LayoutPlugin (const LayoutPlugin &other)
 copy constructor to inherit option values
void clear ()
 clear, called when re-using the layout object for another graph
virtual void setGraph (SharedGraph graph)=0
 set the graph that this layout must animate
virtual QJsonObject json () const
virtual void fromJson (const QJsonObject &layout)
QVector2D startPosition (const NodeID &id)
 startPosition of a Node
virtual void setGraph (SharedEGraph g, const NodePositions &positions)
 alternate setGraph where you can provide initial position
virtual void quickSim (size_t ticks)
 tells the plugin to simulate a certain number of ticks in a quick way
virtual void tick (float dt, bool fast)
 advance the simulation one step
virtual SharedLayout create ()=0
 make a shared copy of this layout
virtual QString name () const =0
 the main name of the layout displayed in the GUIs
virtual std::string cliName ()=0
 the command line interface name of the GUI
virtual void uiStart (Elve::GraphWidgetListener *listener, const SharedEGraph &graph)
 called when the command is started from the GUI
Systemsystem ()
 get the default physical system
const Systemsystem () const
 get a const reference to the default physical system
virtual ~LayoutPlugin ()
 ~LayoutPlugin virtual for inheritance

Detailed Description

The LayoutPlugin abstract class.

This QPlugin interface allow to add new layout types and systems to elve. It redefines how the nodes are positioned and animated.

As Graph nodes don't have a position on their own, the Layouts output a collection of Points that are then linked with movable objects in the viewport.

Definition at line 33 of file LayoutPlugin.h.

Inheritance diagram for Elve::LayoutPlugin:
Elve::Plugin

Constructor & Destructor Documentation

copy constructor to inherit option values

Parameters:
other

Definition at line 17 of file LayoutPlugin.cpp.


Member Function Documentation

clear, called when re-using the layout object for another graph

Deprecated:
{This was used at a point where elve had only one viewport.}

Definition at line 46 of file LayoutPlugin.cpp.

virtual std::string Elve::LayoutPlugin::cliName ( ) [pure virtual]

the command line interface name of the GUI

Returns:
should not contain spaces
virtual SharedLayout Elve::LayoutPlugin::create ( ) [pure virtual]

make a shared copy of this layout

Returns:
virtual QString Elve::LayoutPlugin::name ( ) const [pure virtual]

the main name of the layout displayed in the GUIs

Returns:
void Elve::LayoutPlugin::quickSim ( size_t  ticks) [virtual]

tells the plugin to simulate a certain number of ticks in a quick way

Parameters:
ticksthe tick count

Default implementation of this method just call tick repeatedly

Definition at line 94 of file LayoutPlugin.cpp.

virtual void Elve::LayoutPlugin::setGraph ( SharedGraph  graph) [pure virtual]

set the graph that this layout must animate

Parameters:
graphA graph to genereate layout for
void Elve::LayoutPlugin::setGraph ( SharedEGraph  g,
const NodePositions &  positions 
) [virtual]

alternate setGraph where you can provide initial position

Parameters:
gthe graph
positionsa map of nodes positions

This is the entry point of elve's core to the plugin, the default implementation of this method calls the other pure virtual method after optionnaly retrieving the ancient positions

Definition at line 39 of file LayoutPlugin.cpp.

QVector2D Elve::LayoutPlugin::startPosition ( const NodeID &  id)

startPosition of a Node

Parameters:
idthe node id
Returns:
Either the previous position or a random one

This is used to abstract the place of the layout in the pipeline, by calling this method to get starting position of a particular node, one ensure that if the layout is succeding another in the viewport, simulation will continue from the same state as before but with potentially new constraints.

Definition at line 23 of file LayoutPlugin.cpp.

get the default physical system

Returns:

Definition at line 50 of file LayoutPlugin.cpp.

get a const reference to the default physical system

Returns:

Definition at line 85 of file LayoutPlugin.cpp.

void Elve::LayoutPlugin::tick ( float  dt,
bool  fast 
) [virtual]

advance the simulation one step

Parameters:
dttime delta in seconds since last invoke
fastindicate that the simulation do not need to acknowledge the gui part.

The default implementation of this method ticks the default physical system.

Definition at line 90 of file LayoutPlugin.cpp.

void Elve::LayoutPlugin::uiStart ( Elve::GraphWidgetListener listener,
const SharedEGraph &  graph 
) [virtual]

called when the command is started from the GUI

Parameters:
listenerthe command listener currently bound
graphthe graph

Usefull if you want to display custom GUI wizard or dialogs when your plugin is triggered, You can do anything in this method but don't forget that it is executed as part of the Qt event loop and will stall everything until it returns.

Definition at line 108 of file LayoutPlugin.cpp.

List of all members.


The documentation for this class was generated from the following files:
 All Classes Functions