23 #ifndef PYTHONQTCONVERSION_H 24 #define PYTHONQTCONVERSION_H 26 #include "pythonDataObject.h" 27 #include "pythonPlugins.h" 28 #include "pythonRegion.h" 29 #include "pythonPCL.h" 30 #include "pythonAutoInterval.h" 31 #include "pythonNone.h" 34 #include "../global.h" 35 #include "../../common/itomPlotHandle.h" 36 #include "../../common/shape.h" 38 #include "opencv/cv.h" 40 #include <qmetaobject.h> 42 #include <qbytearray.h> 45 #include "../helper/qpropertyHelper.h" 63 Q_DECLARE_METATYPE(
ito::PythonNone)
71 enum unicodeEncodings { utf_8, latin_1, iso_8859_1, mbcs, ascii, utf_16, utf_16_LE, utf_16_BE, utf_32, utf_32_BE, utf_32_LE, other };
74 static PyObject* QStringToPyObject(
const QString& str);
77 static PyObject* QStringListToPyObject(
const QStringList& list);
80 static PyObject* QStringListToPyList(
const QStringList& list);
83 static PyObject* QDateToPyDate(
const QDate& date);
86 static PyObject* QDateTimeToPyDateTime(
const QDateTime& datetime);
89 static PyObject* QTimeToPyTime(
const QTime& time);
92 static QString PyObjGetRepresentation(PyObject* val);
97 static QString PyObjGetString(PyObject* val,
bool strict,
bool &ok);
99 static std::string PyObjGetStdStringAsLatin1(PyObject* val,
bool strict,
bool &ok);
101 static QByteArray PyObjGetBytes(PyObject* val,
bool strict,
bool &ok);
103 static QSharedPointer<char> PyObjGetBytesShared(PyObject* val,
bool strict,
bool &ok);
105 static int PyObjGetInt(PyObject* val,
bool strict,
bool &ok);
107 static qint64 PyObjGetLongLong(PyObject* val,
bool strict,
bool &ok);
109 static quint64 PyObjGetULongLong(PyObject* val,
bool strict,
bool &ok);
111 static double PyObjGetDouble(PyObject* val,
bool strict,
bool &ok);
113 static QVector<double> PyObjGetDoubleArray(PyObject* val,
bool strict,
bool &ok);
115 static complex128 PyObjGetComplex(PyObject* val,
bool strict,
bool &ok);
117 static QVector<complex128> PyObjGetComplexArray(PyObject* val,
bool strict,
bool &ok);
119 static QVector<int> PyObjGetIntArray(PyObject* val,
bool strict,
bool &ok);
121 static bool PyObjGetBool(PyObject* val,
bool strict,
bool &ok);
123 static QVector<ito::Shape> PyObjGetShapeVector(PyObject* val,
bool &ok);
125 #if ITOM_POINTCLOUDLIBRARY > 0 127 static ito::PCLPoint PyObjGetPoint(PyObject *val,
bool strict,
bool &ok);
131 static ito::PCLPointCloud* PyObjGetPointCloudNewPtr(PyObject *val,
bool strict,
bool &ok);
132 static ito::PCLPolygonMesh* PyObjGetPolygonMeshNewPtr(PyObject *val,
bool strict,
bool &ok);
135 static ito::DataObject* PyObjGetDataObjectNewPtr(PyObject *val,
bool strict,
bool &ok);
137 static QSharedPointer<ito::DataObject> PyObjGetSharedDataObject(PyObject *val,
bool &ok);
140 static QStringList PyObjToStringList(PyObject* val,
bool strict,
bool& ok);
145 static QVariant PyObjToQVariant(PyObject* val,
int type = -1);
149 static bool PyObjToVoidPtr(PyObject* val,
void **retPtr,
int *retType,
int type = -1,
bool strict =
false);
152 static PyObject* GetPyBool(
bool val);
153 static PyObject* QVariantToPyObject(
const QVariant& v);
155 static PyObject* QVariantMapToPyObject(
const QVariantMap& m);
156 static PyObject* QVariantListToPyObject(
const QVariantList& l);
158 #if ITOM_POINTCLOUDLIBRARY > 0 167 static PyObject* ConvertQtValueToPythonInternal(
int type,
const void* data);
169 static PyObject* QByteArrayToPyUnicode(
const QByteArray &ba,
const char *errors =
"replace");
170 static PyObject* QByteArrayToPyUnicodeSecure(
const QByteArray &ba,
const char *errors =
"replace");
171 static PyObject* ByteArrayToPyUnicode(
const char* byteArray, Py_ssize_t len = 0,
const char *errors =
"replace");
173 static PyObject* PyUnicodeToPyByteObject(PyObject *unicode,
const char *errors =
"replace");
178 static unicodeEncodings textEncoding;
179 static QByteArray textEncodingName;
188 QHash<char*,PyObject*>::iterator i = m_pyBaseObjectStorage.find((
char*)sharedObject);
189 if(i != m_pyBaseObjectStorage.end())
191 Py_XDECREF(i.value());
192 m_pyBaseObjectStorage.erase(i);
generic class that covers one single point of different possible types provided by the Point Cloud Li...
Definition: pclStructures.h:73
generic class that covers one single point cloud of different possible types provided by the Point Cl...
Definition: pclStructures.h:292
dataObject contains a n-dimensional matrix
Definition: dataobj.h:496
Definition: pythonEngine.h:128
static QString PyObjGetString(PyObject *val)
get string value from py object
Definition: pythonQtConversion.h:95
Base class for all plugins.
Definition: addInInterface.h:356
generic class that covers a shared pointer to pcl::PolygonMesh that is a class for a polygonal mesh p...
Definition: pclStructures.h:667
static QHash< char *, PyObject * > m_pyBaseObjectStorage
Definition: pythonQtConversion.h:185
Definition: apiFunctionsGraph.cpp:39
Conversion class with mainly static methods, which convert values between Qt and standard C++ data ty...
Definition: pythonQtConversion.h:68
class for a interval type containing the plot handle / unique id and name.
Definition: itomPlotHandle.h:48