DataTypes.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: 8549 $                                                         *
00038  *   $Author: moebius $                                                      *
00039  *   $Date: 2010-02-12 14:40:38 +0100 (Fr, 12. Feb 2010) $                   *
00040  *                                                                           *
00041 \*===========================================================================*/
00042 
00043 
00044 
00045 
00046 //=============================================================================
00047 //
00048 //  Types
00049 //
00050 //=============================================================================
00051 
00058 #ifndef DATATYPES_HH
00059 #define DATATYPES_HH
00060 
00061 //== includes =================================================================
00062 
00063 
00064 #include <OpenFlipper/common/GlobalDefines.hh>
00065 
00066 #include <ACG/Math/Matrix4x4T.hh>
00067 #include <ACG/Math/VectorT.hh>
00068 #include <limits.h>
00069 #include <QIcon>
00070 #include <QMetaType>
00071 
00072 //== Global Typedefs  =================================================================
00073 
00088 class DLLEXPORT DataType  {
00089   public:
00090     DataType();
00091     DataType(const unsigned int& _i);
00092     
00093     bool operator!=( const unsigned int& _i );
00094     bool operator!=( const DataType& _i );
00095     
00096     bool operator==( const unsigned int& _i );
00097     bool operator==(  const DataType& _i );
00098     
00099     bool operator=( const unsigned int& _i );
00100     bool operator=( const DataType& _i );
00101     
00102     bool operator<( const unsigned int& _i );
00103     bool operator<( const DataType& _i ) const;
00104     
00105     DataType& operator|=( const unsigned int& _i );
00106     DataType& operator|=( const DataType& _i );    
00107     
00108     bool operator&( const unsigned int& _i );
00109     bool operator&( const DataType& _i ) const;
00110  
00111     DataType operator|( const DataType& _i ) const;
00112 
00113     bool operator++(int _unused);
00114  
00119     unsigned int value() const;
00120       
00122     QString name();
00123  
00124   private:
00125     unsigned int field;
00126 };
00127 
00129 const DataType DATA_ALL(UINT_MAX);
00130 
00132 const DataType DATA_UNKNOWN(0);
00133 
00135 const DataType DATA_GROUP(1);
00136 
00137 std::ostream &operator<<(std::ostream &stream, DataType type);
00138 
00139 
00140 //== TYPEDEFS =================================================================
00141 
00143 typedef ACG::Vec3d Vector;
00145 typedef std::vector< int > IdList;
00147 typedef ACG::Matrix4x4d Matrix4x4;
00148 
00149 Q_DECLARE_METATYPE(IdList);
00150 Q_DECLARE_METATYPE(DataType);
00151 Q_DECLARE_METATYPE(QVector< int >);
00152 Q_DECLARE_METATYPE(Vector);
00153 Q_DECLARE_METATYPE(Matrix4x4);
00154 
00155 //================================================================================================
00158 //================================================================================================
00159 
00165 DLLEXPORT
00166 DataType addDataType(QString _name, QString _readableName);
00167 
00169 DLLEXPORT
00170 DataType typeId(QString _name);
00171 
00177 DLLEXPORT
00178 QString typeName(DataType _id);
00179 
00187 DLLEXPORT 
00188 uint typeCount();
00189 
00192 //================================================================================================
00195 //================================================================================================
00196 
00198 DLLEXPORT
00199 QString dataTypeName( DataType _id );
00200 
00202 DLLEXPORT
00203 QString dataTypeName( QString _typeName);
00204 
00206 DLLEXPORT
00207 void setDataTypeName( DataType _id, QString _name );
00208 
00210 DLLEXPORT
00211 void setDataTypeName( QString _typeName, QString _name );
00212 
00213 
00216 //================================================================================================
00219 //================================================================================================
00220 
00222 DLLEXPORT
00223 QString typeIconName(QString  _name);
00224 
00226 DLLEXPORT
00227 QString typeIconName(DataType _id);
00228 
00234 DLLEXPORT
00235 QIcon& typeIcon(DataType _id);
00236 
00238 DLLEXPORT
00239 void setTypeIcon( DataType _id   , QString _icon);
00240 
00242 DLLEXPORT
00243 void setTypeIcon( QString  _name , QString _icon );
00244 
00251 //=============================================================================
00252 #endif // DATATYPES_HH defined
00253 //=============================================================================

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