Frapper  1.0a
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Frapper::NodeType Class Reference

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

#include <NodeType.h>

Collaboration diagram for Frapper::NodeType:
Collaboration graph
[legend]

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

Frapper::NodeType::NodeType ( const QString &  filename)

Constructor of the NodeType class.

Constructors and Destructors.

Parameters
filenameThe name of an XML file describing the node type.

Constructor of the NodeType class.

Parameters
filenameThe name of an XML file describing the node type.
Frapper::NodeType::~NodeType ( )

Destructor of the NodeType class.

Member Function Documentation

QString Frapper::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 Frapper::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 Frapper::NodeType::getColor ( ) const

Returns the color associated with this node type.

Returns
The color associated with this node type.
bool Frapper::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 Frapper::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 Frapper::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 * Frapper::NodeType::createNode ( const QString &  name)

Creates a node of this type.

Parameters
nameThe name for the new node.
Returns
A pointer to a new node of this type.
bool Frapper::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
filenameThe 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
filenameThe name of the XML description file to parse.
Returns
True if parsing the file succeeded, otherwise False.
ParameterGroup * Frapper::NodeType::parseParameters ( QDomElement  rootElement)
private

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

Parameters
rootElementThe DOM element containing a list of <parameter> and <parameters> elements.
Returns
A parameter group containing the created parameters.
Parameters
rootElementThe DOM element containing a list of <parameter> and >parameters> elements.
Returns
A parameter group containing the created parameters.
void Frapper::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
rootElementThe DOM element containing a list of <connector> elements.
rootElementThe DOM element containing a list of <connector> elements.

Member Data Documentation

NodeType::Category Frapper::NodeType::CategorySeparator = NodeType::Category(QString(), QString())
static

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

Public Static Data.

QMap< QString, unsigned int > Frapper::NodeType::s_nodeIndex
staticprivate

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
NodeTypeInterface* Frapper::NodeType::m_nodeTypeInterface
private

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

ParameterGroup* Frapper::NodeType::m_parameterRoot
private

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

QString Frapper::NodeType::m_name
private

The name of the node type.

QString Frapper::NodeType::m_categoryName
private

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

QColor Frapper::NodeType::m_color
private

The color associated with the node type.

bool Frapper::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 Frapper::NodeType::m_internal
private

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

bool Frapper::NodeType::m_erroneous
private

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

QMultiMap<QString, QString> Frapper::NodeType::m_affectionMap
private

Which input pin is affecting which output pins.


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