25#ifndef _SOURCE_LANGS_PY_TF_PY_H_
26#define _SOURCE_LANGS_PY_TF_PY_H_
29#if defined(_MSC_VER) || defined(_WIN32)
31# pragma warning(disable: 4510 4610 4512 4005)
34# define TF_DEBUG_MARKER
41#if defined(_MSC_VER) || defined(_WIN32)
42# if defined(TF_DEBUG_MARKER)
44# undef TF_DEBUG_MARKER
51#include <types/tf_cast.h>
53#include <Magnum/Magnum.h>
54#include <Magnum/Math/Vector3.h>
55#include <Magnum/Math/Vector4.h>
56#include <Magnum/Math/Matrix3.h>
65 Magnum::Vector2 cast(PyObject *obj);
68 Magnum::Vector3 cast(PyObject *obj);
71 Magnum::Vector4 cast(PyObject *obj);
74 Magnum::Vector2i cast(PyObject *obj);
77 Magnum::Vector3i cast(PyObject *obj);
80 fVector2 cast(PyObject *obj);
83 fVector3 cast(PyObject *obj);
86 fVector4 cast(PyObject *obj);
89 dVector2 cast(PyObject *obj);
92 dVector3 cast(PyObject *obj);
95 dVector4 cast(PyObject *obj);
98 iVector2 cast(PyObject *obj);
101 iVector3 cast(PyObject *obj);
104 PyObject* cast<int16_t, PyObject*>(
const int16_t &i);
107 PyObject* cast<uint16_t, PyObject*>(
const uint16_t &i);
110 PyObject* cast<uint32_t, PyObject*>(
const uint32_t &i);
113 PyObject* cast<uint64_t, PyObject*>(
const uint64_t &i);
116 PyObject* cast<float, PyObject*>(
const float &f);
119 PyObject* cast<double, PyObject*>(
const double &f);
122 float cast(PyObject *obj);
125 double cast(PyObject *obj);
128 PyObject* cast<bool, PyObject*>(
const bool &f);
131 bool cast(PyObject *obj);
134 PyObject* cast<int, PyObject*>(
const int &i);
137 int cast(PyObject *obj);
140 PyObject* cast<std::string, PyObject*>(
const std::string &s);
143 std::string cast(PyObject *o);
146 int16_t cast(PyObject *o);
149 uint16_t cast(PyObject *o);
152 uint32_t cast(PyObject *o);
155 uint64_t cast(PyObject *o);
161 CAPI_FUNC(PyObject*) Import_ImportString(
const std::string &name);
162 CAPI_FUNC(PyObject*) iPython_Get();
163 CAPI_FUNC(
bool) terminalInteractiveShell();
164 CAPI_FUNC(
bool) ZMQInteractiveShell();
169 template <
typename T>
177 PyObject *
py_arg(
const char* name,
int index, PyObject *_args, PyObject *_kwargs);
183 std::string str(PyObject *o);
191 T arg(
const char* name,
int index, PyObject *args, PyObject *kwargs) {
192 PyObject *value =
py_arg(name, index, args, kwargs);
194 return cast<PyObject, T>(value);
196 throw std::runtime_error(std::string(
"missing argument ") + name);
200 T arg(
const char* name,
int index, PyObject *args, PyObject *kwargs, T deflt) {
202 PyObject *value =
py_arg(name, index, args, kwargs);
204 return cast<PyObject, T>(value);
PyObject * py_arg(const char *name, int index, PyObject *_args, PyObject *_kwargs)
std::string pyerror_str()
std::string repr(PyObject *o)
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26