Types.hh

Go to the documentation of this file.
00001 /*===========================================================================*\
00002  *                                                                           *
00003  *                              OpenFlipper                                  *
00004  *      Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen      *
00005  *                           www.openflipper.org                             *
00006  *                                                                           *
00007  *---------------------------------------------------------------------------*
00008  *  This file is part of OpenFlipper.                                        *
00009  *                                                                           *
00010  *  OpenFlipper is free software: you can redistribute it and/or modify      *
00011  *  it under the terms of the GNU Lesser General Public License as           *
00012  *  published by the Free Software Foundation, either version 3 of           *
00013  *  the License, or (at your option) any later version with the              *
00014  *  following exceptions:                                                    *
00015  *                                                                           *
00016  *  If other files instantiate templates or use macros                       *
00017  *  or inline functions from this file, or you compile this file and         *
00018  *  link it with other files to produce an executable, this file does        *
00019  *  not by itself cause the resulting executable to be covered by the        *
00020  *  GNU Lesser General Public License. This exception does not however       *
00021  *  invalidate any other reasons why the executable file might be            *
00022  *  covered by the GNU Lesser General Public License.                        *
00023  *                                                                           *
00024  *  OpenFlipper is distributed in the hope that it will be useful,           *
00025  *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
00026  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
00027  *  GNU Lesser General Public License for more details.                      *
00028  *                                                                           *
00029  *  You should have received a copy of the GNU LesserGeneral Public          *
00030  *  License along with OpenFlipper. If not,                                  *
00031  *  see <http://www.gnu.org/licenses/>.                                      *
00032  *                                                                           *
00033 \*===========================================================================*/
00034 
00035 /*===========================================================================*\
00036  *                                                                           *
00037  *   $Revision: 7306 $                                                         *
00038  *   $Author: kremer $                                                      *
00039  *   $Date: 2009-10-02 15:25:40 +0200 (Fr, 02. Okt 2009) $                   *
00040  *                                                                           *
00041 \*===========================================================================*/
00042 
00043 
00044 
00045 
00046 //=============================================================================
00047 //
00048 //  Types
00049 //
00050 //=============================================================================
00051 
00058 #ifndef TYPES_HH
00059 #define TYPES_HH
00060 
00061 #include <OpenFlipper/common/GlobalDefines.hh>
00062 #include <limits.h>
00063 #include <QIcon>
00064 
00065 
00066 //== Global Typedefs  =================================================================
00067 
00074 
00075 #define DATA_UNKNOWN 0
00076 
00078 #define DATA_GROUP 1
00079 
00081 #define DATA_TRIANGLE_MESH typeId("TriangleMesh")
00082 #define DATA_TRIANGLE_MESH_CONST_ID 2
00083 
00085 #define DATA_POLY_MESH typeId("PolyMesh")
00086 #define DATA_POLY_MESH_CONST_ID 4
00087 
00089 const unsigned int DATA_ALL           = UINT_MAX;
00090 
00091 typedef unsigned int DataType;
00092 
00093 // TODO: Make types runtime addable
00094 
00095 //== INCLUDES =================================================================
00096 
00097 #include "BaseObject.hh"
00098 #include "GroupObject.hh"
00099 #include "BaseObjectData.hh"
00100 
00101 //== TYPEDEFS =================================================================
00102 
00104 typedef ACG::Vec3d Vector;
00106 typedef std::vector< int > idList;
00108 typedef ACG::Matrix4x4d Matrix4x4;
00109 
00110 Q_DECLARE_METATYPE(idList);
00111 Q_DECLARE_METATYPE(QVector< int >);
00112 Q_DECLARE_METATYPE(Vector);
00113 Q_DECLARE_METATYPE(Matrix4x4);
00114 
00116 typedef std::vector<BaseObjectData*> DataContainer;
00117 
00118 //================================================================================================
00121 //================================================================================================
00122 
00128 DLLEXPORT
00129 DataType addDataType(QString _name, QString _readableName);
00130 
00132 DLLEXPORT
00133 DataType typeId(QString _name);
00134 
00136 DLLEXPORT
00137 QString typeName(DataType _id);
00138 
00141 //================================================================================================
00144 //================================================================================================
00145 
00147 DLLEXPORT
00148 QString dataTypeName( DataType _id );
00149 
00151 DLLEXPORT
00152 QString dataTypeName( QString _typeName);
00153 
00155 DLLEXPORT
00156 void setDataTypeName( DataType _id, QString _name );
00157 
00159 DLLEXPORT
00160 void setDataTypeName( QString _typeName, QString _name );
00161 
00162 
00165 //================================================================================================
00168 //================================================================================================
00169 
00171 DLLEXPORT
00172 QString typeIcon(QString  _name);
00173 
00175 DLLEXPORT
00176 QString typeIcon(DataType _id);
00177 
00179 DLLEXPORT
00180 void setTypeIcon( DataType _id   , QString _icon);
00181 
00183 DLLEXPORT
00184 void setTypeIcon( QString  _name , QString _icon );
00185 
00189 //=============================================================================
00190 #endif // TYPES_HH defined
00191 //=============================================================================

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