NodeType Class Reference

Class representing a specific type of nodes. More...

#include <NodeType.h>

Collaboration diagram for NodeType:

Collaboration graph
[legend]

List of all members.

Public Types

typedef QMap< QString, NodeType * > Map
 Type definition for a map with node type names as keys and pointers to node type objects as values.
typedef QPair< QString, QString > Category
 Type definition of a node type category data structure containing a node type category name and node type category icon name.
typedef QList< CategoryCategoryList
 Type definition for a list of node type categories.

Public Member Functions

 NodeType (const QString &filename)
 Constructor of the NodeType class.
 ~NodeType ()
 Destructor of the NodeType class.
QString getName () const
 Returns the name of the node type.
QString getCategoryName () const
 Returns the name of the category under which nodes of this type should be filed.
QColor getColor () const
 Returns the color associated with this node type.
bool isAvailable () const
 Returns whether nodes of this type can be created.
bool isInternal () const
 Returns whether nodes of this type are reserved for internal use.
bool isErroneous () const
 Returns whether errors or warnings occured while parsing the description file.
NodecreateNode (const QString &name)
 Creates a node of this type.

Static Public Attributes

static Category CategorySeparator = NodeType::Category(QString(), QString())
 A special kind of node type category used for separating categories in menus.

Private Member Functions

bool parseDescriptionFile (const QString &filename)
 Parses the XML description file with the given name and creates the list of parameters and connectors that nodes of this type hold.
ParameterGroupparseParameters (QDomElement rootElement)
 Parses the given DOM element and creates the tree of parameters that nodes of this type hold.
void parseAffections (QDomElement rootElement)
 Parses the given DOM element and creates the list of forward and backward affections that nodes of this type hold.

Private Attributes

NodeTypeInterfacem_nodeTypeInterface
 Pointer to a object which implements the NodeTypeInterface. For Node Plugins.
ParameterGroupm_parameterRoot
 The tree containing the parameters with default values for the node type.
QString m_name
 The name of the node type.
QString m_categoryName
 The name of the category under which nodes of this type should be filed.
QColor m_color
 The color associated with the node type.
bool m_available
 Flag that states whether this node type is available. Is set to false when parsing the XML description file failed.
bool m_internal
 Flag that states whether nodes of this type are reserved for internal use.
bool m_erroneous
 Flag that states whether errors or warnings occured while parsing the description file.
QMultiMap< QString, QString > m_affectionMap
 Which input pin is affecting which output pins.

Static Private Attributes

static QMap< QString, unsigned
int > 
s_nodeIndex
 The indices of nodes created of the different node types.


Detailed Description

Class representing a specific type of nodes.

Member Typedef Documentation

typedef QMap<QString, NodeType *> NodeType::Map

Type definition for a map with node type names as keys and pointers to node type objects as values.

typedef QPair<QString, QString> NodeType::Category

Type definition of a node type category data structure containing a node type category name and node type category icon name.

Type definition for a list of node type categories.


Constructor & Destructor Documentation

NodeType::NodeType ( const QString &  filename  ) 

Constructor of the NodeType class.

Constructors and Destructors.

Parameters:
filename The name of an XML file describing the node type.
Constructor of the NodeType class.

Parameters:
filename The name of an XML file describing the node type.

NodeType::~NodeType (  ) 

Destructor of the NodeType class.


Member Function Documentation

QString NodeType::getName (  )  const

Returns the name of the node type.

Public Functions.

Returns:
The name of the node type.
Returns the name of the node type.

Returns:
The name of the node type.

QString NodeType::getCategoryName (  )  const

Returns the name of the category under which nodes of this type should be filed.

Returns:
The name of the category under which nodes of this type should be filed.

QColor NodeType::getColor (  )  const

Returns the color associated with this node type.

Returns:
The color associated with this node type.

bool NodeType::isAvailable (  )  const

Returns whether nodes of this type can be created.

Returns:
True if nodes of this type can be created, otherwise False.

bool NodeType::isInternal (  )  const

Returns whether nodes of this type are reserved for internal use.

It should not be possible to create nodes of internal node types from the framework's user interface.

Returns:
True if nodes of this type are reserved for internal use, otherwise False.

bool NodeType::isErroneous (  )  const

Returns whether errors or warnings occured while parsing the description file.

Returns:
True if errors or warnings occured while parsing the description file, otherwise False.

Node * NodeType::createNode ( const QString &  name  ) 

Creates a node of this type.

Parameters:
name The name for the new node.
Returns:
A pointer to a new node of this type.

bool NodeType::parseDescriptionFile ( const QString &  filename  )  [private]

Parses the XML description file with the given name and creates the list of parameters and connectors that nodes of this type hold.

Private Functions.

Parameters:
filename The name of the XML description file to parse.
Parses the XML description file with the given name and creates the list of parameters and connectors that nodes of this type hold.

Parameters:
filename The name of the XML description file to parse.
Returns:
True if parsing the file succeeded, otherwise False.

ParameterGroup * NodeType::parseParameters ( QDomElement  rootElement  )  [private]

Parses the given DOM element and creates the tree of parameters that nodes of this type hold.

Parameters:
rootElement The DOM element containing a list of <parameter> and <parameters> elements.
Returns:
A parameter group containing the created parameters.
Parameters:
rootElement The DOM element containing a list of <parameter> and >parameters> elements.
Returns:
A parameter group containing the created parameters.

void NodeType::parseAffections ( QDomElement  rootElement  )  [private]

Parses the given DOM element and creates the list of forward and backward affections that nodes of this type hold.

Parameters:
rootElement The DOM element containing a list of <connector> elements.
rootElement The DOM element containing a list of <connector> elements.


Member Data Documentation

A special kind of node type category used for separating categories in menus.

Public Static Data.

QMap< QString, unsigned int > NodeType::s_nodeIndex [static, private]

The indices of nodes created of the different node types.

Private Static Data.

See also:
createNode
The index of nodes created of this node type.
See also:
createNode

Pointer to a object which implements the NodeTypeInterface. For Node Plugins.

The tree containing the parameters with default values for the node type.

QString NodeType::m_name [private]

The name of the node type.

QString NodeType::m_categoryName [private]

The name of the category under which nodes of this type should be filed.

QColor NodeType::m_color [private]

The color associated with the node type.

bool NodeType::m_available [private]

Flag that states whether this node type is available. Is set to false when parsing the XML description file failed.

See also:
NodeType::NodeType

parseDescriptionFile

bool NodeType::m_internal [private]

Flag that states whether nodes of this type are reserved for internal use.

bool NodeType::m_erroneous [private]

Flag that states whether errors or warnings occured while parsing the description file.

QMultiMap<QString, QString> NodeType::m_affectionMap [private]

Which input pin is affecting which output pins.


The documentation for this class was generated from the following files:

Generated on Wed Feb 24 15:01:01 2010 for Frapper by  doxygen 1.5.9