Tulip  4.6.0
Better Visualization Through Research
tlp::GlMainView Class Reference

#include <GlMainView.h>

+ Inheritance diagram for tlp::GlMainView:
+ Collaboration diagram for tlp::GlMainView:

List of all members.

Public Types

enum  OverviewPosition { OVERVIEW_TOP_LEFT, OVERVIEW_TOP_RIGHT, OVERVIEW_BOTTOM_LEFT, OVERVIEW_BOTTOM_RIGHT }

Public Slots

void applySettings ()
virtual void centerView (bool graphChanged=false)
virtual void draw ()
virtual void drawOverview (bool generatePixmap=true)
void openSnapshotDialog ()
void redraw ()
virtual void refresh ()
void setAdvancedAntiAliasing (bool)
void setAntiAliasing (bool)
void setOverviewVisible (bool)
void setViewOrtho (bool)
void undoCallback ()

Public Member Functions

virtual QList< QWidget * > configurationWidgets () const
tlp::GlMainWidgetgetGlMainWidget () const
OverviewPosition overviewPosition () const
bool overviewVisible () const
void setOverviewPosition (const OverviewPosition &position)
void setUpdateOverview (bool updateOverview)
QPixmap snapshot (const QSize &outputSize=QSize()) const
bool updateOverview () const

Protected Slots

void delayedCenterView ()
void fillContextMenu (QMenu *menu, const QPointF &)
virtual void glMainViewDrawn (bool graphChanged)
virtual void sceneRectChanged (const QRectF &)
void setQuickAccessBarVisible (bool)

Protected Member Functions

void assignNewGlMainWidget (GlMainWidget *glMainWidget, bool deleteOldGlMainWidget=true)
bool eventFilter (QObject *obj, QEvent *event)
tlp::GlOverviewGraphicsItem * overviewItem () const
bool quickAccessBarVisible () const
virtual void setupWidget ()

Protected Attributes

OverviewPosition _overviewPosition
tlp::QuickAccessBar * _quickAccessBar
tlp::SceneConfigWidget * _sceneConfigurationWidget
tlp::SceneLayersConfigWidget * _sceneLayersConfigurationWidget
bool _updateOverview

Detailed Description

An abstract view that displays a GlMainWidget as its central widget.

The GlMainView subclasses ViewWidget and always uses a GlMainWidget as the central widget of the panel. It also adds the following features:

  • An overview of the scene that can be toggled on or off.
  • Some configuration widgets that modify the rendering parameters.
  • A quick access bar widget that allows the user to quickly modify some of the most used rendering parameters and graph properties (nodes color, edges display, etc)
  • The possibility to make snapshots of the current scene

Subclassing GlMainView means you will only want to display graphs in a single GlMainWidget. Switching the central widget can only be achieved from the ViewWidget class.

Warning:
It is strongly unadvised to re-implement methods already implemented into tlp::View or tlp::ViewWidget. If you have to add custom behavior to those method, make sure to call the upper-class methods first:
 void MyView::setupWidget() { // Where MyView is a subclass of tlp::GlMainView
   GlMainView::setupWidget(); // call this first
   // insert custom behavior here
 }
See also:
tlp::ViewWidget
Examples:
interactor_plugin/interactor_plugin.cpp.

Definition at line 61 of file GlMainView.h.


Member Function Documentation

void tlp::GlMainView::applySettings ( ) [virtual, slot]

Force the settings set in the configuration widgets to be re-applied.

Reimplemented from tlp::View.

virtual void tlp::GlMainView::centerView ( bool  graphChanged = false) [virtual, slot]

Centers the scene's camera.

Reimplemented from tlp::View.

virtual QList<QWidget*> tlp::GlMainView::configurationWidgets ( ) const [virtual]
Returns:
a list of widgets that can be used to set up the view. Since several widgets can be retrived, user will be able to select them from a combo box where each widget will be identified by its windowsTitle.
See also:
View::applySettings()
Warning:
This method must not instantiate configuration widgets on the fly.

Reimplemented from tlp::View.

virtual void tlp::GlMainView::draw ( ) [virtual, slot]

Calls GlMainWidget::draw();.

Reimplemented from tlp::ViewWidget.

virtual void tlp::GlMainView::drawOverview ( bool  generatePixmap = true) [virtual, slot]

Force the overview to be redrawn. Since GlMainView already detects graph's modifications, this method should not be called manually to avoid extra rendering.

void tlp::GlMainView::fillContextMenu ( QMenu *  ,
const QPointF &   
) [protected, virtual, slot]

fills the context menu with entries related to the view. This method is called whenever the context menu is displayed on the panel.

Parameters:
QMenuThe popup menu that will be displayed. This menu should be populated with context action related to the panel.

Reimplemented from tlp::View.

Display a dialog that takes a snapshot of the current scene.

virtual void tlp::GlMainView::refresh ( ) [virtual, slot]

Calls GlMainWidget::redraw();.

Reimplemented from tlp::View.

void tlp::GlMainView::setOverviewVisible ( bool  ) [slot]

Toggles the overview on or off.

virtual void tlp::GlMainView::setupWidget ( ) [protected, virtual]

Sets up the central widget. This is similar to View::setupUi in the sense that the purpose of setupWidget is to construct the GUI element.

Warning:
This method MUST call the setCentralWidget to provide the ViewWidget with a valid widget.

Implements tlp::ViewWidget.

void tlp::GlMainView::setViewOrtho ( bool  ) [slot]

Toggles the orthogonal projection on or off, then draws.

QPixmap tlp::GlMainView::snapshot ( const QSize &  outputSize = QSize()) const [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.

Returns:
A non-null pixmap of the snapshot was correctly taken.

Reimplemented from tlp::ViewWidget.

void tlp::GlMainView::undoCallback ( ) [virtual, slot]

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()

Reimplemented from tlp::View.

 All Classes Files Functions Variables Enumerations Enumerator Properties