Tulip
5.3.1
Large graphs analysis and drawing
|
#include <Perspective.h>
Public Types | |
enum | ProgressOption { NoProgressOption = 0x0, IsPreviewable = 0x1, IsCancellable = 0x2, IsStoppable = 0x4 } |
Public Slots | |
virtual bool | terminated () |
Signals | |
void | resetWindowTitle () |
Public Member Functions | |
Perspective (const tlp::PluginContext *c) | |
std::string | category () const override |
virtual void | centerPanelsForGraph (tlp::Graph *) |
std::string | icon () const override |
bool | isReservedPropertyName (QString name) |
QMainWindow * | mainWindow () const |
virtual PluginProgress * | progress (ProgressOptions options=ProgressOptions(IsPreviewable|IsStoppable|IsCancellable)) |
virtual void | redrawPanels (bool center=false)=0 |
void | registerReservedProperty (QString) |
void | resetTitle () |
virtual void | start (tlp::PluginProgress *progress)=0 |
virtual void | usage (std::string &usage_str) const |
Public Member Functions inherited from tlp::Plugin | |
virtual std::string | author () const =0 |
virtual std::string | date () const =0 |
void | declareDeprecatedName (const std::string &oldName) |
std::string | deprecatedName () |
virtual std::string | group () const =0 |
virtual int | id () const |
virtual std::string | info () const =0 |
virtual std::string | major () const |
virtual std::string | minor () const |
virtual std::string | name () const =0 |
virtual std::string | programmingLanguage () const |
virtual std::string | release () const =0 |
virtual std::string | tulipMajor () const |
virtual std::string | tulipMinor () const |
virtual std::string | tulipRelease () const =0 |
Static Public Member Functions | |
static tlp::Perspective * | instance () |
static void | redirectStatusTipOfMenu (QMenu *menu) |
static void | setInstance (tlp::Perspective *) |
static void | showStatusMessage (const QString &) |
static void | showStatusMessage (const std::string &msg) |
template<typename T > | |
static T * | typedInstance () |
Protected Slots | |
void | createPerspective (const QString &name) |
virtual void | openProjectFile (const QString &path) |
void | showAboutPage () |
void | showErrorMessage (const QString &title, const QString &s) |
void | showFullScreen (bool f) |
void | showPluginsCenter () |
void | showProjectsPage () |
void | showStatusTipOf (QAction *action) |
void | showTrayMessage (const QString &s) |
Protected Member Functions | |
bool | checkSocketConnected () |
Protected Attributes | |
QString | _externalFile |
QMainWindow * | _mainWindow |
QVariantMap | _parameters |
TulipProject * | _project |
Protected Attributes inherited from tlp::Plugin | |
std::string | oldName |
A Perspective is a Tulip plugin that completely re-defines the user interface.
A Perspective aims at using the multiple features available in Tulip to create a complete, coherent workflow dedicated to a particular use-case. Perspectives are chosen by the user when first running the Tulip agent. The main perspective is called "Tulip". This perspective unveils all the Tulip features and aims at being a protyping and researching platform.
A Perspective always acts in its own process and communicate with the Tulip agent via TCP sockets. Thus, it is the Perspective's responsibility to offer the possibility to display graphs, run plugins, etc. A lot of helper classes can be found into the tulip-gui API like pre-made widgets, Qt models, etc.
Perspective's data is stored into a TulipProject. A TulipProject is an archive capable of containing heterogeneous data (like multiple graphs, textures, extra files, etc). When a TulipProject gets saved by a perspective, it is linked to it in its meta-information. Creating a Perspective primarily into implementing the start() method that builds the GUI. This method will be called by the overleying system when a new perspective is launched. The rest of the logic implementation is left to the developer.
Definition at line 82 of file Perspective.h.
tlp::Perspective::Perspective | ( | const tlp::PluginContext * | c | ) |
Constructs a perspective object.
|
inlineoverridevirtual |
A string identifier for a plugin used for categorization purposes.
Implements tlp::Plugin.
Definition at line 146 of file Perspective.h.
|
virtual |
Tells the perspective that the visualizations for a given graph should be centered.
|
protectedslot |
Send a message to the Tulip agent to make him open a new Perspective without a project.
name | The name of the PErspective to create. |
|
inlineoverridevirtual |
The icon (preferably a thumbnail) of the plugin.
Reimplemented from tlp::Plugin.
Definition at line 149 of file Perspective.h.
|
static |
Since a Perspective has its own process to work in, there can be only one perspective instance by process. In order to ease the development process, Perspective are available as a singleton in order for child widgets and plugins to be able to access to the features of a Perspective. This architecture was added for developers who want to create an application containing several plugins grouped into Perspective.
bool tlp::Perspective::isReservedPropertyName | ( | QString | name | ) |
Checks if the name corresponds to a reserved properties. Perspectives are allowed to reserve graph properties. A reserved graph properties is a core property that cannot be deleted by the user and cannot be renamed.
QMainWindow* tlp::Perspective::mainWindow | ( | ) | const |
|
protectedvirtualslot |
Send a message to the Tulip agent to make him open a new Tulip Project.
path | the absolute path of the project file. |
|
virtual |
Creates a progress handler and returns it. This method allows lower-level widgets to create top-level progress bars directly from the Perspective.
|
static |
a static function to enable the redirection of the statusTip or toolTip of menu actions on mainWindow->statusBar()
|
pure virtual |
Tells the perspective that the graph visualizations should be redrawn.
center | if true, visualization should also be centered (eg. the layout has been changed) |
void tlp::Perspective::registerReservedProperty | ( | QString | ) |
Sets a new property name as registered.
|
static |
Called at the beginning of the tulip_perspective to set the Perspective singleton.
|
protectedslot |
Send a message to the Tulip agent to make him display the "About us" page.
|
protectedslot |
Send a message to the Tulip agent to make him display an error message that will be shown in the system notification as well as on the welcome page.
title | The message's title. |
s | The message to display. |
|
protectedslot |
Call this slot to swith to full screen or windowed mode.
f | is true, switch to full screen mode. If false, switch to windowed mode |
|
protectedslot |
Send a message to the Tulip agent to make him display the Plugins Center page.
|
protectedslot |
Send a message to the Tulip agent to make him display the Projects page.
|
static |
a static function to ease the display of messages on mainWindow()->statusBar()
|
inlinestatic |
a static function to ease the display of messages on mainWindow()->statusBar()
Definition at line 247 of file Perspective.h.
|
protectedslot |
Show the statusTip (or the toolTip) of an action on mainWindow()->statusBar()
action | a QAction |
|
protectedslot |
Send a message to the Tulip agent to make him display a message in the system notification area.
s | The message to display. |
|
pure virtual |
Build the main window GUI and starts the workflow. When this method is called, it means that the Perspective is reponsible of the application workflow until the application is closed by the user.
progress | A progress handler |
|
inlinevirtualslot |
Called when the user wants to close the application.
Definition at line 263 of file Perspective.h.
|
inlinestatic |
Definition at line 174 of file Perspective.h.
|
inlinevirtual |
usage Displays a usage message when called from the tulip_perspective executable
Definition at line 337 of file Perspective.h.
|
protected |
If the user provided a file to the tulip_perspective but this file is not recognized as a valid TulipProject, the full path of the file will be stored into the _externalFile member.
Definition at line 128 of file Perspective.h.
|
protected |
The main window on which the perspective should build the GUI.
It is not the Perspective's responsibility to destroy the main window when the application gets closed. Generally speaking, destorying the _mainWindow pointer could lead to undefined behavior.
Definition at line 120 of file Perspective.h.
|
protected |
Contains extra parameters that have not been parsed by the overleying system. Those are considered to be Perspective-specific and are forwarded into this variable.
Definition at line 134 of file Perspective.h.
|
protected |
The project associated to this perspective. This project can be empty or contain data depending on how the Perspective was launched: To launch a perspective, the tulip_perspective executable is called with the following arguments:
Definition at line 111 of file Perspective.h.