Tulip
5.4.0
Large graphs analysis and drawing
|
#include <GlMainView.h>
Public Types | |
enum | OverviewPosition { OVERVIEW_TOP_LEFT, OVERVIEW_TOP_RIGHT, OVERVIEW_BOTTOM_LEFT, OVERVIEW_BOTTOM_RIGHT } |
Public Slots | |
void | applySettings () override |
void | centerView (bool graphChanged=false) override |
void | draw () override |
virtual void | drawOverview (bool generatePixmap=true) |
static bool | getNodeOrEdgeAtViewportPos (GlMainWidget *glw, int x, int y, node &n, edge &e) |
bool | getNodeOrEdgeAtViewportPos (int x, int y, node &n, edge &e) const override |
QImage | getRGBImage () const |
void | redraw () |
void | refresh () override |
void | setOverviewVisible (bool) |
void | setQuickAccessBarVisible (bool) |
void | setViewOrtho (bool) |
void | undoCallback () override |
Public Slots inherited from tlp::ViewWidget | |
void | draw () override |
void | setupUi () override |
Public Slots inherited from tlp::View | |
void | addRedrawTrigger (tlp::Observable *) |
virtual void | applySettings () |
virtual void | centerView (bool graphChanged=false) |
virtual bool | checkOnClose () |
void | clearRedrawTriggers () |
virtual void | draw ()=0 |
void | emitDrawNeededSignal () |
virtual bool | getNodeOrEdgeAtViewportPos (int, int, node &, edge &) const |
virtual void | refresh () |
void | removeRedrawTrigger (tlp::Observable *) |
void | setCurrentInteractor (tlp::Interactor *currentInteractor) |
void | setGraph (tlp::Graph *graph) |
virtual void | setInteractors (const QList< tlp::Interactor *> &) |
virtual void | setupUi ()=0 |
void | treatEvent (const Event &) override |
virtual void | undoCallback () |
Public Member Functions | |
GlMainView (bool needTooltipAndUrlManager=false) | |
QList< QWidget * > | configurationWidgets () const override |
tlp::GlMainWidget * | getGlMainWidget () const |
OverviewPosition | overviewPosition () const |
bool | overviewVisible () const |
bool | pickNodeEdge (const int x, const int y, tlp::node &n, tlp::edge &e, bool pickNode=true, bool pickEdge=true) |
bool | quickAccessBarVisible () const |
void | rotateCamera (int x, int y, int z) |
void | setOverviewPosition (const OverviewPosition &position) |
void | setState (const tlp::DataSet &) override |
void | setUpdateOverview (bool updateOverview) |
QPixmap | snapshot (const QSize &outputSize=QSize()) const override |
tlp::DataSet | state () const override |
void | translateCamera (int x, int y, int z) |
bool | updateOverview () const |
Coord | viewToWorld (const Coord &vpos) const |
Coord | worldToView (const Coord &wpos) const |
void | zoom (int step) |
void | zoomAndPanAnimation (const tlp::BoundingBox &boundingBox, const double duration=1000.) |
void | zoomFactor (float factor) |
void | zoomXY (int step, const int x, const int y) |
Public Member Functions inherited from tlp::ViewWidget | |
QGraphicsView * | graphicsView () const override |
Public Member Functions inherited from tlp::View | |
View () | |
~View () override | |
std::string | category () const override |
virtual QString | configurationWidgetsStyleSheet () const |
tlp::Interactor * | currentInteractor () const |
tlp::Graph * | graph () const |
std::string | icon () const override |
const QList< Interactor * > & | interactors () const |
virtual bool | interactorsEnabled () const |
virtual bool | rebuildSceneOnShowEvent () |
virtual void | resetGraphicsScene () |
void | setShowContextMenu (bool show) |
void | showContextMenu (const QPoint &point, const QPointF &scenePoint) |
void | treatEvents (const std::vector< Event > &events) override |
QSet< tlp::Observable * > | triggers () const |
Public Member Functions inherited from tlp::Plugin | |
virtual std::string | author () const =0 |
virtual std::string | date () const =0 |
void | declareDeprecatedName (const std::string &oldName) |
std::string | deprecatedName () |
virtual std::string | group () const =0 |
virtual int | id () const |
virtual std::string | info () const =0 |
virtual std::string | major () const |
virtual std::string | minor () const |
virtual std::string | name () const =0 |
virtual std::string | programmingLanguage () const |
virtual std::string | release () const =0 |
virtual std::string | tulipMajor () const |
virtual std::string | tulipMinor () const |
virtual std::string | tulipRelease () const =0 |
Public Member Functions inherited from tlp::Observable | |
void | addListener (Observable *const listener) const |
void | addListener (Observable &listener) const |
void | addObserver (Observable *const observer) const |
void | addObserver (Observable &observer) const |
unsigned int | countListeners () const |
unsigned int | countObservers () const |
unsigned int | getReceived () const |
unsigned int | getSent () const |
void | removeListener (Observable *const listener) const |
void | removeListener (Observable &listener) const |
void | removeObserver (Observable *const observer) const |
void | removeObserver (Observable &observer) const |
Protected Slots | |
void | fillContextMenu (QMenu *menu, const QPointF &) override |
virtual void | glMainViewDrawn (bool graphChanged) |
virtual void | sceneRectChanged (const QRectF &) |
Protected Slots inherited from tlp::ViewWidget | |
void | currentInteractorChanged (tlp::Interactor *) override |
void | graphDeleted (Graph *parentGraph) override |
Protected Slots inherited from tlp::View | |
void | activateTooltipAndUrlManager (QWidget *) |
virtual void | currentInteractorChanged (tlp::Interactor *) |
virtual void | fillContextMenu (QMenu *, const QPointF &) |
void | fillContextMenu (QMenu *menu, node n) |
void | fillContextMenu (QMenu *menu, edge e) |
virtual void | graphChanged (tlp::Graph *)=0 |
virtual void | graphDeleted (tlp::Graph *parentGraph)=0 |
virtual void | interactorsInstalled (const QList< tlp::Interactor *> &interactors) |
void | toggleInteractors (const bool activate, const std::unordered_set< const char *> &exceptions) |
Protected Member Functions | |
void | assignNewGlMainWidget (GlMainWidget *glMainWidget, bool deleteOldGlMainWidget=true) |
bool | eventFilter (QObject *obj, QEvent *event) override |
virtual QuickAccessBar * | getQuickAccessBarImpl () |
tlp::GlOverviewGraphicsItem * | overviewItem () const |
void | setupWidget () override |
void | updateShowOverviewButton () |
void | updateShowQuickAccessBarButton () |
Protected Member Functions inherited from tlp::ViewWidget | |
void | addToScene (QGraphicsItem *item) |
QGraphicsItem * | centralItem () const override |
void | removeFromScene (QGraphicsItem *item) |
void | setCentralWidget (QWidget *, bool deleteOldCentralWidget=true) |
QPixmap | snapshot (const QSize &outputSize=QSize()) const override |
Protected Member Functions inherited from tlp::Observable | |
Observable (const Observable &) | |
bool | hasOnlookers () const |
void | observableDeleted () |
Observable & | operator= (const Observable &) |
void | sendEvent (const Event &message) |
virtual void | treatEvent (const Event &message) |
Protected Attributes | |
bool | _needTooltipAndUrlManager |
OverviewPosition | _overviewPosition |
tlp::QuickAccessBar * | _quickAccessBar |
QGraphicsProxyWidget * | _quickAccessBarItem |
tlp::SceneConfigWidget * | _sceneConfigurationWidget |
tlp::SceneLayersConfigWidget * | _sceneLayersConfigurationWidget |
bool | _updateOverview |
bool | needQuickAccessBar |
Protected Attributes inherited from tlp::Plugin | |
std::string | oldName |
Additional Inherited Members | |
Signals inherited from tlp::View | |
void | drawNeeded () |
void | graphSet (tlp::Graph *) |
void | interactorsChanged () |
Static Public Member Functions inherited from tlp::Observable | |
static void | disableEventNotification () |
static void | enableEventNotification () |
static tlp::node | getNode (const tlp::Observable *obs) |
static Observable * | getObject (tlp::node n) |
static const tlp::VectorGraph & | getObservableGraph () |
static unsigned int | getScheduled (tlp::node n) |
static void | holdObservers () |
static bool | isAlive (tlp::node n) |
static unsigned int | observersHoldCounter () |
static void | unholdObservers () |
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:
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.
Definition at line 68 of file GlMainView.h.
|
overrideslot |
Force the settings set in the configuration widgets to be re-applied.
|
overrideslot |
Centers the scene's camera.
|
overridevirtual |
Reimplemented from tlp::View.
|
overrideslot |
Calls GlMainWidget::draw();.
|
virtualslot |
Force the overview to be redrawn. Since GlMainView already detects graph's modifications, this method should not be called manually to avoid extra rendering.
|
slot |
Return the glMainWidget current display in the RGB888 format.
bool tlp::GlMainView::pickNodeEdge | ( | const int | x, |
const int | y, | ||
tlp::node & | n, | ||
tlp::edge & | e, | ||
bool | pickNode = true , |
||
bool | pickEdge = true |
||
) |
Pick a node or an edge at a view position First take a look at a node located at (x,y); if none is found, take a look at an edge.
x | the x coordinate of the position |
y | the y coordinate of the position |
n | on return holds the node found under the (x,y) position, n.isValid() return false if none has been found |
e | on return holds the edge found under the (x,y) position, e.isValid() return false if none has been found |
pickNode | enable or disable the node picking |
pickEdge | enable or disable the edge picking |
|
slot |
Calls GlMainWidget::redraw();.
|
overrideslot |
Calls GlMainWidget::redraw();.
|
inline |
Rotate the view camera by (x,y,z)
x | rotation around the X axis in degree |
y | rotation around the Y axis in degree |
z | rotation around Z axis in degree |
Definition at line 131 of file GlMainView.h.
|
slot |
Toggles the overview on or off.
|
slot |
allows to control the quick access bar visibility
|
overridevirtual |
|
overrideprotectedvirtual |
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.
Implements tlp::ViewWidget.
|
slot |
Toggles the orthogonal projection on or off, then draws.
|
overridevirtual |
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.
Implements tlp::View.
|
overridevirtual |
|
inline |
Translate the view camera by (x,y,z)
x | offset along the X axis |
y | offset along the Y axis |
z | offset along the Z axis |
Definition at line 141 of file GlMainView.h.
|
inline |
Return the 3D world position for the given view position.
Definition at line 148 of file GlMainView.h.
|
inline |
Return the view position for the given 3D position.
Definition at line 155 of file GlMainView.h.
|
inline |
Zoom by step.
step | of zoom |
Definition at line 171 of file GlMainView.h.
void tlp::GlMainView::zoomAndPanAnimation | ( | const tlp::BoundingBox & | boundingBox, |
const double | duration = 1000. |
||
) |
Do a zoom and pan animation.
boundingBox | the bounding box in scene coordinates on which the view has to be zoomed and panned. If it is not valid, the scene bounding box will be used. At the end of the animation, the view will be zoomed and centered on the content of that bounding box. |
duration | the animation duration in msecs |
|
inline |
Zoom by factor.
factor | of zoom |
Definition at line 179 of file GlMainView.h.
|
inline |
Zoom by step to the given (x,y) view position.
step | of zoom |
Definition at line 163 of file GlMainView.h.