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

This class defines the family of a node or connection. The class contains the icon for the family, family name, and minimal data that defines the family. Each family has a name, which is internally converted to an integer (ID) The ID is used to perform isA checks, thus avoiding repeated string matches. More...

#include <ItemFamily.h>

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

List of all members.

Public Member Functions

virtual QString name () const
 name of this family
virtual void setName (const QString &)
 set name of this family
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 isParentOf (const QString &) const
 indicates whether or not the given string is the name of this family or any of its child families
virtual bool isParentOf (const ItemFamily *) const
 indicates whether or not the given family is the name of this family or any of its child families
virtual ItemFamilyroot () const
 get the top-most family
virtual bool isRelatedTo (const ItemFamily *) const
 checks if the given family shares its root family with this family
virtual ItemFamilyparent () const
 get the parent for this family. If there are more than one parents, returns the one with the highest depth
virtual int depth () const
 counts the number of parents that have to be traversed in order to reach the root handle. If this handle has no parents, the values returned is 0. If its parent has no parent, then the value is 1, and so on.
virtual QList< ItemFamily * > parents () const
 get all the parents for this family.
virtual QList< ItemFamily * > children () const
 get all the families that inherit directly from this family
virtual QList< ItemFamily * > allChildren () const
 get all the families that inherit from this family. the list will be ordered in a breadth-first ordering
virtual ~ItemFamily ()
 destructor.
 ItemFamily (const QString &name=QString())
 constructor

Public Attributes

QString description
 description of this family
QStringList synonyms
 other names for this family
QStringList restrictions
 restrictions that apply to this family
QList< UnitmeasurementUnitOptions
 the possible options for measurement name and unit for items in this family
Unit measurementUnit
 the measurement name and unit for items in this family
QHash< QString, qreal > numericalAttributes
 the list of numerical attributes that are common to all members of this family
QHash< QString, QString > textAttributes
 the list of string attributes that are common to all members of this family
QList< QGraphicsItem * > graphicsItems
 the default set of graphics items used to represent items of this family
QPixmap pixmap
 the icon representing this family

Protected Member Functions

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

Protected Attributes

int type
 used for casting between different sub-classes
QString _name
 name of this family
int ID
 the ID for this family. It is used for quick equality checks (instead of using strings)

Static Protected Attributes

static QStringList ALLNAMES
 all family names. This list's lenth is used to assign the next ID
static QList< const ItemFamily * > ALLFAMILIES
 all families by index
static QHash< QString, int > NAMETOID
 the hash stores names for each ID

Friends

class NodeFamily
class ConnectionFamily

Detailed Description

This class defines the family of a node or connection. The class contains the icon for the family, family name, and minimal data that defines the family. Each family has a name, which is internally converted to an integer (ID) The ID is used to perform isA checks, thus avoiding repeated string matches.

Definition at line 69 of file ItemFamily.h.


Constructor & Destructor Documentation

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

destructor.

Definition at line 50 of file ItemFamily.cpp.

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

constructor

Parameters:
QStringname

Definition at line 45 of file ItemFamily.cpp.

Here is the call graph for this function:


Member Function Documentation

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

get all the families that inherit from this family. the list will be ordered in a breadth-first ordering

Returns:
QList<ItemFamily*>

Definition at line 164 of file ItemFamily.cpp.

Here is the call graph for this function:

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

get all the families that inherit directly from this family

Reimplemented in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 66 of file ItemFamily.cpp.

Here is the caller graph for this function:

int Tinkercell::ItemFamily::depth ( ) const [virtual]

counts the number of parents that have to be traversed in order to reach the root handle. If this handle has no parents, the values returned is 0. If its parent has no parent, then the value is 1, and so on.

Returns:
int

Definition at line 68 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ItemFamily::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 in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 103 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Tinkercell::ItemFamily::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 in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 125 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ItemFamily::isA ( int  ID) const [protected, virtual]

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

Reimplemented in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 98 of file ItemFamily.cpp.

bool Tinkercell::ItemFamily::isParentOf ( const QString &  name) const [virtual]

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

Definition at line 131 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ItemFamily::isParentOf ( const ItemFamily family) const [virtual]

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

Definition at line 144 of file ItemFamily.cpp.

Here is the call graph for this function:

bool Tinkercell::ItemFamily::isRelatedTo ( const ItemFamily family) const [virtual]

checks if the given family shares its root family with this family

Definition at line 158 of file ItemFamily.cpp.

Here is the call graph for this function:

QString Tinkercell::ItemFamily::name ( ) const [virtual]

name of this family

Definition at line 57 of file ItemFamily.cpp.

Here is the caller graph for this function:

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

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

See also:
depth

Reimplemented in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 62 of file ItemFamily.cpp.

Here is the caller graph for this function:

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

get all the parents for this family.

Reimplemented in Tinkercell::NodeFamily, and Tinkercell::ConnectionFamily.

Definition at line 64 of file ItemFamily.cpp.

ItemFamily * Tinkercell::ItemFamily::root ( ) const [virtual]

get the top-most family

Definition at line 150 of file ItemFamily.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Tinkercell::ItemFamily::setName ( const QString &  s) [virtual]

set name of this family

Definition at line 80 of file ItemFamily.cpp.

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class ConnectionFamily [friend]

Reimplemented in Tinkercell::NodeFamily.

Definition at line 142 of file ItemFamily.h.

friend class NodeFamily [friend]

Definition at line 141 of file ItemFamily.h.


Member Data Documentation

QString Tinkercell::ItemFamily::_name [protected]

name of this family

Definition at line 131 of file ItemFamily.h.

QList< const ItemFamily * > Tinkercell::ItemFamily::ALLFAMILIES [static, protected]

all families by index

Definition at line 137 of file ItemFamily.h.

QStringList Tinkercell::ItemFamily::ALLNAMES [static, protected]

all family names. This list's lenth is used to assign the next ID

Definition at line 135 of file ItemFamily.h.

description of this family

Definition at line 73 of file ItemFamily.h.

the default set of graphics items used to represent items of this family

Definition at line 87 of file ItemFamily.h.

int Tinkercell::ItemFamily::ID [protected]

the ID for this family. It is used for quick equality checks (instead of using strings)

Definition at line 133 of file ItemFamily.h.

the measurement name and unit for items in this family

Definition at line 81 of file ItemFamily.h.

the possible options for measurement name and unit for items in this family

Definition at line 79 of file ItemFamily.h.

QHash< QString, int > Tinkercell::ItemFamily::NAMETOID [static, protected]

the hash stores names for each ID

Definition at line 139 of file ItemFamily.h.

the list of numerical attributes that are common to all members of this family

Definition at line 83 of file ItemFamily.h.

the icon representing this family

Definition at line 89 of file ItemFamily.h.

restrictions that apply to this family

Definition at line 77 of file ItemFamily.h.

other names for this family

Definition at line 75 of file ItemFamily.h.

the list of string attributes that are common to all members of this family

Definition at line 85 of file ItemFamily.h.

used for casting between different sub-classes

Definition at line 127 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