DataTypes.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00058 #ifndef DATATYPES_HH
00059 #define DATATYPES_HH
00060
00061
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
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
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