DataTypes.hh File Reference

#include <OpenFlipper/common/GlobalDefines.hh>
#include <ACG/Math/Matrix4x4T.hh>
#include <ACG/Math/VectorT.hh>
#include <limits.h>
#include <QIcon>
#include <QMetaType>
Include dependency graph for DataTypes.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DataType
 Predefined datatypes. More...

Typedefs

typedef ACG::Vec3d Vector
 Standard Type for 3d 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)
 Q_DECLARE_METATYPE (IdList)
 Q_DECLARE_METATYPE (DataType)
 Q_DECLARE_METATYPE (QVector< int >)
 Q_DECLARE_METATYPE (Vector)
 Q_DECLARE_METATYPE (Matrix4x4)
Functions for adding dataTypes

DLLEXPORT DataType addDataType (QString _name, QString _readableName)
 Adds a datatype and returns the id for the new type.
DLLEXPORT DataType typeId (QString _name)
 Given a dataType Identifier string this function will return the id of the datatype.
DLLEXPORT QString typeName (DataType _id)
 Get the name of a type with given id.
DLLEXPORT uint typeCount ()
 Get the number of registered types.
Datatype Name handling

DLLEXPORT QString dataTypeName (DataType _id)
 Get DataType Human readable name ( this name might change. Use the typeName insted! ).
DLLEXPORT QString dataTypeName (QString _typeName)
 Get DataType Human readable name ( this name might change. Use the typeName insted! ).
DLLEXPORT void setDataTypeName (DataType _id, QString _name)
 Set DataType Human readable name.
DLLEXPORT void setDataTypeName (QString _typeName, QString _name)
 Set DataType Human readable name.
Datatype Icons

DLLEXPORT QString typeIconName (QString _name)
 Get a string with the filename of the icon for the DataType name.
DLLEXPORT QString typeIconName (DataType _id)
 Get a string with the filename of the icon for the DataType.
DLLEXPORT QIcon & typeIcon (DataType _id)
 Get an QIcon associated with the given datatype.
DLLEXPORT void setTypeIcon (DataType _id, QString _icon)
 Set an Icon for a given DataType.
DLLEXPORT void setTypeIcon (QString _name, QString _icon)
 Set an Icon for a given DataType.

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

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 150 of file Types.cc.

References nextTypeId_, stringToTypeInfo, typeToString, and typeToTypeInfo.

DLLEXPORT uint 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.

Remember that the types are organized in a bitfield!

Definition at line 196 of file Types.cc.

Referenced by CoreWidget::showAboutWidget(), and Core::slotAddEmptyObjectMenu().

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)

Definition at line 223 of file Types.cc.

References typeToTypeInfo.

Referenced by CoreWidget::updatePopupMenuObject(), and CoreWidget::updateRecent().

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 180 of file Types.cc.

References typeToString.

Referenced by BaseObject::dumpTree(), DataType::name(), Core::openIniFile(), CoreWidget::showAboutWidget(), Core::slotAddEmptyObjectMenu(), CoreWidget::updatePopupMenuObject(), and Core::writeIniFile().


acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .