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

This class defines the family of a connection. Inherits from ItemFamily It contains a list ofConnectioGraphicsItems that is the default for this family of connections. More...

#include <ItemFamily.h>

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

List of all members.

Public Member Functions

virtual ItemFamilyparent () const
 get the parent for this family. If there are more than one parents, returns the first
virtual QList< ItemFamily * > parents () const
 get all the parents for this family.
virtual QList< ItemFamily * > children () const
 get all the families that make up this family.
virtual void setParent (ConnectionFamily *)
 set parent family
virtual ~ConnectionFamily ()
 destructor.
 ConnectionFamily (const QString &name=QString())
 constructor.
virtual bool isA (const QString &) const
 indicates whether or not the given string is the name of this family or any of its parent families
virtual bool isA (const ItemFamily *) const
 indicates whether or not the given family is the name of this family or any of its parent families
virtual bool addParticipant (const QString &role, const QString &family)
 add a participant
virtual QString participantFamily (const QString &role) const
 get participant family
virtual QStringList participantRoles () const
 get all participant roles
virtual QStringList participantTypes () const
 get all participant family names
virtual bool isValidSet (const QList< NodeHandle * > &nodes, bool checkFull=true)
 checks if this family is compatible with a connection composed of the given set of nodes
virtual QList< ItemFamily * > findValidChildFamilies (const QList< NodeHandle * > &, bool checkFull=true)
 find child-families of this family that the given set of nodes can potentially belong with
virtual int numberOfIdenticalNodesFamilies (ConnectionFamily *) const
 finds the number of node families that are common between the two connections (the node families should be exactly the same, not isA)
virtual QStringList synonymsForRole (const QString &role) const
 finds possible role synonyms by looking at child families and finding roles with the same index

Static Public Member Functions

static ConnectionFamilycast (ItemFamily *)
 cast to connection family
static QList< ConnectionFamily * > cast (const QList< ItemFamily * > &)
 cast to connection family

Protected Member Functions

virtual bool isA (int) const
 indicates whether or not the given ID is this family or any of its parent families

Static Protected Member Functions

static bool checkRestrictions (const QString &restriction, const QList< NodeHandle * > &, bool checkFull=true)
 check for restrictions. RESTRICTIONS ARE HARD CODED. SEE FUNCTION CODE

Protected Attributes

QList< ConnectionFamily * > parentFamilies
 all the parents
QList< ConnectionFamily * > childFamilies
 all the families that are under this family
QList< QPair< int, int > > nodeRoles
 the role ID and type ID of each node that is involved in this connection

Static Protected Attributes

static QHash< QString, int > ROLEID
 stored a list of all possible node roles as IDs
static QStringList ALLROLENAMES
 all role names. used to assign role IDs

Detailed Description

This class defines the family of a connection. Inherits from ItemFamily It contains a list ofConnectioGraphicsItems that is the default for this family of connections.

Definition at line 192 of file ItemFamily.h.


Constructor & Destructor Documentation

Tinkercell::ConnectionFamily::~ConnectionFamily ( ) [virtual]

destructor.

Definition at line 326 of file ItemFamily.cpp.

Tinkercell::ConnectionFamily::ConnectionFamily ( const QString &  name = QString())

constructor.

Definition at line 320 of file ItemFamily.cpp.


Member Function Documentation

bool Tinkercell::ConnectionFamily::addParticipant ( const QString &  role,
const QString &  family 
) [virtual]

add a participant

in a connection and related functions

Parameters:
QStringrole of participant
QStringtype of participant, must be a family name of a node
Returns:
bool false if the participant family does not exist (i.e role not added)

Definition at line 494 of file ItemFamily.cpp.

ConnectionFamily * Tinkercell::ConnectionFamily::cast ( ItemFamily item) [static]

cast to connection family

Definition at line 303 of file ItemFamily.cpp.

Here is the caller graph for this function:

QList< ConnectionFamily * > Tinkercell::ConnectionFamily::cast ( const QList< ItemFamily * > &  items) [static]

cast to connection family

Definition at line 310 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ConnectionFamily::checkRestrictions ( const QString &  restriction,
const QList< NodeHandle * > &  nodes,
bool  checkFull = true 
) [static, protected]

check for restrictions. RESTRICTIONS ARE HARD CODED. SEE FUNCTION CODE

Definition at line 631 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QList< ItemFamily * > Tinkercell::ConnectionFamily::children ( ) const [virtual]

get all the families that make up this family.

Reimplemented from Tinkercell::ItemFamily.

Definition at line 395 of file ItemFamily.cpp.

Here is the caller graph for this function:

QList< ItemFamily * > Tinkercell::ConnectionFamily::findValidChildFamilies ( const QList< NodeHandle * > &  nodes,
bool  checkFull = true 
) [virtual]

find child-families of this family that the given set of nodes can potentially belong with

Parameters:
boolQList<NodeHandle*> node handles
booluse false here if the list of nodes is a partial list
Returns:
QList<ItemFamily*> valid connection families

Definition at line 462 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Tinkercell::ConnectionFamily::isA ( int  id) const [protected, virtual]

indicates whether or not the given ID is this family or any of its parent families

indicates whether or not the given string is the name of this family or any of its parent families

Reimplemented from Tinkercell::ItemFamily.

Definition at line 329 of file ItemFamily.cpp.

bool Tinkercell::ConnectionFamily::isA ( const ItemFamily family) const [virtual]

indicates whether or not the given family is the name of this family or any of its parent families

Reimplemented from Tinkercell::ItemFamily.

Definition at line 362 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ConnectionFamily::isA ( const QString &  name) const [virtual]

indicates whether or not the given string is the name of this family or any of its parent families

Reimplemented from Tinkercell::ItemFamily.

Definition at line 343 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Tinkercell::ConnectionFamily::isValidSet ( const QList< NodeHandle * > &  nodes,
bool  checkFull = true 
) [virtual]

checks if this family is compatible with a connection composed of the given set of nodes

Parameters:
boolQList<NodeHandle*> node handles
booluse false here if the list of nodes is a partial list
Returns:
Boolean

Definition at line 412 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Tinkercell::ConnectionFamily::numberOfIdenticalNodesFamilies ( ConnectionFamily other) const [virtual]

finds the number of node families that are common between the two connections (the node families should be exactly the same, not isA)

Parameters:
ConnectionFamily*
Returns:
bool

Definition at line 562 of file ItemFamily.cpp.

ItemFamily * Tinkercell::ConnectionFamily::parent ( ) const [virtual]

get the parent for this family. If there are more than one parents, returns the first

Reimplemented from Tinkercell::ItemFamily.

Definition at line 368 of file ItemFamily.cpp.

Here is the caller graph for this function:

QList< ItemFamily * > Tinkercell::ConnectionFamily::parents ( ) const [virtual]

get all the parents for this family.

Reimplemented from Tinkercell::ItemFamily.

Definition at line 387 of file ItemFamily.cpp.

QString Tinkercell::ConnectionFamily::participantFamily ( const QString &  role) const [virtual]

get participant family

Parameters:
QStringrole of participant
Returns:
QString family name (empty if none)

Definition at line 519 of file ItemFamily.cpp.

QStringList Tinkercell::ConnectionFamily::participantRoles ( ) const [virtual]

get all participant roles

Returns:
QStringList role names (may not be unique)

Definition at line 542 of file ItemFamily.cpp.

Here is the caller graph for this function:

QStringList Tinkercell::ConnectionFamily::participantTypes ( ) const [virtual]

get all participant family names

Returns:
QStringList family names (may not be unique)

Definition at line 552 of file ItemFamily.cpp.

Here is the caller graph for this function:

void Tinkercell::ConnectionFamily::setParent ( ConnectionFamily p) [virtual]

set parent family

Definition at line 403 of file ItemFamily.cpp.

Here is the call graph for this function:

QStringList Tinkercell::ConnectionFamily::synonymsForRole ( const QString &  role) const [virtual]

finds possible role synonyms by looking at child families and finding roles with the same index

Parameters:
QStringrole name
Returns:
QStringList synonyms for the input role

Definition at line 576 of file ItemFamily.cpp.


Member Data Documentation

QStringList Tinkercell::ConnectionFamily::ALLROLENAMES [static, protected]

all role names. used to assign role IDs

Definition at line 271 of file ItemFamily.h.

all the families that are under this family

Definition at line 265 of file ItemFamily.h.

QList< QPair<int,int> > Tinkercell::ConnectionFamily::nodeRoles [protected]

the role ID and type ID of each node that is involved in this connection

Definition at line 267 of file ItemFamily.h.

all the parents

Definition at line 263 of file ItemFamily.h.

QHash< QString, int > Tinkercell::ConnectionFamily::ROLEID [static, protected]

stored a list of all possible node roles as IDs

Definition at line 269 of file ItemFamily.h.


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