NodeFactory Class Reference

Static class managing node types and Node object creation. More...

#include <NodeFactory.h>

List of all members.

Static Public Member Functions

static void initialize ()
 Initializes the node factory for producing nodes.
static void registerType (const QString &filename)
 Loads the XML description of a node type from the file with the given name.
static unsigned int getNumCategories ()
 Returns the number of node type categories available in the node factory.
static QString getCategoryName (unsigned int index)
 Returns the name of the node type category with the given index.
static QString getCategoryName (const QString &typeName)
 Returns the name of the category under which nodes of the given type name should be filed.
static QString getCategoryIconName (unsigned int index)
 Returns the name of the icon of the node type category with the given index.
static QString getCategoryIconName (const QString &typeName)
 Returns the name of the icon of the category under which nodes of the given type name should be filed.
static QStringList getTypeNames (bool internalTypes=false)
 Returns the list of types that are registered with the NodeFactory.
static QColor getColor (const QString &typeName)
 Returns the color associated with the node type of the given name.
static bool isErroneous (const QString &typeName)
 Returns whether errors or warnings occured while parsing the description file for the node type with the given name.
static NodecreateNode (const QString &typeName, const QString &name)
 Creates a node of the given type name with the given name.
static void freeResources ()
 Frees all resources that were used by private static data of the node factory class.

Static Private Attributes

static NodeType::CategoryList s_nodeTypeCategories
 A list of node type categories available in the node factory.
static NodeType::Map s_nodeTypes
 The map of node types with node type names as keys and pointers to node type objects as values.


Detailed Description

Static class managing node types and Node object creation.

Member Function Documentation

void NodeFactory::initialize (  )  [static]

Initializes the node factory for producing nodes.

Public Static Functions.

void NodeFactory::registerType ( const QString &  filename  )  [static]

Loads the XML description of a node type from the file with the given name.

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

unsigned int NodeFactory::getNumCategories (  )  [static]

Returns the number of node type categories available in the node factory.

Returns:
The number of node type categories available in the node factory.

QString NodeFactory::getCategoryName ( unsigned int  index  )  [static]

Returns the name of the node type category with the given index.

Parameters:
index The index of the node type category whose name to return.
Returns:
The name of the node type category with the given index.

QString NodeFactory::getCategoryName ( const QString &  typeName  )  [static]

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

Parameters:
typeName The name of a node type for which to return the category name.
Returns:
The category name corresponding to the given node type name.

QString NodeFactory::getCategoryIconName ( unsigned int  index  )  [static]

Returns the name of the icon of the node type category with the given index.

Parameters:
index The index of the node type category whose icon name to return.
Returns:
The name of the icon of the node type category with the given index.

QString NodeFactory::getCategoryIconName ( const QString &  typeName  )  [static]

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

Parameters:
typeName The name of a node type for which to return the category icon.
Returns:
The name of the category icon corresponding to the given node type name.

QStringList NodeFactory::getTypeNames ( bool  internalTypes = false  )  [static]

Returns the list of types that are registered with the NodeFactory.

Parameters:
internalTypes Flag to control whether to include internal node types in the result.
Returns:
The list of types that are registered with the NodeFactory.

QColor NodeFactory::getColor ( const QString &  typeName  )  [static]

Returns the color associated with the node type of the given name.

Parameters:
typeName The name of the node type for which to return the associated color.
Returns:
A color representing nodes of the given type name.

bool NodeFactory::isErroneous ( const QString &  typeName  )  [static]

Returns whether errors or warnings occured while parsing the description file for the node type with the given name.

Parameters:
typeName The name of the node type for which to return whether errors or warnings occured.
Returns:
True if errors or warnings occured while parsing the description file for the node type with the given name, otherwise False.

Node * NodeFactory::createNode ( const QString &  typeName,
const QString &  name 
) [static]

Creates a node of the given type name with the given name.

Parameters:
typeName The name of the type to use for the new node.
name The name to give to the new node.
Returns:
A pointer to the new node.

void NodeFactory::freeResources (  )  [static]

Frees all resources that were used by private static data of the node factory class.


Member Data Documentation

A list of node type categories available in the node factory.

Private Static Data.

QMap< QString, NodeType * > NodeFactory::s_nodeTypes [static, private]

The map of node types with node type names as keys and pointers to node type objects as values.


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