TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
Tinkercell::ConnectionHandle Class Reference

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>

Inheritance diagram for Tinkercell::ConnectionHandle:
Inheritance graph
[legend]
Collaboration diagram for Tinkercell::ConnectionHandle:
Collaboration graph
[legend]

List of all members.

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 ConnectionHandleoperator= (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 ItemHandleclone () const
 clone of this handle
virtual ItemFamilyfamily () 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 ConnectionHandlecast (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

ConnectionFamilyconnectionFamily
 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

Detailed Description

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.


Constructor & Destructor Documentation

Tinkercell::ConnectionHandle::ConnectionHandle ( const QString &  name = QString(),
ConnectionFamily family = 0 
)

default constructor -- initializes everything

Definition at line 741 of file ItemHandle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Tinkercell::ConnectionHandle::ConnectionHandle ( ConnectionFamily family,
const QString &  name = QString() 
)

one parameter constructor -- initializes everything

Parameters:
ConnectionFamily*connection family
QStringname

Definition at line 749 of file ItemHandle.cpp.

Here is the call graph for this function:

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

Parameters:
ConnectionFamily*initial family
ConnectionGraphicsItem*connection graphics item

Definition at line 755 of file ItemHandle.cpp.

Here is the call graph for this function:


Member Function Documentation

void Tinkercell::ConnectionHandle::addNode ( NodeHandle h,
int  role = 0 
) [virtual]

add a node to this connection (only applies to connections with NO grpahics items)

Parameters:
NodeHandle*node
introle 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

Parameters:
ItemHandle*item

Definition at line 724 of file ItemHandle.cpp.

Here is the caller graph for this function:

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*>

Parameters:
ReturnsQList<ItemHandle*> items

Definition at line 731 of file ItemHandle.cpp.

Here is the call graph for this function:

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

Returns:
ItemFamily* connection handle as item handle

Reimplemented from Tinkercell::ItemHandle.

Definition at line 802 of file ItemHandle.cpp.

Here is the call graph for this function:

ItemFamily * Tinkercell::ConnectionHandle::family ( ) const [virtual]

family for this handle

Returns:
ItemFamily* connection family as item family

Reimplemented from Tinkercell::ItemHandle.

Definition at line 807 of file ItemHandle.cpp.

Here is the caller graph for this function:

QList< ItemFamily * > Tinkercell::ConnectionHandle::findValidChildFamilies ( ) const [virtual]

find child-families of the current family that this connection can potentially belong with

Returns:
QList<ItemFamily*> valid connection families

Definition at line 947 of file ItemHandle.cpp.

Here is the call graph for this function:

QList< NodeHandle * > Tinkercell::ConnectionHandle::nodes ( int  role = 0) const [virtual]

returns all the nodes connected to all the connectors in this handle

Returns:
QList<NodeHandle*> list of node handles

Definition at line 812 of file ItemHandle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Returns:
QList<NodeHandle*> list of node handles

Definition at line 846 of file ItemHandle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Returns:
QList<NodeHandle*> list of node handles

Definition at line 891 of file ItemHandle.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
ConnectionFamily*connection family

Reimplemented from Tinkercell::ItemHandle.

Definition at line 766 of file ItemHandle.cpp.

Here is the call graph for this function:


Member Data Documentation

the family for this connection handle

Definition at line 333 of file ItemHandle.h.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines