#include <BaseGraphicsViewComponent.h>
Public Slots |
virtual void | setGraph (Graph *graph) |
virtual void | draw () |
virtual void | refresh () |
virtual void | init () |
virtual void | elementSelectedSlot (unsigned int, bool) |
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 |
| BaseGraphicsViewComponent (const std::string &realViewName) |
virtual | ~BaseGraphicsViewComponent () |
virtual QWidget * | construct (QWidget *parent) |
virtual void | setData (Graph *graph, DataSet dataSet) |
| Set the View's Graph and DataSet.
|
virtual void | getData (Graph **graph, DataSet *dataSet) |
| Gets the Graph and DataSet of the view.
|
virtual Graph * | getGraph () |
| A getter on this view's Graph.
|
virtual void | setInteractors (const std::list< Interactor * > &interactors) |
virtual std::list< Interactor * > | getInteractors () |
virtual void | setActiveInteractor (Interactor *interactor) |
virtual void | 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 | 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 std::string | getRealViewName () const |
| Return the real view name (if "" the real name is the name given by the plugin).
|
| AbstractView () |
virtual | ~AbstractView () |
QWidget * | getWidget () |
Interactor * | getActiveInteractor () |
QWidget * | getCentralWidget () const |
virtual | ~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 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 void | undoIsDone () |
| This function is called when an undo is performed by the controller.
|
Constructor & Destructor Documentation
tlp::BaseGraphicsViewComponent::BaseGraphicsViewComponent |
( |
const std::string & |
realViewName | ) |
|
virtual tlp::BaseGraphicsViewComponent::~BaseGraphicsViewComponent |
( |
| ) |
|
|
virtual |
Member Function Documentation
virtual QWidget* tlp::BaseGraphicsViewComponent::construct |
( |
QWidget * |
parent | ) |
|
|
virtual |
virtual void tlp::BaseGraphicsViewComponent::createPicture |
( |
const std::string & |
pictureName, |
|
|
int |
width = 0 , |
|
|
int |
height = 0 |
|
) |
| |
|
inlinevirtual |
Take a snapshot of the view and put it in a picture.
- Deprecated:
- In Tulip 4.x.y this function will be replaced by void createPicture(const string &pictureName,int width, int height, bool center, int zoom, int xOffset, int yOffset)
- Parameters
-
pictureName | filename to use for the picture, with extension (extension is used to infer image type). |
width | width of the picture Defaults to 0. |
height | height of the picture Defaults to 0. |
- Returns
- void
Reimplemented from tlp::View.
virtual void tlp::BaseGraphicsViewComponent::draw |
( |
| ) |
|
|
virtualslot |
virtual void tlp::BaseGraphicsViewComponent::elementSelectedSlot |
( |
unsigned |
int, |
|
|
bool |
|
|
) |
| |
|
virtualslot |
virtual void tlp::BaseGraphicsViewComponent::getData |
( |
Graph ** |
graph, |
|
|
DataSet * |
dataSet |
|
) |
| |
|
inlinevirtual |
Gets the Graph and DataSet of the view.
- Parameters
-
graph | A pointer whose value will be modified to point to the Graph* of the view. |
dataSet | A pointer whose value will be modified to point to the DataSet of the view. |
- Returns
- void
Implements tlp::View.
virtual Graph* tlp::BaseGraphicsViewComponent::getGraph |
( |
| ) |
|
|
inlinevirtual |
A getter on this view's Graph.
- Returns
- :Graph* The Graph this View displays.
Implements tlp::View.
virtual std::list<Interactor *> tlp::BaseGraphicsViewComponent::getInteractors |
( |
| ) |
|
|
inlinevirtual |
virtual std::string tlp::BaseGraphicsViewComponent::getRealViewName |
( |
| ) |
const |
|
virtual |
Return the real view name (if "" the real name is the name given by the plugin).
- Returns
- :string the View's real name.
Reimplemented from tlp::View.
void tlp::BaseGraphicsViewComponent::hideOverview |
( |
bool |
| ) |
|
|
protectedslot |
virtual void tlp::BaseGraphicsViewComponent::init |
( |
| ) |
|
|
virtualslot |
virtual void tlp::BaseGraphicsViewComponent::refresh |
( |
| ) |
|
|
virtualslot |
virtual bool tlp::BaseGraphicsViewComponent::savePicture |
( |
const std::string & |
pictureName, |
|
|
int |
width, |
|
|
int |
height, |
|
|
bool |
center, |
|
|
int |
zoom = 1 , |
|
|
int |
xOffset = 0 , |
|
|
int |
yOffset = 0 |
|
) |
| |
|
inlinevirtual |
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::AbstractView.
virtual void tlp::BaseGraphicsViewComponent::setActiveInteractor |
( |
Interactor * |
interactor | ) |
|
|
inlinevirtual |
virtual void tlp::BaseGraphicsViewComponent::setData |
( |
Graph * |
graph, |
|
|
DataSet |
dataSet |
|
) |
| |
|
inlinevirtual |
Set the View's Graph and DataSet.
- Parameters
-
graph | The view's new Graph. |
dataSet | The view's new DataSet. |
- Returns
- void
Implements tlp::View.
virtual void tlp::BaseGraphicsViewComponent::setGraph |
( |
Graph * |
graph | ) |
|
|
inlinevirtualslot |
virtual void tlp::BaseGraphicsViewComponent::setInteractors |
( |
const std::list< Interactor * > & |
interactorsList | ) |
|
|
inlinevirtual |
Set all interactors available forthis view Interactors are create (allocate) but now view have responsibility of her destruction
Reimplemented from tlp::AbstractView.
void tlp::BaseGraphicsViewComponent::setVisibleOverview |
( |
bool |
| ) |
|
|
protectedslot |
Member Data Documentation
View* tlp::BaseGraphicsViewComponent::baseView |
|
protected |
QFrame* tlp::BaseGraphicsViewComponent::overviewFrame |
|
protected |
std::string tlp::BaseGraphicsViewComponent::realViewName |
|
protected |
|