Edge Class Reference

#include <edge.h>

Inheritance diagram for Edge:
QObject

List of all members.

Public Slots

Nodefrom () const
Nodeto () const
QGraphicsSvgItem * connectorFrom () const
QGraphicsSvgItem * connectorTo () const
const QString & value () const
void setValue (const QString &s)
const QString & name () const
void setName (const QString &s)
const QString color () const
void setColor (const QString &s)
qreal width () const
void setWidth (double w)
const QString & style () const
void setStyle (const QString &s)
void addDynamicProperty (QString Property, QVariant value)
void removeDynamicProperty (QString property)
bool showName ()
bool showValue ()
void hideName (bool b)
void hideValue (bool b)
QString fromConnector ()
QString toConnector ()
QString toNode ()
QString fromNode ()

Signals

void removed ()
void changed ()

Public Member Functions

 Edge (Graph *parent, Node *from, Node *to, QGraphicsSvgItem *cFrom, QGraphicsSvgItem *cTo)
 ~Edge ()
int relativeIndex () const
void remove ()
Graphgraph ()

Properties

QString color
QString value
QString name
double width
QString style

Detailed Description

This class is an edge on the graph. it holds the orientation, the from and the to nodes,auto and has a name, value and color properties. you can change all properties by 'edge.propertyName = new property' and access it's value by 'edge.propertyName' . new properties can be added on the fly via edge.addProp(propertyname) , and accessed by edge.propertyName.

Definition at line 42 of file edge.h.


Constructor & Destructor Documentation

Edge::Edge ( Graph parent,
Node from,
Node to,
QGraphicsSvgItem *  cFrom,
QGraphicsSvgItem *  cTo 
)

default constructor, an edge connects two nodes. parent a Graph from the first node to the second node

Definition at line 28 of file edge.cpp.

Edge::~Edge (  ) 

default destructor

Definition at line 60 of file edge.cpp.


Member Function Documentation

void Edge::addDynamicProperty ( QString  Property,
QVariant  value 
) [slot]

Add a property to this edge

Parameters:
property Name of property
Parameters:
value Value of the property. value shoud be different of QVariant::Invalid.

Definition at line 126 of file edge.cpp.

void Edge::changed (  )  [signal]

emmited when a node connected to this edge changes, or when this edge changes.

const QString Edge::color (  )  const [inline, slot]

gets the color attribute of the edge

Returns:
the string value of the edge.

Definition at line 174 of file edge.h.

QGraphicsSvgItem* Edge::connectorFrom (  )  const [inline, slot]

return connector edges is from

Returns:
QGraphicsSvgItem of connector

Definition at line 124 of file edge.h.

QGraphicsSvgItem* Edge::connectorTo (  )  const [inline, slot]

return connector edges is to

Returns:
QGraphicsSvgItem of connector

Definition at line 132 of file edge.h.

Node* Edge::from (  )  const [inline, slot]

return the first node of this edge

Returns:
Node* pointer for the first node of this edge.

Definition at line 108 of file edge.h.

QString Edge::fromConnector (  )  [slot]

Definition at line 81 of file edge.cpp.

QString Edge::fromNode (  )  [slot]

Definition at line 91 of file edge.cpp.

Graph* Edge::graph (  )  [inline]

Definition at line 87 of file edge.h.

void Edge::hideName ( bool  b  )  [slot]

Definition at line 112 of file edge.cpp.

void Edge::hideValue ( bool  b  )  [slot]

Definition at line 119 of file edge.cpp.

const QString& Edge::name (  )  const [inline, slot]

returns the name attribute of the edge.

Returns:
the name of the edge.

Definition at line 157 of file edge.h.

int Edge::relativeIndex (  )  const [inline]

relative index is the index that this edge has relative to the nodes that it's bound to. eg. if the nodes have 2 or more edges connecteds between them, it will have a unique identifier relative to that nodes

Returns:
the relativeIndex identifier.

Definition at line 79 of file edge.h.

void Edge::remove (  ) 

remove this node from the graph

Definition at line 76 of file edge.cpp.

void Edge::removed (  )  [signal]

emmited when this edge is removed.

void Edge::removeDynamicProperty ( QString  property  )  [slot]

Remove property arg1 from this edge. If property arg1 don't exist in this edge, nothing is made.

Parameters:
arg1 name os property to remove

Definition at line 135 of file edge.cpp.

void Edge::setColor ( const QString &  s  )  [inline, slot]

sets the color attribute of the edge s the new color of the edge in the format "#000000" or by it's english name ("red" for example)

Definition at line 182 of file edge.h.

void Edge::setName ( const QString &  s  )  [inline, slot]

sets the name attribute of the edge s the new name of this edge

Definition at line 165 of file edge.h.

void Edge::setStyle ( const QString &  s  )  [inline, slot]

Definition at line 202 of file edge.h.

void Edge::setValue ( const QString &  s  )  [inline, slot]

sets the value attribute of this edge s the new value of this edge.

Definition at line 148 of file edge.h.

void Edge::setWidth ( double  w  )  [inline, slot]

Definition at line 192 of file edge.h.

bool Edge::showName (  )  [slot]

Definition at line 102 of file edge.cpp.

bool Edge::showValue (  )  [slot]

Definition at line 107 of file edge.cpp.

const QString& Edge::style (  )  const [inline, slot]

Definition at line 198 of file edge.h.

Node* Edge::to (  )  const [inline, slot]

return the second node of this edge

Returns:
Node* pointer for the second node of this edge.

Definition at line 116 of file edge.h.

QString Edge::toConnector (  )  [slot]

Definition at line 86 of file edge.cpp.

QString Edge::toNode (  )  [slot]

Definition at line 96 of file edge.cpp.

const QString& Edge::value (  )  const [inline, slot]

return the value of this edge

Returns:
the value of the edge.

Definition at line 140 of file edge.h.

qreal Edge::width (  )  const [inline, slot]

Definition at line 188 of file edge.h.


Property Documentation

QString Edge::color [read, write]

all properties are accessible from the scripting engine via .propertyName

this property holds the color attribute.

Definition at line 49 of file edge.h.

QString Edge::name [read, write]

this property holds the name of the edge.

Definition at line 55 of file edge.h.

QString Edge::style [read, write]

this property holds the style of the edge

Definition at line 61 of file edge.h.

QString Edge::value [read, write]

this property hold the value attribute

Definition at line 52 of file edge.h.

double Edge::width [read, write]

this property holds the width of the edge

Definition at line 58 of file edge.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:41 2010 for Gluon by  doxygen 1.6.3