itom 2.2.1
K:/git-itom/sources/itom/Qitom/helper/qpropertyHelper.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef QPROPERTYHELPER
00024 #define QPROPERTYHELPER
00025 
00026 #include "../global.h"
00027 #include "../common/retVal.h"
00028 #include "../common/addInInterface.h"
00029 #include "../common/interval.h"
00030 #include "../common/shape.h"
00031 #include "../DataObject/dataobj.h"
00032 #include "../common/qtMetaTypeDeclarations.h"
00033 
00034 #if ITOM_POINTCLOUDLIBRARY > 0
00035 #include "PointCloud/pclStructures.h"
00036 #endif
00037 
00038 #include <qvariant.h>
00039 #include <qmetaobject.h>
00040 #include <qpointer.h>
00041 #include <qsharedpointer.h>
00042 
00043 #if ITOM_POINTCLOUDLIBRARY > 0
00044 Q_DECLARE_METATYPE(ito::PCLPointCloud)
00045 Q_DECLARE_METATYPE(QSharedPointer<ito::PCLPointCloud>)
00046 Q_DECLARE_METATYPE(QSharedPointer<ito::PCLPolygonMesh>)
00047 Q_DECLARE_METATYPE(ito::PCLPoint)
00048 Q_DECLARE_METATYPE(ito::PCLPolygonMesh)
00049 #endif
00050 
00051 Q_DECLARE_METATYPE(QSharedPointer<ito::DataObject>)
00052 Q_DECLARE_METATYPE(QPointer<ito::AddInDataIO>)
00053 Q_DECLARE_METATYPE(QPointer<ito::AddInActuator>)
00054 Q_DECLARE_METATYPE(ito::Shape)
00055 Q_DECLARE_METATYPE(QVector<ito::Shape>)
00056 
00057 namespace ito
00058 {
00059 
00060     class QPropertyHelper
00061     {
00062     public:
00063         
00064         static QVariant QVariantCast(const QVariant &item, int QVariantCast, ito::RetVal &retval);
00065         static QVariant QVariantToEnumCast(const QVariant &item, const QMetaEnum &enumerator, ito::RetVal &retval);
00066         static RetVal readProperty(const QObject *object, const char* propName, QVariant &value);
00067         static RetVal writeProperty(QObject *object, const char* propName, const QVariant &value);
00068     };
00069 
00070 } //end namespace ito
00071 
00072 #endif //QPROPERTYHELPER
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends