|
| 1 | +#include "UnrealEnginePythonPrivatePCH.h" |
| 2 | + |
| 3 | +#include "UEPyFGeometry.h" |
| 4 | + |
| 5 | +static PyMethodDef ue_PyFGeometry_methods[] = { |
| 6 | + { NULL } /* Sentinel */ |
| 7 | +}; |
| 8 | + |
| 9 | +static PyObject *ue_PyFGeometry_str(ue_PyFGeometry *self) |
| 10 | +{ |
| 11 | + return PyUnicode_FromFormat("<unreal_engine.FGeometry '%s'>", |
| 12 | + TCHAR_TO_UTF8(*self->geometry.ToString())); |
| 13 | +} |
| 14 | + |
| 15 | +static PyTypeObject ue_PyFGeometryType = { |
| 16 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 17 | + "unreal_engine.FGeometry", /* tp_name */ |
| 18 | + sizeof(ue_PyFGeometry), /* tp_basicsize */ |
| 19 | + 0, /* tp_itemsize */ |
| 20 | + 0, /* tp_dealloc */ |
| 21 | + 0, /* tp_print */ |
| 22 | + 0, /* tp_getattr */ |
| 23 | + 0, /* tp_setattr */ |
| 24 | + 0, /* tp_reserved */ |
| 25 | + 0, /* tp_repr */ |
| 26 | + 0, /* tp_as_number */ |
| 27 | + 0, /* tp_as_sequence */ |
| 28 | + 0, /* tp_as_mapping */ |
| 29 | + 0, /* tp_hash */ |
| 30 | + 0, /* tp_call */ |
| 31 | + (reprfunc)ue_PyFGeometry_str, /* tp_str */ |
| 32 | + 0, /* tp_getattro */ |
| 33 | + 0, /* tp_setattro */ |
| 34 | + 0, /* tp_as_buffer */ |
| 35 | + Py_TPFLAGS_DEFAULT, /* tp_flags */ |
| 36 | + "Unreal Engine FGeometry", /* tp_doc */ |
| 37 | + 0, /* tp_traverse */ |
| 38 | + 0, /* tp_clear */ |
| 39 | + 0, /* tp_richcompare */ |
| 40 | + 0, /* tp_weaklistoffset */ |
| 41 | + 0, /* tp_iter */ |
| 42 | + 0, /* tp_iternext */ |
| 43 | + ue_PyFGeometry_methods, /* tp_methods */ |
| 44 | +}; |
| 45 | + |
| 46 | +void ue_python_init_fgeometry(PyObject *ue_module) { |
| 47 | + ue_PyFGeometryType.tp_new = PyType_GenericNew; |
| 48 | + |
| 49 | + if (PyType_Ready(&ue_PyFGeometryType) < 0) |
| 50 | + return; |
| 51 | + |
| 52 | + Py_INCREF(&ue_PyFGeometryType); |
| 53 | + PyModule_AddObject(ue_module, "FGeometry", (PyObject *)&ue_PyFGeometryType); |
| 54 | +} |
| 55 | + |
| 56 | +ue_PyFGeometry *py_ue_is_fgeometry(PyObject *obj) { |
| 57 | + if (!PyObject_IsInstance(obj, (PyObject *)&ue_PyFGeometryType)) |
| 58 | + return nullptr; |
| 59 | + return (ue_PyFGeometry *)obj; |
| 60 | +} |
| 61 | + |
| 62 | +PyObject *py_ue_new_fgeometry(FGeometry geometry) { |
| 63 | + ue_PyFGeometry *ret = (ue_PyFGeometry *)PyObject_New(ue_PyFGeometry, &ue_PyFGeometryType); |
| 64 | + ret->geometry = geometry; |
| 65 | + return (PyObject *)ret; |
| 66 | +} |
0 commit comments