23#ifndef PYTHONQTCONVERSION_H
24#define PYTHONQTCONVERSION_H
26#include "pythonDataObject.h"
27#include "pythonPlugins.h"
28#include "pythonRegion.h"
30#include "pythonAutoInterval.h"
31#include "pythonNone.h"
33#include "patchlevel.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 };
82 static QString
PyObjGetString(PyObject* val,
bool strict,
bool &ok);
86 static QByteArray
PyObjGetBytes(PyObject* val,
bool strict,
bool &ok);
90 static int PyObjGetInt(PyObject* val,
bool strict,
bool &ok);
92 static unsigned int PyObjGetUInt(PyObject* val,
bool strict,
bool &ok);
98 static double PyObjGetDouble(PyObject* val,
bool strict,
bool &ok);
102 static complex128
PyObjGetComplex(PyObject* val,
bool strict,
bool &ok);
108 static bool PyObjGetBool(PyObject* val,
bool strict,
bool &ok);
115#if ITOM_POINTCLOUDLIBRARY > 0
117 static ito::PCLPoint PyObjGetPoint(PyObject *val,
bool strict,
bool &ok);
121 static ito::PCLPointCloud* PyObjGetPointCloudNewPtr(PyObject *val,
bool strict,
bool &ok);
122 static ito::PCLPolygonMesh* PyObjGetPolygonMeshNewPtr(PyObject *val,
bool strict,
bool &ok);
125 static ito::DataObject* PyObjGetDataObjectNewPtr(PyObject *val,
bool strict,
bool &ok,
ito::RetVal *retVal =
nullptr,
bool addNumpyOrgTags =
false);
143 static bool PyObjToVoidPtr(PyObject* val,
void **retPtr,
int *retType,
int type = -1,
bool strict =
false);
152#if ITOM_POINTCLOUDLIBRARY > 0
163 static PyObject* QByteArrayToPyUnicode(
const QByteArray &ba,
const char *errors =
"replace");
164 static PyObject* QByteArrayToPyUnicodeSecure(
const QByteArray &ba,
const char *errors =
"replace");
165 static PyObject* QByteArrayUtf8ToPyUnicode(
const QByteArray &ba,
const char *errors =
"replace");
166 static PyObject* QByteArrayUtf8ToPyUnicodeSecure(
const QByteArray &ba,
const char *errors =
"replace");
167 static PyObject* ByteArrayToPyUnicode(
const char* byteArray, Py_ssize_t len = 0,
const char *errors =
"replace");
169 static PyObject* PyUnicodeToPyByteObject(PyObject *unicode,
const char *errors =
"replace");
174 static UnicodeEncodings textEncoding;
175 static QByteArray textEncodingName;
177 static int guessQMetaTypeFromPyObject(PyObject* val);
188 static void baseObjectDeleterDataObject(
ito::DataObject *sharedObject);
Base class for all plugins.
Definition addInInterface.h:386
dataObject contains a n-dimensional matrix
Definition dataobj.h:591
generic class that covers one single point cloud of different possible types provided by the Point Cl...
Definition pclStructures.h:293
generic class that covers one single point of different possible types provided by the Point Cloud Li...
Definition pclStructures.h:74
generic class that covers a shared pointer to pcl::PolygonMesh that is a class for a polygonal mesh p...
Definition pclStructures.h:668
Definition pythonEngine.h:118
empty class that is the QVariant registered type for None in Python. Nothing more than this.
Definition pythonNone.h:34
Conversion class with mainly static methods, which convert values between Qt and standard C++ data ty...
Definition pythonQtConversion.h:54
static QVariant PyObjToQVariant(PyObject *val, int type=-1)
conversion from PyObject* to QVariant
Definition pythonQtConversion.cpp:1838
static PyObject * ConvertQtValueToPythonInternal(int type, const void *data)
method internally used for conversion from given type-id (QMetaType) and corresponding char*-pointer ...
Definition pythonQtConversion.cpp:3216
static qint64 PyObjGetLongLong(PyObject *val, bool strict, bool &ok)
get int64 from py object
Definition pythonQtConversion.cpp:788
static double PyObjGetDouble(PyObject *val, bool strict, bool &ok)
get double from py object
Definition pythonQtConversion.cpp:1062
static complex128 PyObjGetComplex(PyObject *val, bool strict, bool &ok)
get complex from py object
Definition pythonQtConversion.cpp:1165
static int PyObjGetInt(PyObject *val, bool strict, bool &ok)
get int from py object
Definition pythonQtConversion.cpp:487
static QVector< ito::ByteArray > PyObjGetByteArrayList(PyObject *val, bool strict, bool &ok)
get ito::ByteArray list from py object
Definition pythonQtConversion.cpp:379
static PyObject * QDateTimeToPyDateTime(const QDateTime &datetime)
converts QDateTime to Python datetime.datetime object
Definition pythonQtConversion.cpp:3007
static bool PyObjGetBool(PyObject *val, bool strict, bool &ok)
get bool from py object
Definition pythonQtConversion.cpp:426
static QVector< double > PyObjGetDoubleArray(PyObject *val, bool strict, bool &ok)
get double-array from py object
Definition pythonQtConversion.cpp:1129
static QVector< int > PyObjGetIntArray(PyObject *val, bool strict, bool &ok)
get int-array from py object
Definition pythonQtConversion.cpp:1267
static PyObject * QStringToPyObject(const QString &str)
converts QString to Python string (unicode!)
Definition pythonQtConversion.cpp:2934
static unsigned int PyObjGetUInt(PyObject *val, bool strict, bool &ok)
get unsigned int from py object
Definition pythonQtConversion.cpp:645
static PyObject * QVariantMapToPyObject(const QVariantMap &m)
conversion from given QVariantMap to python-dictionary.
Definition pythonQtConversion.cpp:3052
static QStringList PyObjToStringList(PyObject *val, bool strict, bool &ok)
create a string list from python sequence
Definition pythonQtConversion.cpp:77
static PyObject * QDateToPyDate(const QDate &date)
converts QDate to Python datetime.date object
Definition pythonQtConversion.cpp:2997
static QString PyObjGetRepresentation(PyObject *val)
get string representation of py object
Definition pythonQtConversion.cpp:112
static QSharedPointer< char > PyObjGetBytesShared(PyObject *val, bool strict, bool &ok)
get bytes from py object
Definition pythonQtConversion.cpp:315
static PyObject * QTimeToPyTime(const QTime &time)
converts QTime to Python datetime.time object
Definition pythonQtConversion.cpp:3019
static quint64 PyObjGetULongLong(PyObject *val, bool strict, bool &ok)
get int64 from py object
Definition pythonQtConversion.cpp:931
static QByteArray PyObjGetBytes(PyObject *val, bool strict, bool &ok)
get bytes from py object
Definition pythonQtConversion.cpp:266
static bool PyObjToVoidPtr(PyObject *val, void **retPtr, int *retType, int type=-1, bool strict=false)
tries to convert PyObject* to known data type and returns deep-copy of the value, given as char*
Definition pythonQtConversion.cpp:2336
static QVector< complex128 > PyObjGetComplexArray(PyObject *val, bool strict, bool &ok)
get complex-array from py object
Definition pythonQtConversion.cpp:1231
static QVector< ito::Shape > PyObjGetShapeVector(PyObject *val, bool &ok)
get shape vector from py object
Definition pythonQtConversion.cpp:1303
static PyObject * QStringListToPyObject(const QStringList &list)
converts QStringList to Python tuple
Definition pythonQtConversion.cpp:2960
static PyObject * QVariantListToPyObject(const QVariantList &l)
conversion from given QVariantList to python-tuple.
Definition pythonQtConversion.cpp:3182
static std::string PyObjGetStdStringAsLatin1(PyObject *val, bool strict, bool &ok)
get std::string value from py object. std::string has latin1 encoding
Definition pythonQtConversion.cpp:215
static PyObject * GetPyBool(bool val)
convert QVariant from PyObject
Definition pythonQtConversion.cpp:2918
static QString PyObjGetString(PyObject *val)
get string value from py object
Definition pythonQtConversion.h:80
static PyObject * QStringListToPyList(const QStringList &list)
converts QStringList to Python list
Definition pythonQtConversion.cpp:2984
static QHash< char *, PyObject * > m_pyBaseObjectStorage
Definition pythonQtConversion.h:187
static PyObject * QVariantToPyObject(const QVariant &v)
conversion from given QVariant to appropriate PyObject*
Definition pythonQtConversion.cpp:3037
static QSharedPointer< ito::DataObject > PyObjGetSharedDataObject(PyObject *val, bool strict, bool &ok, ito::RetVal *retVal=nullptr)
Definition pythonQtConversion.cpp:1538
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40