Overview     Modules     Class Hierarchy     Classes     Members  

Provide an abstract view with OpenGl rendering. More...

#include <GlMainView.h>

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

Public Slots

virtual void draw ()
virtual void refresh ()
virtual void hideOverview (bool)
virtual void displayOverview (bool display)
virtual void showDialog (QAction *action)
- Public Slots inherited from tlp::AbstractView
bool eventFilter (QObject *object, QEvent *event)
virtual void exportImage (QAction *action)
- Public Slots inherited from tlp::View
virtual void setGraph (Graph *graph)=0
 Sets the Graph on this View.
virtual void draw ()=0
 Draws the View from scratch, i.e. reading the Graph, and drawind all the nodes and edges depending on their position, colors, etc... This drawing is then stored to be re-used when a refresh is all you need. Then, the interactors are drawn. This is pretty resource-hungry, if you just need to redraw the interactors or only the selection changed, use refresh.
virtual void refresh ()=0
 Refreshes the view, using the backed up drawing that draw stored. Then the interactors are drawn. This is usefull when the selection changed, but nothing else in the Graph changed (color, size, layout, ...), or when an interactor changed and needs re-drawing. This is way less resource-hungry than draw().
virtual void init ()=0
 Centers and draws the view. Calls centerview() [where applicable], then draw(). This might be removed in a future version (3.6 or later) as all this does is calling centerview on the GlMainWidget if this is a GlMainView. Adding a centerView function in View would allow to remove this function.

Public Member Functions

 GlMainView ()
virtual ~GlMainView ()
virtual QWidget * construct (QWidget *parent)
Graph * getGraph ()
virtual GlMainWidgetgetGlMainWidget ()
virtual void createPicture (const std::string &pictureName, int width=0, int height=0)
virtual bool createPicture (const std::string &pictureName, int width, int height, bool center, int zoom=1, int xOffset=0, int yOffset=0)
virtual QImage createPicture (int width, int height, bool center, int zoom=1, int xOffset=0, int yOffset=0)
virtual void buildContextMenu (QObject *object, QContextMenuEvent *event, QMenu *contextMenu)
GWOverviewWidgetgetOverviewWidget ()
QAction * getOverviewAction ()
- Public Member Functions inherited from tlp::AbstractView
 AbstractView ()
virtual ~AbstractView ()
QWidget * getWidget ()
virtual void setInteractors (const std::list< Interactor * > &interactorsList)
virtual std::list< Interactor * > getInteractors ()
virtual void setActiveInteractor (Interactor *interactor)
InteractorgetActiveInteractor ()
QWidget * getCentralWidget () const
bool savePicture (const std::string &pictureName, int width, int height, bool center, int zoom=1, int xOffset=0, int yOffset=0)
 Default implementation of the savePicture function. Use the image objects returned by the createPicture function and save it to a picture file on disk.
- Public Member Functions inherited from tlp::View
virtual ~View ()
virtual void setData (Graph *graph, DataSet dataSet)=0
 Set the View's Graph and DataSet.
virtual void getData (Graph **graph, DataSet *dataSet)=0
 Gets the Graph and DataSet of the view.
virtual std::list< std::pair
< QWidget *, std::string > > 
getConfigurationWidget ()
 Returns the configuration widgets this view should use. These widgets will be displayed in the left dock of the MainController, in the View Editor tab. Each widget will be in a tab whose text is the string of the pair.
virtual std::string getRealViewName () const
 Return the real view name (if "" the real name is the name given by the plugin).
virtual void undoIsDone ()
 This function is called when an undo is performed by the controller.

Protected Attributes

GlMainWidgetmainWidget
QDockWidget * overviewDock
GWOverviewWidgetoverviewWidget
QFrame * overviewFrame
QMenu * dialogMenu
QAction * overviewAction
- Protected Attributes inherited from tlp::AbstractView
QWidget * widget
QVBoxLayout * mainLayout
QWidget * centralWidget
std::list< Interactor * > interactors
InteractoractiveInteractor
QMenu * exportImageMenu

Additional Inherited Members

- Signals inherited from tlp::View
void elementSelected (unsigned int eltId, bool isNode)
 This signal is emitted when a specific element is selected in the view.
void requestChangeGraph (tlp::View *view, tlp::Graph *graph)
 This signal is emitted when the view wants to change its graph.
- Protected Member Functions inherited from tlp::AbstractView
virtual void specificEventFilter (QObject *, QEvent *)
virtual void computeContextMenuAction (QAction *)
void setCentralWidget (QWidget *widget)

Detailed Description

Provide an abstract view with OpenGl rendering.

This class provide an abstract view with OpenGl rendering and overview To do this rendering GlMainView class is use

Constructor & Destructor Documentation

tlp::GlMainView::GlMainView ( )

Basic contructor

virtual tlp::GlMainView::~GlMainView ( )
virtual

Member Function Documentation

virtual void tlp::GlMainView::buildContextMenu ( QObject *  object,
QContextMenuEvent *  event,
QMenu *  contextMenu 
)
virtual

Build context menu for this view

Reimplemented from tlp::AbstractView.

Reimplemented in tlp::NodeLinkDiagramComponent.

virtual QWidget* tlp::GlMainView::construct ( QWidget *  parent)
virtual

Construct this view

Warning
If your view inherit of GlMainView you must extend construct function and in this new function call GlMainView::construct(QWidget *)

Reimplemented from tlp::AbstractView.

Reimplemented in tlp::NodeLinkDiagramComponent.

virtual void tlp::GlMainView::createPicture ( const std::string &  pictureName,
int  width = 0,
int  height = 0 
)
virtual

Take a snapshot of the view and put it in a picture

Deprecated:
In Tulip 4.x.y this function will be replace by void createPicture(const string &pictureName,int width, int height, bool center, int zoom, int xOffset, int yOffset)

Reimplemented from tlp::View.

virtual bool tlp::GlMainView::createPicture ( const std::string &  pictureName,
int  width,
int  height,
bool  center,
int  zoom = 1,
int  xOffset = 0,
int  yOffset = 0 
)
virtual

Take a snapshot of the view like old createPicture function but we add some parameters

Parameters
pictureName: name of the picture with extension, extension is used to encode the picture
width: width of the picture
height: height of the picture
center: if we do a center view before create picture or use the current zoom and pan
zoom: create a picture of a sub part of the view : with zoom=0 : create only one picture with entire view, with zoom=N : the view is cut into 2^N part in width and height
xOffset: this parameters is used to know the part of the view to render if zoom!=0 : xOffset must be : 0 <= xOffset < 2^zoom
yOffset: this parameters is used to know the part of the view to render if zoom!=0 : yOffset must be : 0 <= yOffset < 2^zoom

Reimplemented from tlp::View.

virtual QImage tlp::GlMainView::createPicture ( int  width,
int  height,
bool  center,
int  zoom = 1,
int  xOffset = 0,
int  yOffset = 0 
)
virtual

Take a snapshot of the view like old createPicture function and return a QImage

Parameters
width: width of the picture
height: height of the picture
center: if we do a center view before create picture or use the current zoom and pan
zoom: create a picture of a sub part of the view : with zoom=0 : create only one picture with entire view, with zoom=N : the view is cut into 2^N part in width and height
xOffset: this parameters is used to know the part of the view to render if zoom!=0 : xOffset must be : 0 <= xOffset < 2^zoom
yOffset: this parameters is used to know the part of the view to render if zoom!=0 : yOffset must be : 0 <= yOffset < 2^zoom

Reimplemented from tlp::View.

virtual void tlp::GlMainView::displayOverview ( bool  display)
inlinevirtualslot
virtual void tlp::GlMainView::draw ( )
virtualslot

Draw the OpenGl widget

virtual GlMainWidget* tlp::GlMainView::getGlMainWidget ( )
virtual

You can call this function if you want to have the GlMainWidget of this view If this view doesn't use GlMainWidget : this function return NULL This function is use to export a view to a picture

Graph* tlp::GlMainView::getGraph ( )
virtual

get the graph use in this view

Returns
the graph use in this view

Implements tlp::View.

QAction* tlp::GlMainView::getOverviewAction ( )
inline

Return QAction of overview use in the context menu

GWOverviewWidget* tlp::GlMainView::getOverviewWidget ( )
inline

Return the overview widget use by this view

virtual void tlp::GlMainView::hideOverview ( bool  )
virtualslot

Hide the overview

virtual void tlp::GlMainView::refresh ( )
virtualslot

Refresh the OpenGl widget

virtual void tlp::GlMainView::showDialog ( QAction *  action)
virtualslot

This slot is call when a QAction in dialog sub menu of context menu is toggle

Member Data Documentation

QMenu* tlp::GlMainView::dialogMenu
protected
GlMainWidget* tlp::GlMainView::mainWidget
protected
QAction* tlp::GlMainView::overviewAction
protected
QDockWidget* tlp::GlMainView::overviewDock
protected
QFrame* tlp::GlMainView::overviewFrame
protected
GWOverviewWidget* tlp::GlMainView::overviewWidget
protected


Tulip Software by LaBRI Visualization Team    2001 - 2012