|
graph_analysis
|
Base-class for visual representations of a "Graph" in this framework. More...
#include <GraphWidget.hpp>


Public Types | |
| typedef std::map< const graph_analysis::Edge::Ptr, EdgeItemBase * > | EdgeItemMap |
| typedef std::map< const graph_analysis::Vertex::Ptr, VertexItemBase * > | VertexItemMap |
| typedef std::map< const graph_analysis::Vertex::Ptr, QPointF > | VertexItemCoordinateCache |
Public Slots | |
| virtual void | shuffle () |
| virtual void | refresh (bool all=true) |
| virtual void | updateVisualization () |
| void | setVertexVisible (int id, bool show) |
| void | setEdgeVisible (int id, bool show) |
| void | activateViewportMargins (int areaFlag) |
| void | setTopMarginHeight (int width) |
| void | setBottomMarginHeight (int width) |
| void | setLeftMarginWidth (int width) |
| void | setRightMarginWidth (int width) |
Signals | |
| void | currentStatus (QString, int) |
Protected Member Functions | |
| void | wheelEvent (QWheelEvent *event) |
| qt mouse wheel spin callback More... | |
| void | scaleView (qreal scaleFactor) |
| scales scene (zooms into or out of the scene) More... | |
| void | keyPressEvent (QKeyEvent *) |
| void | mousePressEvent (QMouseEvent *) |
| void | mouseReleaseEvent (QMouseEvent *) |
| void | mouseDoubleClickEvent (QMouseEvent *event) |
| qreal | horizonalScalingFactor () const |
| qreal | verticalScalingFactor () const |
| virtual void | resizeEvent (QResizeEvent *event) |
Protected Attributes | |
| QGraphicsScene * | mpScene |
| graph_analysis::BaseGraph::Ptr | mpGraph |
| shared pointer of the conceptual, underlying graph More... | |
| graph_analysis::GraphElement::Ptr | mpFocusedElement |
| int | mWithViewportMargins |
| int | mLeftMarginWidth |
| int | mRightMarginWidth |
| int | mTopMarginHeight |
| int | mBottomMarginHeight |
| QWidget * | mpLeftMarginArea |
| QWidget * | mpRightMarginArea |
| QWidget * | mpTopMarginArea |
| QWidget * | mpBottomMarginArea |
| EdgeItemMap | mEdgeItemMap |
| VertexItemMap | mVertexItemMap |
| VertexItemCoordinateCache | mItemCoordinateCache |
Friends | |
| class | Player |
Base-class for visual representations of a "Graph" in this framework.
A Qt-Widget using a qgraphicsview as a canvas. this class does not draw anything yet, but provides the infrastructure for handling with a graph. is intended to obtain a shared pointer to a graph which is stored elsewhere. this allows multiple independent visualizations of the same basegraph.
| typedef std::map<const graph_analysis::Edge::Ptr, EdgeItemBase*> graph_analysis::gui::GraphWidget::EdgeItemMap |
a mapping from an "Edge" in the graph to a responsible visualizing "Item" on the scene.
| typedef std::map<const graph_analysis::Vertex::Ptr, QPointF> graph_analysis::gui::GraphWidget::VertexItemCoordinateCache |
this is used to store where a Vertex element had its responsible VertexItem positioned on the scene. can be queried after a "clearVisualization()" to reposition newly created items in the same canvas location as before.
cannot store the pointer to a VertexItem directly as this pointer will change after repopulation of the canvas.
| typedef std::map<const graph_analysis::Vertex::Ptr, VertexItemBase*> graph_analysis::gui::GraphWidget::VertexItemMap |
a mapping from an "Vertex" in the graph to a responsible visualizing "Item" on the scene.
| graph_analysis::gui::GraphWidget::GraphWidget | ( | const graph_analysis::BaseGraph::Ptr & | graph, |
| QWidget * | parent = NULL |
||
| ) |
constructor
|
virtual |
destructor
|
slot |
| void graph_analysis::gui::GraphWidget::applyCachedLayout | ( | ) |
| GraphWidget::VertexItemCoordinateCache graph_analysis::gui::GraphWidget::applyLayout | ( | const VertexItemCoordinateCache & | coordinates | ) |
Apply the given layout (via coordinates)
| void graph_analysis::gui::GraphWidget::cacheCurrentLayout | ( | ) |
Cache the current view
| void graph_analysis::gui::GraphWidget::cacheVertexItemPosition | ( | const graph_analysis::Vertex::Ptr | v, |
| QPointF | p | ||
| ) |
when a vertex changed its position, it can be stored
allows restoring the layout after automatic re-population using.
| void graph_analysis::gui::GraphWidget::clearFocus | ( | ) |
|
virtual |
Clear visualization and scene not(!) the underlying graph
|
signal |
| void graph_analysis::gui::GraphWidget::deregisterEdgeItem | ( | const graph_analysis::Edge::Ptr & | e, |
| EdgeItemBase * | i | ||
| ) |
to be called after an existing "EdgeItem" is removed from the canvas
| void graph_analysis::gui::GraphWidget::deregisterVertexItem | ( | const graph_analysis::Vertex::Ptr & | v, |
| VertexItemBase * | i | ||
| ) |
to be called after an existing "VertexItem" is removed from the canvas
|
inlinevirtual |
Reimplemented in graph_analysis::gui::BaseGraphView.
| GraphWidget::VertexItemCoordinateCache graph_analysis::gui::GraphWidget::getCurrentLayout | ( | ) | const |
Current layout in item coordinates
| QVector< QPointF > graph_analysis::gui::GraphWidget::getEdgePoints | ( | VertexItemBase * | firstItem, |
| VertexItemBase * | secondItem | ||
| ) | const |
takes the "connector" and the "boundingRect" of both items and tries to create a line between the intersection point of the connecting line and the boundingRects
used to establish sensible coordinated to re-draw edges after their vertices changed position
|
inline |
| graph_analysis::BaseGraph::Ptr graph_analysis::gui::GraphWidget::graph | ( | ) | const |
getter method for retrieving the underlying base graph
|
inlineprotected |
Compute the horizontal scaling factor, typically same as the vertical scaling factor for this widget
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
| void graph_analysis::gui::GraphWidget::play | ( | const PlayerConfiguration & | conf | ) |
Play the incremental build up / or deconstruction of a graph
| conf | PlayerConfiguration |
|
inlinevirtual |
trigger the creation of individual QGraphicsItems based on the referenced BaseGraph for this instance of a graph widget.
Reimplemented in graph_analysis::gui::BaseGraphView.
|
virtualslot |
| void graph_analysis::gui::GraphWidget::registerEdgeItem | ( | const graph_analysis::Edge::Ptr & | e, |
| EdgeItemBase * | i | ||
| ) |
to be called after a new "EdgeItem" is added to the canvas
| void graph_analysis::gui::GraphWidget::registerVertexItem | ( | const graph_analysis::Vertex::Ptr & | v, |
| VertexItemBase * | i | ||
| ) |
to be called after a new "VertexItem" is added to the canvas
|
protectedvirtual |
Allow to compute the margins if needed
| void graph_analysis::gui::GraphWidget::saveScene | ( | ) |
Call a dialog to save the current scene
|
protected |
scales scene (zooms into or out of the scene)
|
slot |
|
slot |
| void graph_analysis::gui::GraphWidget::setFocusedElement | ( | const GraphElement::Ptr & | element | ) |
infrastructure for showing information about the currently hovered edge/vertex in the statusbar
|
virtual |
setter method for updating the underlying base graph
|
slot |
|
slot |
|
slot |
|
slot |
|
virtualslot |
|
virtual |
Update the current view
|
virtual |
update all edges associated with the given vertex after a position change
the default implementation tries to draw a line between the intersection points of the "connectors" and the "boundingRect" of each item of the edge.
|
virtual |
Display a message status in the status bar
| msg | Message in the statusbar |
| timeInMS | Time in milliseconds |
|
virtualslot |
| void graph_analysis::gui::GraphWidget::vertexPositionHasChanged | ( | VertexItemBase * | item | ) |
to be called by a VertexItem when its position on the canvas changed.
|
inlineprotected |
Compute the vertical scaling factor, typically same as the horizontal scaling factor for this widget
|
protected |
qt mouse wheel spin callback
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
this is (was?) used to display the name of the last focused element in the status bar.
|
protected |
shared pointer of the conceptual, underlying graph
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.17