Tulip
5.7.4
Large graphs analysis and drawing
|
#include <View.h>
Public Slots | |
void | addRedrawTrigger (tlp::Observable *) |
virtual void | applySettings () |
virtual void | centerView (bool graphChanged=false) |
virtual bool | checkOnClose () |
void | clearRedrawTriggers () |
virtual void | draw ()=0 |
void | emitDrawNeededSignal () |
virtual bool | getNodeOrEdgeAtViewportPos (int, int, node &, edge &) const |
virtual void | refresh () |
void | removeRedrawTrigger (tlp::Observable *) |
void | setCurrentInteractor (tlp::Interactor *currentInteractor) |
void | setGraph (tlp::Graph *graph) |
virtual void | setInteractors (const std::list< tlp::Interactor * > &) |
virtual void | setState (const tlp::DataSet &) |
virtual void | setupUi ()=0 |
void | treatEvent (const Event &) override |
virtual void | undoCallback () |
Signals | |
void | drawNeeded () |
void | graphSet (tlp::Graph *) |
void | interactorsChanged () |
Public Member Functions | |
View () | |
~View () override | |
std::string | category () const override |
virtual bool | centeredWhenAddedToWorkspace () |
virtual QGraphicsItem * | centralItem () const |
virtual std::list< QWidget * > | configurationWidgets () const |
tlp::Interactor * | currentInteractor () const |
tlp::Graph * | graph () const |
virtual QGraphicsView * | graphicsView () const =0 |
std::string | icon () const override |
const std::list< Interactor * > & | interactors () const |
virtual bool | interactorsEnabled () const |
virtual bool | rebuildSceneOnShowEvent () |
virtual void | resetGraphicsScene () |
void | setShowContextMenu (bool show) |
bool | showContextMenu (const QPoint &point, const QPointF &scenePoint) |
virtual QPixmap | snapshot (const QSize &outputSize=QSize()) const =0 |
virtual tlp::DataSet | state () const |
void | treatEvents (const std::vector< Event > &events) override |
QSet< tlp::Observable * > | triggers () 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 |
Public Member Functions inherited from tlp::Observable | |
void | addListener (Observable &listener) const |
void | addListener (Observable *const listener) const |
void | addObserver (Observable &observer) const |
void | addObserver (Observable *const observer) const |
unsigned int | countListeners () const |
unsigned int | countObservers () const |
unsigned int | getReceived () const |
unsigned int | getSent () const |
void | removeListener (Observable &listener) const |
void | removeListener (Observable *const listener) const |
void | removeObserver (Observable &observer) const |
void | removeObserver (Observable *const observer) const |
Protected Slots | |
void | activateTooltipAndUrlManager (QWidget *) |
virtual void | currentInteractorChanged (tlp::Interactor *) |
virtual void | fillContextMenu (QMenu *, const QPointF &) |
void | fillContextMenu (QMenu *menu, edge e) |
void | fillContextMenu (QMenu *menu, node n) |
virtual void | graphChanged (tlp::Graph *)=0 |
virtual void | graphDeleted (tlp::Graph *parentGraph)=0 |
virtual void | interactorsInstalled (const std::list< tlp::Interactor * > &interactors) |
void | toggleInteractors (const bool activate, const std::unordered_set< const char * > &exceptions) |
Protected Member Functions | |
DataSet | getState (Graph *graph) |
void | saveState () |
Protected Member Functions inherited from tlp::Observable | |
Observable (const Observable &) | |
bool | hasOnlookers () const |
void | observableDeleted () |
Observable & | operator= (const Observable &) |
void | sendEvent (const Event &message) |
virtual void | treatEvent (const Event &message) |
Additional Inherited Members | |
Static Public Member Functions inherited from tlp::Observable | |
static void | disableEventNotification () |
static void | enableEventNotification () |
static tlp::node | getNode (const tlp::Observable *obs) |
static Observable * | getObject (tlp::node n) |
static const tlp::VectorGraph & | getObservableGraph () |
static unsigned int | getScheduled (tlp::node n) |
static void | holdObservers () |
static bool | isAlive (tlp::node n) |
static unsigned int | observersHoldCounter () |
static void | unholdObservers () |
Protected Attributes inherited from tlp::Plugin | |
std::string | oldName |
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph.
A view takes the following elements as inputs:
tlp::DataSet
) which contains initialization parameters.As an output, a View must provide a QGraphicsView
instance where all drawing is done. User interaction on a View is handled by the tlp::Interactor class. Several interactors can be installed on the same view but there can be only one active interactor at the same time. In the end, the view can provide several configuration widgets used to set up additional parameters.
When a View gets created, the following methods will always be called in the following order:
Once the View is initialized, none of the previously mentioned methods, except View::setGraph(), can be called again. View::setGraph method may be called again to notify the view that another graph should be displayed (this may be a sub/parent graph of the previously displayed graph or a graph coming from a totally different hierarchy)
Views are meant to be managed by an overleying system. As a consequence, a view may not decide directly when to redraw. Thus, you should never call the View::draw() method. To notify the overleying system that your view needs to be redrawn, emit the View::drawNeeded() signal instead.
A tlp::View subclass automatically inherits from the tlp::Observable interface. The tlp::View interface also automatically listn to its active graph to trigger handling trigger when this graph gets deleted. When the graph associated to a View gets deleted, the View::graphDeleted() callback is triggered.
tlp::View::View | ( | ) |
Default constructor.
|
override |
|
protectedslot |
activate the management of tooltips and urls through the context menu
Qwidget | the widget to manage. |
|
slot |
Registers a new trigger for automatic view drawing. Triggers are tlp::Observable subclasses. Once registered, the view will listen to the trigger's events and emit the drawNeeded signal each time the Observable::treatEvents() callback is run. For more information about the Observable system,.
|
virtualslot |
This method applies settings changed in the configuration widgets This method may be called from the overleying system in various situations. The View is expected to apply settings in an optimized way to prevent extra redraws. By default, this method does nothing.
|
inlineoverridevirtual |
A string identifier for a plugin used for categorization purposes.
Implements tlp::Plugin.
|
virtualslot |
Reset the visualization to the center. This method is called after major changes into the data structure. At this point, the user point of view should be reset and brought back to a point where all the data can be seen.
|
virtual |
defines which item is considered as the central item in the view. The central item is considered to be a background item that will be set as parent of every graphics item added by the workspace into the view. By default, this method returns nullptr, which means that no central item is defined.
Reimplemented in tlp::ViewWidget.
|
inlinevirtualslot |
|
slot |
Clears the list of attached triggers This method removes all triggers associated to the View.
|
virtual |
Reimplemented in tlp::GlMainView.
tlp::Interactor* tlp::View::currentInteractor | ( | ) | const |
|
protectedvirtualslot |
Callback method after setCurrentInteractor() was called. At this point, a call to View::currentInteractor() is considered valid and return the newly active interactor.
|
pure virtualslot |
|
signal |
Inform the overlying subsystem that this view needs to be drawn.
|
slot |
This function emit the signal drawNeeded.
|
protectedvirtualslot |
fills the context menu with entries related to the view. This method is called whenever the context menu is displayed on the panel.
QMenu | The popup menu that will be displayed. This menu should be populated with context action related to the panel. |
|
protectedslot |
fills the context menu with entries related to the edge.
|
protectedslot |
fills the context menu with entries related to the node.
|
inlinevirtualslot |
indicate which node or edge is under the (x, y) position in graphicsView()->viewport()
x | the x axis coordinate |
y | the y axis coordinate |
n | on return will give the found node |
e | on return will give the found edge |
retrieve the view saved state associated to the graph
tlp::Graph* tlp::View::graph | ( | ) | const |
|
protectedpure virtualslot |
Callback method after setGraph() was called. At this point, a call to View::graph() is considered valid and return the lastly set graph.
|
protectedpure virtualslot |
Called when the graph associated to the view gets deleted. This method should call setGraph to input a new graph pointer (nullptr or valid)
parentGraph | The parent of the graph that was just deleted. If there is no parent available (eg. the graph was root), parentGraph is nullptr |
|
pure virtual |
QGraphicsView
instance. Implemented in tlp::ViewWidget.
|
signal |
Emitted after the setGraph method has been called.
|
inlineoverridevirtual |
The icon (preferably a thumbnail) of the plugin.
Reimplemented from tlp::Plugin.
|
inline |
|
inlinevirtual |
|
protectedvirtualslot |
Callback method after setInteractors() was called. At this point, a call to View::interactors() is considered valid.
|
inlinevirtualslot |
|
slot |
Removes a trigger from the list of registered triggers. Event coming from this trigger will no longer trigger the drawNeeded signal.
|
protected |
Save view state associated to the current graph.
|
slot |
defines the active interactor that will receive user inputs.
|
slot |
Defines the graph that should be displayed by the View.
|
virtualslot |
defines the list of interactors available on this View
|
inline |
|
virtualslot |
Restores the state of the view. DataSet passed down to this method can come from a previous backup or be generated by the overlaying system. It's up to the view to use this data or not.
Reimplemented in tlp::GlMainView.
|
pure virtualslot |
Sets up GUI elements belonging to the View. This method is called once the initial state as been set (using setGraph and setState) and is called only once.
bool tlp::View::showContextMenu | ( | const QPoint & | point, |
const QPointF & | scenePoint | ||
) |
This method is called whenever the context menu is required on the view.
point | The screen coordinates where the context menu should be displayed. |
|
pure virtual |
Takes a snapshot of the view's screen and saves it into the given pixmap. The snapshot is scaled to outputSize. If a null size is given, the snapshot is to be on a 1:1 ratio.
Implemented in tlp::ViewWidget, and tlp::GlMainView.
|
virtual |
Backup the state of the view. This method is used to restore the View's parameters when it's re-opened.
Reimplemented in tlp::GlMainView.
|
protectedslot |
Activate or deactivate interactors in the view.
activate | set to true (resp. false) to enable (resp. disable) interactors |
exceptions | a set of interactor names whose bevahior has to be left unchanged |
|
overrideslot |
This method is inherited from tlp::Observable and allows the view to trigger custom callback when its associated graph gets deleted.
|
overridevirtual |
reimplemented from tlp::Observable to provide the triggers mechanism.
Reimplemented from tlp::Observable.
QSet<tlp::Observable *> tlp::View::triggers | ( | ) | const |
|
virtualslot |
This method is a callback to notify the panel that the pop() method (undo) has just been called on the graph. By default, this method will make a call to centerView()