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"
33 #include "patchlevel.h"
35 #include "../global.h"
36 #include "../../common/itomPlotHandle.h"
37 #include "../../common/shape.h"
39 #include "opencv2/opencv.hpp"
41 #include <qmetaobject.h>
43 #include <qbytearray.h>
46 #include "../helper/qpropertyHelper.h"
56 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 };
59 static PyObject* QStringToPyObject(
const QString& str);
62 static PyObject* QStringListToPyObject(
const QStringList& list);
65 static PyObject* QStringListToPyList(
const QStringList& list);
68 static PyObject* QDateToPyDate(
const QDate& date);
71 static PyObject* QDateTimeToPyDateTime(
const QDateTime& datetime);
74 static PyObject* QTimeToPyTime(
const QTime& time);
77 static QString PyObjGetRepresentation(PyObject* val);
82 static QString PyObjGetString(PyObject* val,
bool strict,
bool &ok);
84 static std::string PyObjGetStdStringAsLatin1(PyObject* val,
bool strict,
bool &ok);
86 static QByteArray PyObjGetBytes(PyObject* val,
bool strict,
bool &ok);
88 static QSharedPointer<char> PyObjGetBytesShared(PyObject* val,
bool strict,
bool &ok);
90 static int PyObjGetInt(PyObject* val,
bool strict,
bool &ok);
92 static qint64 PyObjGetLongLong(PyObject* val,
bool strict,
bool &ok);
94 static quint64 PyObjGetULongLong(PyObject* val,
bool strict,
bool &ok);
96 static double PyObjGetDouble(PyObject* val,
bool strict,
bool &ok);
98 static QVector<double> PyObjGetDoubleArray(PyObject* val,
bool strict,
bool &ok);
100 static complex128 PyObjGetComplex(PyObject* val,
bool strict,
bool &ok);
102 static QVector<complex128> PyObjGetComplexArray(PyObject* val,
bool strict,
bool &ok);
104 static QVector<int> PyObjGetIntArray(PyObject* val,
bool strict,
bool &ok);
106 static bool PyObjGetBool(PyObject* val,
bool strict,
bool &ok);
108 static QVector<ito::Shape> PyObjGetShapeVector(PyObject* val,
bool &ok);
110 #if ITOM_POINTCLOUDLIBRARY > 0
112 static ito::PCLPoint PyObjGetPoint(PyObject *val,
bool strict,
bool &ok);
116 static ito::PCLPointCloud* PyObjGetPointCloudNewPtr(PyObject *val,
bool strict,
bool &ok);
117 static ito::PCLPolygonMesh* PyObjGetPolygonMeshNewPtr(PyObject *val,
bool strict,
bool &ok);
122 static QSharedPointer<ito::DataObject> PyObjGetSharedDataObject(PyObject *val,
bool &ok);
125 static QStringList PyObjToStringList(PyObject* val,
bool strict,
bool& ok);
130 static QVariant PyObjToQVariant(PyObject* val,
int type = -1);
134 static bool PyObjToVoidPtr(PyObject* val,
void **retPtr,
int *retType,
int type = -1,
bool strict =
false);
137 static PyObject* GetPyBool(
bool val);
138 static PyObject* QVariantToPyObject(
const QVariant& v);
140 static PyObject* QVariantMapToPyObject(
const QVariantMap& m);
141 static PyObject* QVariantListToPyObject(
const QVariantList& l);
143 #if ITOM_POINTCLOUDLIBRARY > 0
152 static PyObject* ConvertQtValueToPythonInternal(
int type,
const void* data);
154 static PyObject* QByteArrayToPyUnicode(
const QByteArray &ba,
const char *errors =
"replace");
155 static PyObject* QByteArrayToPyUnicodeSecure(
const QByteArray &ba,
const char *errors =
"replace");
156 static PyObject* ByteArrayToPyUnicode(
const char* byteArray, Py_ssize_t len = 0,
const char *errors =
"replace");
158 static PyObject* PyUnicodeToPyByteObject(PyObject *unicode,
const char *errors =
"replace");
163 static unicodeEncodings textEncoding;
164 static QByteArray textEncodingName;
175 static void baseObjectDeleterDataObject(
ito::DataObject *sharedObject);
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:511
Definition: pythonEngine.h:114
static QString PyObjGetString(PyObject *val)
get string value from py object
Definition: pythonQtConversion.h:80
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Base class for all plugins.
Definition: addInInterface.h:385
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:174
Definition: apiFunctionsGraph.cpp:39
empty class that is the QVariant registered type for None in Python. Nothing more than this...
Definition: pythonNone.h:33
Conversion class with mainly static methods, which convert values between Qt and standard C++ data ty...
Definition: pythonQtConversion.h:53