![]() |
TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
|
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>
Public Member Functions | |
virtual ItemFamily * | parent () 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 ConnectionFamily * | cast (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 |
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.
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.
bool Tinkercell::ConnectionFamily::addParticipant | ( | const QString & | role, |
const QString & | family | ||
) | [virtual] |
add a participant
in a connection and related functions
QString | role of participant |
QString | type of participant, must be a family name of a node |
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.
QList< ConnectionFamily * > Tinkercell::ConnectionFamily::cast | ( | const QList< ItemFamily * > & | items | ) | [static] |
cast to connection family
Definition at line 310 of file ItemFamily.cpp.
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.
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.
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
bool | QList<NodeHandle*> node handles |
bool | use false here if the list of nodes is a partial list |
Definition at line 462 of file ItemFamily.cpp.
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.
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.
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
bool | QList<NodeHandle*> node handles |
bool | use false here if the list of nodes is a partial list |
Definition at line 412 of file ItemFamily.cpp.
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)
ConnectionFamily | * |
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.
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
QString | role of participant |
Definition at line 519 of file ItemFamily.cpp.
QStringList Tinkercell::ConnectionFamily::participantRoles | ( | ) | const [virtual] |
get all participant roles
Definition at line 542 of file ItemFamily.cpp.
QStringList Tinkercell::ConnectionFamily::participantTypes | ( | ) | const [virtual] |
get all participant family names
Definition at line 552 of file ItemFamily.cpp.
void Tinkercell::ConnectionFamily::setParent | ( | ConnectionFamily * | p | ) | [virtual] |
set parent family
Definition at line 403 of file ItemFamily.cpp.
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
QString | role name |
Definition at line 576 of file ItemFamily.cpp.
QStringList Tinkercell::ConnectionFamily::ALLROLENAMES [static, protected] |
all role names. used to assign role IDs
Definition at line 271 of file ItemFamily.h.
QList<ConnectionFamily*> Tinkercell::ConnectionFamily::childFamilies [protected] |
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.
QList<ConnectionFamily*> Tinkercell::ConnectionFamily::parentFamilies [protected] |
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.