Abstract view provide interactors' functions.
More...
#include <AbstractView.h>
Public Slots |
bool | eventFilter (QObject *object, QEvent *event) |
virtual void | exportImage (QAction *action) |
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 |
| AbstractView () |
virtual | ~AbstractView () |
virtual QWidget * | construct (QWidget *parent) |
QWidget * | getWidget () |
virtual void | setInteractors (const std::list< Interactor * > &interactorsList) |
virtual std::list< Interactor * > | getInteractors () |
virtual void | setActiveInteractor (Interactor *interactor) |
Interactor * | getActiveInteractor () |
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.
|
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 Graph * | getGraph ()=0 |
| A getter on this view's Graph.
|
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 void _DEPRECATED | createPicture (const std::string &pictureName, int width=0, int height=0) |
| Take a snapshot of the view and put it in a picture.
|
virtual bool _DEPRECATED | createPicture (const std::string &pictureName, int width, int height, bool center, int zoom=1, int xOffset=0, int yOffset=0) |
| Take a snapshot of the view, and save it to a picture on disk.
|
virtual QImage | createPicture (int width, int height, bool center, int zoom=1, int xOffset=0, int yOffset=0) |
| Take a snapshot of the view, and return a QImage.
|
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.
|
Additional Inherited Members |
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.
|
Detailed Description
Abstract view provide interactors' functions.
Abstract view provide a View with interactors' basic functions like getInteractors, pushInteractor and popInteractor You can inherit from it if you want this functions In tulip-qt GlMainView inherit from it
Constructor & Destructor Documentation
tlp::AbstractView::AbstractView |
( |
| ) |
|
virtual tlp::AbstractView::~AbstractView |
( |
| ) |
|
|
virtual |
Member Function Documentation
virtual void tlp::AbstractView::buildContextMenu |
( |
QObject * |
, |
|
|
QContextMenuEvent * |
, |
|
|
QMenu * |
contextMenu |
|
) |
| |
|
protectedvirtual |
virtual void tlp::AbstractView::computeContextMenuAction |
( |
QAction * |
| ) |
|
|
inlineprotectedvirtual |
virtual QWidget* tlp::AbstractView::construct |
( |
QWidget * |
parent | ) |
|
|
virtual |
bool tlp::AbstractView::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
slot |
this function is call by Qt this function call specificEventFilter, buildContextMenu and computeContextMenu
virtual void tlp::AbstractView::exportImage |
( |
QAction * |
action | ) |
|
|
virtualslot |
Interactor* tlp::AbstractView::getActiveInteractor |
( |
| ) |
|
|
inlinevirtual |
return current interactor
Implements tlp::View.
QWidget* tlp::AbstractView::getCentralWidget |
( |
| ) |
const |
|
inline |
- Returns
- the central widget of the abstract view
virtual std::list<Interactor *> tlp::AbstractView::getInteractors |
( |
| ) |
|
|
virtual |
QWidget* tlp::AbstractView::getWidget |
( |
| ) |
|
|
inlinevirtual |
get the widget who will be add to workspace by the controller
- Returns
- the widget of the abstract view
Implements tlp::View.
bool tlp::AbstractView::savePicture |
( |
const std::string & |
pictureName, |
|
|
int |
width, |
|
|
int |
height, |
|
|
bool |
center, |
|
|
int |
zoom = 1 , |
|
|
int |
xOffset = 0 , |
|
|
int |
yOffset = 0 |
|
) |
| |
|
virtual |
Default implementation of the savePicture function. Use the image objects returned by the createPicture function and save it to a picture file on disk.
- Parameters
-
pictureName | : filename to use for the picture, with extension (extension is used to infer image type). |
width | : width of the picture |
height | : height of the picture |
center | : whether we should center the view before creating the picture, or use the current zoom and pan. |
zoom | : creates a picture of a sub part of the view. With zoom=1 creates only one picture with entire view; with zoom=N : the view is cut into 2^(N-1) part in width and height. Defaults to 1. |
xOffset | : which part of the view to render if zoom!=1. xOffset must be 0 <= xOffset < 2^(zoom-1). Defaults to 0. |
yOffset | : which part of the view to render if zoom!=1. yOffset must be 0 <= yOffset < 2^(zoom-1). Defaults to 0. |
- Returns
- bool : Whether the picture can be created or not.
Reimplemented from tlp::View.
Reimplemented in tlp::BaseGraphicsViewComponent.
virtual void tlp::AbstractView::setActiveInteractor |
( |
Interactor * |
interactor | ) |
|
|
virtual |
void tlp::AbstractView::setCentralWidget |
( |
QWidget * |
widget | ) |
|
|
protected |
set the central widget of the view call this function to set view's centralWidget
virtual void tlp::AbstractView::setInteractors |
( |
const std::list< Interactor * > & |
interactorsList | ) |
|
|
virtual |
Set all interactors available forthis view Interactors are create (allocate) but now view have responsibility of her destruction
Implements tlp::View.
Reimplemented in tlp::BaseGraphicsViewComponent.
virtual void tlp::AbstractView::specificEventFilter |
( |
QObject * |
, |
|
|
QEvent * |
|
|
) |
| |
|
inlineprotectedvirtual |
Member Data Documentation
QWidget* tlp::AbstractView::centralWidget |
|
protected |
QMenu* tlp::AbstractView::exportImageMenu |
|
protected |
std::list<Interactor *> tlp::AbstractView::interactors |
|
protected |
QVBoxLayout* tlp::AbstractView::mainLayout |
|
protected |
QWidget* tlp::AbstractView::widget |
|
protected |
|