Frapper  1.0a
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Frapper::ConnectionGraphicsItem Class Reference

Class for graphical representation of connections in the node framework. More...

#include <ConnectionGraphicsItem.h>

Inheritance diagram for Frapper::ConnectionGraphicsItem:
Inheritance graph
[legend]
Collaboration diagram for Frapper::ConnectionGraphicsItem:
Collaboration graph
[legend]

Signals

void nodeGraphicsItemSelected (const QString &name)
 
void destroyed (Connection *connection)
 Signal that is emitted when the connection item is being destroyed.
 
void destroyed (ConnectionGraphicsItem *connectionItem)
 Signal that is emitted when the connection item is being destroyed.
 

Public Member Functions

 ConnectionGraphicsItem (const QString &name, const QColor &color, const QPointF &startPoint, const QPointF &endPoint)
 Constructor of the ConnectionGraphicsItem class.
 
 ~ConnectionGraphicsItem ()
 Destructor of the ConnectionGraphicsItem class.
 
virtual QRectF boundingRect () const
 Returns the bounding rectangle of the graphics item.
 
virtual QPainterPath shape () const
 Returns the shape path of an item.
 
void setEnabled (bool enabled)
 Enables or disables the graphics item.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Paints the graphics item into a graphics view.
 
void updatePath ()
 Updates the path end points according to the positions of start and end nodes.
 
ConnectiongetConnection () const
 Returns the Connection object that the connection graphics item represents.
 
void setConnection (Connection *connection)
 Sets the Connection object that the connection graphics item represents.
 
NodeGraphicsItemgetStartNodeItem ()
 Gets the startnode of the connection.
 
void setStartNodeItem (NodeGraphicsItem *item)
 Sets the startnode of the connection.
 
NodeGraphicsItemgetEndNodeItem () const
 Gets the endnode of the connection.
 
void setEndNodeItem (NodeGraphicsItem *item)
 Sets the endnode of the connection.
 
QPointF getStartPoint () const
 Gets the start point of the connection.
 
void setStartPoint (const QPointF &startPos)
 Sets the start point of the connection.
 
QPointF getEndPoint () const
 Gets the end point of the connection.
 
void setEndPoint (const QPointF &endPos)
 Sets the end point of the connection.
 
void updatePosition (const QPointF &scenePosition)
 Updates the position of an end point for a connection that is currently being created.
 

Static Public Member Functions

static ConnectionGraphicsItemgetTempItem ()
 Returns the temporary Connection object that is used when creating a connection between nodes.
 
static void setTempItem (ConnectionGraphicsItem *connection)
 Sets the temporary Connection object that is used when creating a connection between nodes to the given object.
 
static bool isConnectionCreated ()
 Returns whether a connection between nodes is currently being created.
 

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 Process hover enter events.
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 Process hover leave events.
 

Private Member Functions

void setTemp (bool temp)
 

Private Attributes

QString m_name
 The name of the connection.
 
QColor m_color
 The color to use for painting the item.
 
QPainterPath m_mainPath
 The path to use for painting the curved path.
 
QPainterPath m_shadowPath
 The path to use for painting the shadow of the curved path.
 
QPolygonF m_arrowHeadPolygon
 The arrow head shape to use for painting the item.
 
QPainterPath m_shapePath
 The path to return when the shape of the item is requested.
 
QPointF m_startPoint
 The start point of the path.
 
QPointF m_endPoint
 The end point of the path.
 
bool m_selfInitiated
 Flag that states whether a current update has been initiated by this object itself.
 
Connectionm_connection
 Pointer to Connection. (Deprecated.)
 
QMap< QString, Connection * > m_connections
 List of Connections.
 
NodeGraphicsItemm_startNodeItem
 Pointer to NodeGraphicsItem.
 
NodeGraphicsItemm_endNodeItem
 Pointer to NodeGraphicsItem.
 
bool m_temp
 Flag for temporary connection item.
 
bool m_hovered
 Flag for mouse hovers over item.
 

Static Private Attributes

static ConnectionGraphicsItems_tempItem = 0
 Temporary Connection object that is used when creating a connection between nodes.
 

Detailed Description

Class for graphical representation of connections in the node framework.

Inheritance Diagram
dot_inline_dotgraph_3.png
[legend]

Constructor & Destructor Documentation

Frapper::ConnectionGraphicsItem::ConnectionGraphicsItem ( const QString &  name,
const QColor &  color,
const QPointF &  startPoint,
const QPointF &  endPoint 
)

Constructor of the ConnectionGraphicsItem class.

Constructors and Destructors.

Parameters
nameThe name of the item.
colorThe color to use for painting the item.
startPointThe point where the connection line begins.
endPointThe point where the connection line ends.

Constructor of the ConnectionGraphicsItem class.

Parameters
nameThe name of the item.
colorThe color to use for painting the item.
startPointThe point where the connection line begins.
endPointThe point where the connection line ends.
Frapper::ConnectionGraphicsItem::~ConnectionGraphicsItem ( )

Destructor of the ConnectionGraphicsItem class.

Member Function Documentation

ConnectionGraphicsItem * Frapper::ConnectionGraphicsItem::getTempItem ( )
static

Returns the temporary Connection object that is used when creating a connection between nodes.

Public Static Functions.

Returns
The temporary Connection object that is used when creating a connection between nodes.

Returns the temporary Connection object that is used when creating a connection between nodes.

Returns
The temporary Connection object that is used when creating a connection between nodes.
void Frapper::ConnectionGraphicsItem::setTempItem ( ConnectionGraphicsItem item)
static

Sets the temporary Connection object that is used when creating a connection between nodes to the given object.

Parameters
connectionThe temporary Connection object that is used when creating a connection between nodes.
itemThe temporary Connection object that is used when creating a connection between nodes.
bool Frapper::ConnectionGraphicsItem::isConnectionCreated ( )
static

Returns whether a connection between nodes is currently being created.

Returns
True if a connection between nodes is currently being created, otherwise False.
QRectF Frapper::ConnectionGraphicsItem::boundingRect ( ) const
virtual

Returns the bounding rectangle of the graphics item.

Public Slots.

Returns
The bounding rectangle of the graphics item.

Public Functions Returns the bounding rectangle of the graphics item.

Returns
The bounding rectangle of the graphics item.
QPainterPath Frapper::ConnectionGraphicsItem::shape ( ) const
virtual

Returns the shape path of an item.

Returns the shape of the item as QPainterPath.

Parameters
Theshape of the item as QPainterPath.
void Frapper::ConnectionGraphicsItem::setEnabled ( bool  enabled)

Enables or disables the graphics item.

Parameters
enabledThe new enabled state for the item.
void Frapper::ConnectionGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual

Paints the graphics item into a graphics view.

Parameters
painterThe object to use for painting.
optionStyle options for painting the graphics item.
widgetThe widget into which to paint the graphics item.
void Frapper::ConnectionGraphicsItem::updatePath ( )

Updates the path end points according to the positions of start and end nodes.

Connection * Frapper::ConnectionGraphicsItem::getConnection ( ) const

Returns the Connection object that the connection graphics item represents.

Returns
The Connection object that the connection graphics item represents.
void Frapper::ConnectionGraphicsItem::setConnection ( Connection connection)

Sets the Connection object that the connection graphics item represents.

Parameters
connectionThe Connection object that the connection graphics item represents.
NodeGraphicsItem * Frapper::ConnectionGraphicsItem::getStartNodeItem ( )

Gets the startnode of the connection.

void Frapper::ConnectionGraphicsItem::setStartNodeItem ( NodeGraphicsItem item)

Sets the startnode of the connection.

NodeGraphicsItem * Frapper::ConnectionGraphicsItem::getEndNodeItem ( ) const

Gets the endnode of the connection.

void Frapper::ConnectionGraphicsItem::setEndNodeItem ( NodeGraphicsItem item)

Sets the endnode of the connection.

QPointF Frapper::ConnectionGraphicsItem::getStartPoint ( ) const

Gets the start point of the connection.

Gets the startpoint of the connection.

void Frapper::ConnectionGraphicsItem::setStartPoint ( const QPointF &  startPos)

Sets the start point of the connection.

QPointF Frapper::ConnectionGraphicsItem::getEndPoint ( ) const

Gets the end point of the connection.

Gets the endpoint of the connection.

void Frapper::ConnectionGraphicsItem::setEndPoint ( const QPointF &  endPos)

Sets the end point of the connection.

void Frapper::ConnectionGraphicsItem::updatePosition ( const QPointF &  scenePosition)

Updates the position of an end point for a connection that is currently being created.

Parameters
scenePositionThe position of the mouse pointer over the graphics view in scene coordinates.
void Frapper::ConnectionGraphicsItem::nodeGraphicsItemSelected ( const QString &  name)
signal
void Frapper::ConnectionGraphicsItem::destroyed ( Connection connection)
signal

Signal that is emitted when the connection item is being destroyed.

void Frapper::ConnectionGraphicsItem::destroyed ( ConnectionGraphicsItem connectionItem)
signal

Signal that is emitted when the connection item is being destroyed.

void Frapper::ConnectionGraphicsItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protected

Process hover enter events.

Protected Functions.

void Frapper::ConnectionGraphicsItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protected

Process hover leave events.

void Frapper::ConnectionGraphicsItem::setTemp ( bool  temp)
private

Sets the temp flag of the connection.

Private Functions Sets the temp flag.

Member Data Documentation

ConnectionGraphicsItem * Frapper::ConnectionGraphicsItem::s_tempItem = 0
staticprivate

Temporary Connection object that is used when creating a connection between nodes.

Private Static Data.

Temporary Connection object that is created when a connection is set up.

QString Frapper::ConnectionGraphicsItem::m_name
private

The name of the connection.

QColor Frapper::ConnectionGraphicsItem::m_color
private

The color to use for painting the item.

QPainterPath Frapper::ConnectionGraphicsItem::m_mainPath
private

The path to use for painting the curved path.

QPainterPath Frapper::ConnectionGraphicsItem::m_shadowPath
private

The path to use for painting the shadow of the curved path.

QPolygonF Frapper::ConnectionGraphicsItem::m_arrowHeadPolygon
private

The arrow head shape to use for painting the item.

QPainterPath Frapper::ConnectionGraphicsItem::m_shapePath
private

The path to return when the shape of the item is requested.

QPointF Frapper::ConnectionGraphicsItem::m_startPoint
private

The start point of the path.

QPointF Frapper::ConnectionGraphicsItem::m_endPoint
private

The end point of the path.

bool Frapper::ConnectionGraphicsItem::m_selfInitiated
private

Flag that states whether a current update has been initiated by this object itself.

Connection* Frapper::ConnectionGraphicsItem::m_connection
private

Pointer to Connection. (Deprecated.)

QMap<QString, Connection *> Frapper::ConnectionGraphicsItem::m_connections
private

List of Connections.

NodeGraphicsItem* Frapper::ConnectionGraphicsItem::m_startNodeItem
private

Pointer to NodeGraphicsItem.

NodeGraphicsItem* Frapper::ConnectionGraphicsItem::m_endNodeItem
private

Pointer to NodeGraphicsItem.

bool Frapper::ConnectionGraphicsItem::m_temp
private

Flag for temporary connection item.

bool Frapper::ConnectionGraphicsItem::m_hovered
private

Flag for mouse hovers over item.


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