![]() |
TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
|
The handles are used to bring together data and graphics items. Connection Handle contains pointers to all the graphics items that belong to it, the tools that apply to this item, the data for this item, the family that it belongs with, and pointers to nodes connected (in and out) More...
#include <ItemHandle.h>
Public Member Functions | |
virtual QList< NodeHandle * > | nodes (int role=0) const |
returns all the nodes connected to all the connectors in this handle | |
virtual void | addNode (NodeHandle *, int role=0) |
add a node to this connection (only applies to connections with NO grpahics items) | |
virtual void | clearNodes () |
clear all nodes in connection (only applies to connections with NO graphics items) | |
virtual QList< NodeHandle * > | nodesIn () const |
returns all the nodes that are on the "input" side of this connection. If this connection is represented by graphics items, then this is determined by looking at which nodes have an arrow-head associated with them in graphics items If there are no graphics items, then this function uses the _nodes list to find the "in" nodes (role = -1). | |
virtual QList< NodeHandle * > | nodesOut () const |
If this connection is represented by graphics items, then this is determined by looking at which nodes have NO arrow-head associated with them in graphics items If there are no graphics items, then this function uses the _nodes list to find the "out" nodes (role = +1). | |
ConnectionHandle (const QString &name=QString(), ConnectionFamily *family=0) | |
default constructor -- initializes everything | |
ConnectionHandle (ConnectionFamily *family, const QString &name=QString()) | |
one parameter constructor -- initializes everything | |
ConnectionHandle (const ConnectionHandle &) | |
copy constructor -- deep copy of data, but shallow copy of graphics items | |
virtual ConnectionHandle & | operator= (const ConnectionHandle &) |
operator = | |
ConnectionHandle (ConnectionFamily *family, ConnectionGraphicsItem *item) | |
two parameter constructor | |
virtual void | setFamily (ItemFamily *family, bool useCommand=true) |
set the family for this handle | |
virtual ItemHandle * | clone () const |
clone of this handle | |
virtual ItemFamily * | family () const |
family for this handle | |
virtual QList< ItemFamily * > | findValidChildFamilies () const |
find child-families of the current family that this connection can potentially belong with | |
Static Public Member Functions | |
static ConnectionHandle * | cast (ItemHandle *) |
checks if the item handle is a connection handle and casts it as a connection item. Returns 0 if it is not a node item | |
static QList< ConnectionHandle * > | cast (const QList< ItemHandle * > &) |
checks if the item handles are connection handles and casts then as connection items. Returns QList<ConnectionHandle*> | |
Public Attributes | |
ConnectionFamily * | connectionFamily |
the family for this connection handle | |
QList< QPair< NodeHandle *, int > > | nodesWithRoles |
the nodes that are connected by this connection and the role of each node. this list is ONLY used for connections with NO graphics items | |
Static Public Attributes | |
static const int | TYPE = 2 |
this number is used to identify when an item handle is a connection handle |
The handles are used to bring together data and graphics items. Connection Handle contains pointers to all the graphics items that belong to it, the tools that apply to this item, the data for this item, the family that it belongs with, and pointers to nodes connected (in and out)
Definition at line 302 of file ItemHandle.h.
Tinkercell::ConnectionHandle::ConnectionHandle | ( | const QString & | name = QString() , |
ConnectionFamily * | family = 0 |
||
) |
default constructor -- initializes everything
Definition at line 741 of file ItemHandle.cpp.
Tinkercell::ConnectionHandle::ConnectionHandle | ( | ConnectionFamily * | family, |
const QString & | name = QString() |
||
) |
one parameter constructor -- initializes everything
ConnectionFamily* | connection family |
QString | name |
Definition at line 749 of file ItemHandle.cpp.
Tinkercell::ConnectionHandle::ConnectionHandle | ( | const ConnectionHandle & | copy | ) |
copy constructor -- deep copy of data, but shallow copy of graphics items
Definition at line 788 of file ItemHandle.cpp.
Tinkercell::ConnectionHandle::ConnectionHandle | ( | ConnectionFamily * | family, |
ConnectionGraphicsItem * | item | ||
) |
two parameter constructor
ConnectionFamily* | initial family |
ConnectionGraphicsItem* | connection graphics item |
Definition at line 755 of file ItemHandle.cpp.
void Tinkercell::ConnectionHandle::addNode | ( | NodeHandle * | h, |
int | role = 0 |
||
) | [virtual] |
add a node to this connection (only applies to connections with NO grpahics items)
NodeHandle* | node |
int | role of this node. -1 is for "in" nodes. +1 is for "out" nodes. Use any other values for specific purposes |
Definition at line 936 of file ItemHandle.cpp.
ConnectionHandle * Tinkercell::ConnectionHandle::cast | ( | ItemHandle * | item | ) | [static] |
checks if the item handle is a connection handle and casts it as a connection item. Returns 0 if it is not a node item
ItemHandle* | item |
Definition at line 724 of file ItemHandle.cpp.
QList< ConnectionHandle * > Tinkercell::ConnectionHandle::cast | ( | const QList< ItemHandle * > & | items | ) | [static] |
checks if the item handles are connection handles and casts then as connection items. Returns QList<ConnectionHandle*>
Returns | QList<ItemHandle*> items |
Definition at line 731 of file ItemHandle.cpp.
void Tinkercell::ConnectionHandle::clearNodes | ( | ) | [virtual] |
clear all nodes in connection (only applies to connections with NO graphics items)
Definition at line 942 of file ItemHandle.cpp.
ItemHandle * Tinkercell::ConnectionHandle::clone | ( | ) | const [virtual] |
clone of this handle
Reimplemented from Tinkercell::ItemHandle.
Definition at line 802 of file ItemHandle.cpp.
ItemFamily * Tinkercell::ConnectionHandle::family | ( | ) | const [virtual] |
family for this handle
Reimplemented from Tinkercell::ItemHandle.
Definition at line 807 of file ItemHandle.cpp.
QList< ItemFamily * > Tinkercell::ConnectionHandle::findValidChildFamilies | ( | ) | const [virtual] |
find child-families of the current family that this connection can potentially belong with
Definition at line 947 of file ItemHandle.cpp.
QList< NodeHandle * > Tinkercell::ConnectionHandle::nodes | ( | int | role = 0 | ) | const [virtual] |
returns all the nodes connected to all the connectors in this handle
Definition at line 812 of file ItemHandle.cpp.
QList< NodeHandle * > Tinkercell::ConnectionHandle::nodesIn | ( | ) | const [virtual] |
returns all the nodes that are on the "input" side of this connection. If this connection is represented by graphics items, then this is determined by looking at which nodes have an arrow-head associated with them in graphics items If there are no graphics items, then this function uses the _nodes list to find the "in" nodes (role = -1).
Definition at line 846 of file ItemHandle.cpp.
QList< NodeHandle * > Tinkercell::ConnectionHandle::nodesOut | ( | ) | const [virtual] |
If this connection is represented by graphics items, then this is determined by looking at which nodes have NO arrow-head associated with them in graphics items If there are no graphics items, then this function uses the _nodes list to find the "out" nodes (role = +1).
Definition at line 891 of file ItemHandle.cpp.
ConnectionHandle & Tinkercell::ConnectionHandle::operator= | ( | const ConnectionHandle & | copy | ) | [virtual] |
operator =
Definition at line 794 of file ItemHandle.cpp.
void Tinkercell::ConnectionHandle::setFamily | ( | ItemFamily * | family, |
bool | useCommand = true |
||
) | [virtual] |
set the family for this handle
ConnectionFamily* | connection family |
Reimplemented from Tinkercell::ItemHandle.
Definition at line 766 of file ItemHandle.cpp.
the family for this connection handle
Definition at line 333 of file ItemHandle.h.
QList< QPair<NodeHandle*, int> > Tinkercell::ConnectionHandle::nodesWithRoles |
the nodes that are connected by this connection and the role of each node. this list is ONLY used for connections with NO graphics items
-1 and 1 are reseved roles, indicating in and out nodes
Definition at line 373 of file ItemHandle.h.
const int Tinkercell::ConnectionHandle::TYPE = 2 [static] |
this number is used to identify when an item handle is a connection handle
Definition at line 306 of file ItemHandle.h.