tlp::BaseGraphicsViewComponent Class Reference
#include <BaseGraphicsViewComponent.h>
List of all members.
Public Slots
- virtual void setGraph (Graph *graph)
- Sets the Graph on this View.
- virtual void draw ()
- 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 ()
- 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 ()
- 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.
- virtual void elementSelectedSlot (unsigned int, bool)
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).
Protected Slots
Protected Attributes
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 | |
|
) |
| | [inline, virtual] |
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 |
( |
|
) |
[virtual, slot] |
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.
- Returns:
- void
Implements tlp::View.
virtual void tlp::BaseGraphicsViewComponent::elementSelectedSlot |
( |
unsigned |
int, |
|
|
bool |
| |
|
) |
| | [virtual, slot] |
virtual void tlp::BaseGraphicsViewComponent::getData |
( |
Graph ** |
graph, |
|
|
DataSet * |
dataSet | |
|
) |
| | [inline, virtual] |
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 |
( |
|
) |
[inline, virtual] |
A getter on this view's Graph.
- Returns:
- :Graph* The Graph this View displays.
Implements tlp::View.
virtual std::list<Interactor *> tlp::BaseGraphicsViewComponent::getInteractors |
( |
|
) |
[inline, virtual] |
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 |
|
) |
[protected, slot] |
virtual void tlp::BaseGraphicsViewComponent::init |
( |
|
) |
[virtual, slot] |
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.
- Returns:
- void
Implements tlp::View.
virtual void tlp::BaseGraphicsViewComponent::refresh |
( |
|
) |
[virtual, slot] |
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().
- Returns:
- void
Implements tlp::View.
virtual bool tlp::BaseGraphicsViewComponent::savePicture |
( |
const std::string & |
pictureName, |
|
|
int |
width, |
|
|
int |
height, |
|
|
bool |
center, |
|
|
int |
zoom = 1 , |
|
|
int |
xOffset = 0 , |
|
|
int |
yOffset = 0 | |
|
) |
| | [inline, 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::AbstractView.
virtual void tlp::BaseGraphicsViewComponent::setActiveInteractor |
( |
Interactor * |
interactor |
) |
[inline, virtual] |
virtual void tlp::BaseGraphicsViewComponent::setData |
( |
Graph * |
graph, |
|
|
DataSet |
dataSet | |
|
) |
| | [inline, virtual] |
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 |
) |
[inline, virtual, slot] |
Sets the Graph on this View.
- Parameters:
-
| graph | the new Graph to be displayed by this View. |
- Returns:
- void
Implements tlp::View.
virtual void tlp::BaseGraphicsViewComponent::setInteractors |
( |
const std::list< Interactor * > & |
interactorsList |
) |
[inline, virtual] |
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 |
|
) |
[protected, slot] |
Member Data Documentation
|