Developer Documentation

Classes | Typedefs | Functions | Variables
DataTypes.hh File Reference
`#include <OpenFlipper/common/GlobalDefines.hh>`
`#include <OpenFlipper/common/UpdateType.hh>`
`#include <ACG/Math/Matrix4x4T.hh>`
`#include <ACG/Math/VectorT.hh>`
`#include <climits>`
`#include <QIcon>`
`#include <QMetaType>`

Go to the source code of this file.

## Classes
class | DataType
| Predefined datatypes. More...
class | TypeInfo

## Typedefs
typedef ACG::Vec3d | Vector
| Standard Type for 3d Vector used for scripting.
typedef ACG::Vec4d | Vector4
| Standard Type for 4d Vector used for scripting.
typedef std::vector< int > | IdList
| Standard Type for id Lists used for scripting.
typedef ACG::Matrix4x4d | Matrix4x4
| Standard Type for a 4x4 Matrix used for scripting.

## Functions
std::ostream & | operator<< (std::ostream &stream, DataType type)
DLLEXPORT void | registerTypes ()
Functions for adding dataTypes
DLLEXPORT DataType | addDataType (QString _name, QString _readableName)
| Adds a datatype and returns the id for the new type. More...
DLLEXPORT DataType | typeId (QString _name)
| Given a dataType Identifier string this function will return the id of the datatype. More...
DLLEXPORT QString | typeName (DataType _id)
| Get the name of a type with given id. More...
DLLEXPORT bool | typeExists (QString _name)
| Check if a type with the given name exists. More...
DLLEXPORT size_t | typeCount ()
| Get the number of registered types. More...
Type iterators
DLLEXPORT std::vector< TypeInfo >::const_iterator | typesBegin ()
| Get iterator pointing to the first element in the types list. More...
DLLEXPORT std::vector< TypeInfo >::const_iterator | typesEnd ()
| Get iterator pointing to the last element in the types list. More...
Datatype Name handling
DLLEXPORT QString | dataTypeName (DataType _id)
| Get DataType Human readable name ( this name might change. Use the typeName instead! ) More...
DLLEXPORT QString | dataTypeName (QString _typeName)
| Get DataType Human readable name ( this name might change. Use the typeName instead! ) More...
DLLEXPORT void | setDataTypeName (DataType _id, QString _name)
| Set DataType Human readable name. More...
DLLEXPORT void | setDataTypeName (QString _typeName, QString _name)
| Set DataType Human readable name. More...
Datatype Icons
DLLEXPORT QString | typeIconName (QString _name)
| Get a string with the filename of the icon for the DataType name. More...
DLLEXPORT QString | typeIconName (DataType _id)
| Get a string with the filename of the icon for the DataType. More...
DLLEXPORT QIcon & | typeIcon (DataType _id)
| Get an QIcon associated with the given DataType. More...
DLLEXPORT void | setTypeIcon (DataType _id, QString _icon)
| Set an Icon for a given DataType. More...
DLLEXPORT void | setTypeIcon (QString _name, QString _icon)
| Set an Icon for a given DataType. More...

## Variables
const DataType | DATA_ALL (UINT_MAX)
| Identifier for all available objects.
const DataType | DATA_UNKNOWN (0)
| None of the other Objects.
const DataType | DATA_GROUP (1)
| Items used for Grouping.

## Detailed Description

This File contains the basic type informations

Definition in file DataTypes.hh.

## Function Documentation

## ◆ addDataType()

DLLEXPORT DataType addDataType | ( | QString | _name,
|  | QString | _readableName
| ) |  |

Adds a datatype and returns the id for the new type.

Adds a datatype and returns the id for the new type

Parameters

  _name | Internal name for the new DataType
  _readableName | Human readable Name for this type ( Use tr to make it translatable )

Definition at line 117 of file Types.cc.

## ◆ dataTypeName() [1/2]

DLLEXPORT QString dataTypeName | ( | DataType | _id | ) |

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Definition at line 252 of file Types.cc.

## ◆ dataTypeName() [2/2]

DLLEXPORT QString dataTypeName | ( | QString | _typeName | ) |

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Definition at line 265 of file Types.cc.

## ◆ registerTypes()

DLLEXPORT void registerTypes | ( |  | ) |

Registers datatypes on runtime for signal/slots

Definition at line 422 of file Types.cc.

## ◆ setDataTypeName() [1/2]

DLLEXPORT void setDataTypeName | ( | DataType | _id,
|  | QString | _name
| ) |  |

Set DataType Human readable name.

Set DataType Human readable name.

Definition at line 280 of file Types.cc.

## ◆ setDataTypeName() [2/2]

DLLEXPORT void setDataTypeName | ( | QString | _typeName,
|  | QString | _name
| ) |  |

Set DataType Human readable name.

Set DataType Human readable name.

Definition at line 291 of file Types.cc.

## ◆ setTypeIcon() [1/2]

DLLEXPORT void setTypeIcon | ( | DataType | _id,
|  | QString | _icon
| ) |  |

Set an Icon for a given DataType.

Set an Icon for a given DataType.

Definition at line 223 of file Types.cc.

## ◆ setTypeIcon() [2/2]

DLLEXPORT void setTypeIcon | ( | QString | _name,
|  | QString | _icon
| ) |  |

Set an Icon for a given DataType.

Set an Icon for a given DataType.

Definition at line 237 of file Types.cc.

## ◆ typeCount()

DLLEXPORT size_t typeCount | ( |  | ) |

Get the number of registered types.

This function will return the number of types registered to the core. You can use it to iterate over all types.

Note
  Remember that the types are organized in a bitfield!

Get the number of registered types.

Definition at line 175 of file Types.cc.

## ◆ typeExists()

DLLEXPORT bool typeExists | ( | QString | _name | ) |

Check if a type with the given name exists.

Definition at line 169 of file Types.cc.

## ◆ typeIcon()

DLLEXPORT QIcon& typeIcon | ( | DataType | _id | ) |

Get an QIcon associated with the given DataType.

The icons are loaded once when set and then the reference is returned here. This reduces the time when frequently requesting the icons (e.g. DataControl)

Get an QIcon associated with the given DataType.

Definition at line 212 of file Types.cc.

## ◆ typeIconName() [1/2]

DLLEXPORT QString typeIconName | ( | QString | _name | ) |

Get a string with the filename of the icon for the DataType name.

Get a string with the filename of the icon for the DataType name.

Definition at line 190 of file Types.cc.

## ◆ typeIconName() [2/2]

DLLEXPORT QString typeIconName | ( | DataType | _id | ) |

Get a string with the filename of the icon for the DataType.

Get a string with the filename of the icon for the DataType.

Definition at line 201 of file Types.cc.

## ◆ typeId()

DLLEXPORT DataType typeId | ( | QString | _name | ) |

Given a dataType Identifier string this function will return the id of the datatype.

Given a dataType Identifier string this function will return the id of the datatype.

Definition at line 139 of file Types.cc.

## ◆ typeName()

DLLEXPORT QString typeName | ( | DataType | _id | ) |

Get the name of a type with given id.

The ids are organized in a bitfield. So use either the macro for getting the type id or use the id directly (they have to be power of 2! ... Bitfield)

Definition at line 154 of file Types.cc.

## ◆ typesBegin()

DLLEXPORT std::vector< TypeInfo >::const_iterator typesBegin | ( |  | ) |

Get iterator pointing to the first element in the types list.

Get iterator pointing to the first element in the types list.

Definition at line 180 of file Types.cc.

## ◆ typesEnd()

DLLEXPORT std::vector< TypeInfo >::const_iterator typesEnd | ( |  | ) |

Get iterator pointing to the last element in the types list.

Get iterator pointing to the last element in the types list.

Definition at line 185 of file Types.cc.