graph_analysis
Public Member Functions | List of all members
graph_analysis::gui::BaseGraphView Class Reference

displaying the raw hypergraph in all its glory More...

#include <BaseGraphView.hpp>

Inheritance diagram for graph_analysis::gui::BaseGraphView:
Inheritance graph
[legend]
Collaboration diagram for graph_analysis::gui::BaseGraphView:
Collaboration graph
[legend]

Public Member Functions

 BaseGraphView (graph_analysis::BaseGraph::Ptr graph, QWidget *parent=NULL)
 constructor More...
 
virtual ~BaseGraphView ()
 
QString getClassName () const
 
void populateCanvas ()
 
void applyLayout (const std::string &layoutName="")
 
virtual QStringList getSupportedLayouts () const
 
- Public Member Functions inherited from graph_analysis::gui::GraphWidget
 GraphWidget (const graph_analysis::BaseGraph::Ptr &graph, QWidget *parent=NULL)
 
virtual ~GraphWidget ()
 
void registerEdgeItem (const graph_analysis::Edge::Ptr &e, EdgeItemBase *i)
 
void registerVertexItem (const graph_analysis::Vertex::Ptr &v, VertexItemBase *i)
 
void deregisterEdgeItem (const graph_analysis::Edge::Ptr &e, EdgeItemBase *i)
 
void deregisterVertexItem (const graph_analysis::Vertex::Ptr &v, VertexItemBase *i)
 
QVector< QPointF > getEdgePoints (VertexItemBase *firstItem, VertexItemBase *secondItem) const
 
void vertexPositionHasChanged (VertexItemBase *item)
 
void cacheVertexItemPosition (const graph_analysis::Vertex::Ptr v, QPointF p)
 
virtual void updateEdgePositions (VertexItemBase *item)
 
graph_analysis::BaseGraph::Ptr graph () const
 getter method for retrieving the underlying base graph More...
 
virtual void setGraph (const graph_analysis::BaseGraph::Ptr &graph)
 setter method for updating the underlying base graph More...
 
virtual void update ()
 
VertexItemCoordinateCache getCurrentLayout () const
 
void cacheCurrentLayout ()
 
void applyCachedLayout ()
 
VertexItemCoordinateCache applyLayout (const VertexItemCoordinateCache &coordinates)
 
void setFocusedElement (const GraphElement::Ptr &element)
 
GraphElement::Ptr getFocusedElement () const
 
void clearFocus ()
 
bool isFocused (const GraphElement::Ptr &element) const
 
virtual void clearVisualization ()
 
virtual void updateStatus (const std::string &msg, int timeInMS=10)
 
void play (const PlayerConfiguration &conf)
 
void saveScene ()
 

Additional Inherited Members

- Public Types inherited from graph_analysis::gui::GraphWidget
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 inherited from graph_analysis::gui::GraphWidget
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 inherited from graph_analysis::gui::GraphWidget
void currentStatus (QString, int)
 
- Protected Member Functions inherited from graph_analysis::gui::GraphWidget
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 inherited from graph_analysis::gui::GraphWidget
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
 

Detailed Description

displaying the raw hypergraph in all its glory

maintains and displays a simple view of its BaseGraph

In order to select layouts for the graph you can use the following scheme

 BaseGraphView* mpBaseGraphView = new ...

 bool ok;
 QString desiredLayout = QInputDialog::getItem(this, tr("Select Layout"),
                             tr("select a layout:"), mpBaseGraphView->getSupportedLayouts(),
                             0, false, &ok);
 if(ok)
 {
     mpBaseGraphView->applyLayout(desiredLayout.toStdString());
 }

 mpBaseGraphView->updateVisualization();

treats the BaseGraph as read-only.

Constructor & Destructor Documentation

◆ BaseGraphView()

graph_analysis::gui::BaseGraphView::BaseGraphView ( graph_analysis::BaseGraph::Ptr  graph,
QWidget *  parent = NULL 
)

constructor

Parameters
graphunderlying base graph
parentParent widget (if there is one)

◆ ~BaseGraphView()

graph_analysis::gui::BaseGraphView::~BaseGraphView ( )
virtual

Member Function Documentation

◆ applyLayout()

void graph_analysis::gui::BaseGraphView::applyLayout ( const std::string &  layoutName = "")

Set a layout name

◆ getClassName()

QString graph_analysis::gui::BaseGraphView::getClassName ( ) const
virtual

Reimplemented from graph_analysis::gui::GraphWidget.

◆ getSupportedLayouts()

QStringList graph_analysis::gui::BaseGraphView::getSupportedLayouts ( ) const
virtual

◆ populateCanvas()

void graph_analysis::gui::BaseGraphView::populateCanvas ( )
virtual

deletes all internal information and rebuilds the visualization according to the current BaseGraph. Respawns all graphical elements by the underlying base graph and trigger the layouting

Reimplemented from graph_analysis::gui::GraphWidget.


The documentation for this class was generated from the following files: