graph_analysis
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
graph_analysis::gui::EdgeItemBase Class Referenceabstract

standard implementation of graphical nodes for an Edge More...

#include <EdgeItemBase.hpp>

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

Public Member Functions

 EdgeItemBase (GraphWidget *graphWidget, const graph_analysis::Edge::Ptr &edge, QGraphicsItem *parent)
 constructor More...
 
virtual ~EdgeItemBase ()
 
virtual int type () const
 
virtual void adjustEdgePoints (QVector< QPointF > points)
 
virtual void adjustEdgePositioning ()
 
void drawStraightEdge ()
 
void drawBezierEdge ()
 
void drawArrowHead (size_t arrowSize, QBrush brush=QBrush(Qt::black), QPen pen=QPen(Qt::black))
 
graph_analysis::Edge::Ptr getEdge () const
 
void setEdge (graph_analysis::Edge::Ptr edge)
 
GraphWidget * getGraphWidget () const
 
virtual QPainterPath shape () const
 
QGraphicsPathItem * getEdgePath () const
 
QGraphicsPolygonItem * getArrowHead () const
 

Public Attributes

QVector< QPointF > mPoints
 

Protected Member Functions

 EdgeItemBase ()
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 
virtual EdgeItemBase * createNewItem (GraphWidget *graphWidget, const graph_analysis::Edge::Ptr &edge, QGraphicsItem *parent) const =0
 

Protected Attributes

graph_analysis::Edge::Ptr mpEdge
 underlying graph edge pointer More...
 
GraphWidget * mpGraphWidget
 parent managing graph widget More...
 
QGraphicsPathItem * mpEdgePath
 
QGraphicsPolygonItem * mpArrowHead
 render an arrow head More...
 

Friends

class EdgeItemTypeManager
 

Detailed Description

standard implementation of graphical nodes for an Edge

used as polymorphic base for several graphical node implementations

Constructor & Destructor Documentation

◆ EdgeItemBase() [1/2]

graph_analysis::gui::EdgeItemBase::EdgeItemBase ( )
protected

◆ EdgeItemBase() [2/2]

graph_analysis::gui::EdgeItemBase::EdgeItemBase ( GraphWidget *  graphWidget,
const graph_analysis::Edge::Ptr &  edge,
QGraphicsItem *  parent 
)

constructor

Parameters
graphWidgetthe parent and managing graph widget
edgethe internal conceptual edge
parentthe parent

◆ ~EdgeItemBase()

graph_analysis::gui::EdgeItemBase::~EdgeItemBase ( )
virtual

Member Function Documentation

◆ adjustEdgePoints()

void graph_analysis::gui::EdgeItemBase::adjustEdgePoints ( QVector< QPointF >  points)
virtual

◆ adjustEdgePositioning()

void graph_analysis::gui::EdgeItemBase::adjustEdgePositioning ( )
virtual

◆ createNewItem()

virtual EdgeItemBase* graph_analysis::gui::EdgeItemBase::createNewItem ( GraphWidget *  graphWidget,
const graph_analysis::Edge::Ptr &  edge,
QGraphicsItem *  parent 
) const
protectedpure virtual

◆ drawArrowHead()

void graph_analysis::gui::EdgeItemBase::drawArrowHead ( size_t  arrowSize,
QBrush  brush = QBrush(Qt::black),
QPen  pen = QPen(Qt::black) 
)

Calling this function in adjustEdgePositioning in a subclass will render an arrow head at the tip needs to be called after(!) drawStraightEdge or drawBezierEdge

Parameters
arrowSizeSize of the arrow
brushControl the fill style
penControl the line style

◆ drawBezierEdge()

void graph_analysis::gui::EdgeItemBase::drawBezierEdge ( )

Calling this function in adjustEdgePositioning in a subclass will render bezier curves between vertices

◆ drawStraightEdge()

void graph_analysis::gui::EdgeItemBase::drawStraightEdge ( )

Calling this function in adjustEdgePositioning in a subclass will render straight paths between vertices

◆ getArrowHead()

QGraphicsPolygonItem* graph_analysis::gui::EdgeItemBase::getArrowHead ( ) const
inline

Get the arrow head, e.g., to allow setting the brush

◆ getEdge()

graph_analysis::Edge::Ptr graph_analysis::gui::EdgeItemBase::getEdge ( ) const
inline

getter method for retrieving the underlying conceptual graph edge

◆ getEdgePath()

QGraphicsPathItem* graph_analysis::gui::EdgeItemBase::getEdgePath ( ) const
inline

Get the edge path, e.g., to allow setting the brush

◆ getGraphWidget()

GraphWidget* graph_analysis::gui::EdgeItemBase::getGraphWidget ( ) const
inline

getter method for retrieving the parent managing graph widget

◆ hoverEnterEvent()

void graph_analysis::gui::EdgeItemBase::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

provide mouse-over status updates of the currently selected Edge

Reimplemented in graph_analysis::gui::EdgeItemSimple.

◆ hoverLeaveEvent()

void graph_analysis::gui::EdgeItemBase::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

◆ setEdge()

void graph_analysis::gui::EdgeItemBase::setEdge ( graph_analysis::Edge::Ptr  edge)
inline

setter method for updating the underlying conceptual graph edge

◆ shape()

QPainterPath graph_analysis::gui::EdgeItemBase::shape ( ) const
virtual

Compute the shape of the edge (based on the edge path and the arrowhead)

Reimplemented in graph_analysis::gui::EdgeItemSimple.

◆ type()

int graph_analysis::gui::EdgeItemBase::type ( ) const
virtual

Friends And Related Function Documentation

◆ EdgeItemTypeManager

friend class EdgeItemTypeManager
friend

Member Data Documentation

◆ mpArrowHead

QGraphicsPolygonItem* graph_analysis::gui::EdgeItemBase::mpArrowHead
protected

render an arrow head

◆ mpEdge

graph_analysis::Edge::Ptr graph_analysis::gui::EdgeItemBase::mpEdge
protected

underlying graph edge pointer

◆ mpEdgePath

QGraphicsPathItem* graph_analysis::gui::EdgeItemBase::mpEdgePath
protected

path for rendering an edge, adapt style using setPen or setBrush Pen: draw lines and outlines of shapes Brush: fill pattern of shapes

◆ mpGraphWidget

GraphWidget* graph_analysis::gui::EdgeItemBase::mpGraphWidget
protected

parent managing graph widget

◆ mPoints

QVector<QPointF> graph_analysis::gui::EdgeItemBase::mPoints

two points of the source and target, where this edge should attach

this can be as simple as two points which shall be connected by a straight line.


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