// python wrapper for vtkBlockItem // #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include "vtkPythonArgs.h" #include "vtkPythonOverload.h" #include "vtkConfigure.h" #include #include #include "vtkVariant.h" #include "vtkIndent.h" #include "vtkContextMouseEvent.h" #include "vtkStdString.h" #include "vtkBlockItem.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkBlockItem(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkBlockItem_ClassNew(); } #ifndef DECLARED_PyvtkContextItem_ClassNew extern "C" { PyObject *PyvtkContextItem_ClassNew(); } #define DECLARED_PyvtkContextItem_ClassNew #endif static const char *PyvtkBlockItem_Doc = "vtkBlockItem - a vtkContextItem that draws a block (optional label).\n\n" "Superclass: vtkContextItem\n\n" "This is a vtkContextItem that can be placed into a vtkContextScene.\n" "It draws a block of the given dimensions, and reacts to mouse events.\n\n"; static PyObject * PyvtkBlockItem_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkBlockItem::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkBlockItem_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = (ap.IsBound() ? op->IsA(temp0) : op->vtkBlockItem::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkBlockItem_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkBlockItem *tempr = vtkBlockItem::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkBlockItem_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkBlockItem *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkBlockItem::NewInstance()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); if (result && PyVTKObject_Check(result)) { PyVTKObject_GetObject(result)->UnRegister(0); PyVTKObject_SetFlag(result, VTK_PYTHON_IGNORE_UNREGISTER, 1); } } } return result; } static PyObject * PyvtkBlockItem_Paint(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Paint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContext2D *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkContext2D")) { bool tempr = (ap.IsBound() ? op->Paint(temp0) : op->vtkBlockItem::Paint(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkBlockItem_Hit(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Hit"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->Hit(*temp0) : op->vtkBlockItem::Hit(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_MouseEnterEvent(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MouseEnterEvent"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->MouseEnterEvent(*temp0) : op->vtkBlockItem::MouseEnterEvent(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_MouseMoveEvent(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MouseMoveEvent"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->MouseMoveEvent(*temp0) : op->vtkBlockItem::MouseMoveEvent(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_MouseLeaveEvent(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MouseLeaveEvent"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->MouseLeaveEvent(*temp0) : op->vtkBlockItem::MouseLeaveEvent(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_MouseButtonPressEvent(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MouseButtonPressEvent"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->MouseButtonPressEvent(*temp0) : op->vtkBlockItem::MouseButtonPressEvent(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_MouseButtonReleaseEvent(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MouseButtonReleaseEvent"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkContextMouseEvent *temp0 = nullptr; PyObject *pobj0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetSpecialObject(temp0, pobj0, "vtkContextMouseEvent")) { bool tempr = (ap.IsBound() ? op->MouseButtonReleaseEvent(*temp0) : op->vtkBlockItem::MouseButtonReleaseEvent(*temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj0); return result; } static PyObject * PyvtkBlockItem_SetLabel(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetLabel"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); vtkStdString temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetLabel(temp0); } else { op->vtkBlockItem::SetLabel(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkBlockItem_GetLabel(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLabel"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkStdString tempr = (ap.IsBound() ? op->GetLabel() : op->vtkBlockItem::GetLabel()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkBlockItem_SetDimensions_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); float temp0; float temp1; float temp2; float temp3; PyObject *result = nullptr; if (op && ap.CheckArgCount(4) && ap.GetValue(temp0) && ap.GetValue(temp1) && ap.GetValue(temp2) && ap.GetValue(temp3)) { if (ap.IsBound()) { op->SetDimensions(temp0, temp1, temp2, temp3); } else { op->vtkBlockItem::SetDimensions(temp0, temp1, temp2, temp3); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkBlockItem_SetDimensions_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); const int size0 = 4; float temp0[4]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetDimensions(temp0); } else { op->vtkBlockItem::SetDimensions(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkBlockItem_SetDimensions(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 4: return PyvtkBlockItem_SetDimensions_s1(self, args); case 1: return PyvtkBlockItem_SetDimensions_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetDimensions"); return nullptr; } static PyObject * PyvtkBlockItem_GetDimensions(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkBlockItem *op = static_cast(vp); int sizer = 4; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { float *tempr = (ap.IsBound() ? op->GetDimensions() : op->vtkBlockItem::GetDimensions()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyMethodDef PyvtkBlockItem_Methods[] = { {"IsTypeOf", PyvtkBlockItem_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nReturn 1 if this class type is the same type of (or a subclass\nof) the named class. Returns 0 otherwise. This method works in\ncombination with vtkTypeMacro found in vtkSetGet.h.\n"}, {"IsA", PyvtkBlockItem_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nReturn 1 if this class is the same type of (or a subclass of) the\nnamed class. Returns 0 otherwise. This method works in\ncombination with vtkTypeMacro found in vtkSetGet.h.\n"}, {"SafeDownCast", PyvtkBlockItem_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkBlockItem\nC++: static vtkBlockItem *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkBlockItem_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkBlockItem\nC++: vtkBlockItem *NewInstance()\n\n"}, {"Paint", PyvtkBlockItem_Paint, METH_VARARGS, "V.Paint(vtkContext2D) -> bool\nC++: bool Paint(vtkContext2D *painter) override;\n\nPaint event for the item.\n"}, {"Hit", PyvtkBlockItem_Hit, METH_VARARGS, "V.Hit(vtkContextMouseEvent) -> bool\nC++: bool Hit(const vtkContextMouseEvent &mouse) override;\n\nReturns true if the supplied x, y coordinate is inside the item.\n"}, {"MouseEnterEvent", PyvtkBlockItem_MouseEnterEvent, METH_VARARGS, "V.MouseEnterEvent(vtkContextMouseEvent) -> bool\nC++: bool MouseEnterEvent(const vtkContextMouseEvent &mouse)\n override;\n\nMouse enter event.\n"}, {"MouseMoveEvent", PyvtkBlockItem_MouseMoveEvent, METH_VARARGS, "V.MouseMoveEvent(vtkContextMouseEvent) -> bool\nC++: bool MouseMoveEvent(const vtkContextMouseEvent &mouse)\n override;\n\nMouse move event.\n"}, {"MouseLeaveEvent", PyvtkBlockItem_MouseLeaveEvent, METH_VARARGS, "V.MouseLeaveEvent(vtkContextMouseEvent) -> bool\nC++: bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)\n override;\n\nMouse leave event.\n"}, {"MouseButtonPressEvent", PyvtkBlockItem_MouseButtonPressEvent, METH_VARARGS, "V.MouseButtonPressEvent(vtkContextMouseEvent) -> bool\nC++: bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)\n override;\n\nMouse button down event.\n"}, {"MouseButtonReleaseEvent", PyvtkBlockItem_MouseButtonReleaseEvent, METH_VARARGS, "V.MouseButtonReleaseEvent(vtkContextMouseEvent) -> bool\nC++: bool MouseButtonReleaseEvent(\n const vtkContextMouseEvent &mouse) override;\n\nMouse button release event.\n"}, {"SetLabel", PyvtkBlockItem_SetLabel, METH_VARARGS, "V.SetLabel(string)\nC++: virtual void SetLabel(const vtkStdString &label)\n\nSet the block label.\n"}, {"GetLabel", PyvtkBlockItem_GetLabel, METH_VARARGS, "V.GetLabel() -> string\nC++: virtual vtkStdString GetLabel()\n\nGet the block label.\n"}, {"SetDimensions", PyvtkBlockItem_SetDimensions, METH_VARARGS, "V.SetDimensions(float, float, float, float)\nC++: void SetDimensions(float, float, float, float)\nV.SetDimensions((float, float, float, float))\nC++: void SetDimensions(float a[4])\n\n"}, {"GetDimensions", PyvtkBlockItem_GetDimensions, METH_VARARGS, "V.GetDimensions() -> (float, float, float, float)\nC++: float *GetDimensions()\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkBlockItem_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkRenderingContext2DPython.vtkBlockItem", // tp_name sizeof(PyVTKObject), // tp_basicsize 0, // tp_itemsize PyVTKObject_Delete, // tp_dealloc 0, // tp_print nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare PyVTKObject_Repr, // tp_repr nullptr, // tp_as_number nullptr, // tp_as_sequence nullptr, // tp_as_mapping nullptr, // tp_hash nullptr, // tp_call PyVTKObject_String, // tp_str PyObject_GenericGetAttr, // tp_getattro PyObject_GenericSetAttr, // tp_setattro &PyVTKObject_AsBuffer, // tp_as_buffer Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE, // tp_flags PyvtkBlockItem_Doc, // tp_doc PyVTKObject_Traverse, // tp_traverse nullptr, // tp_clear nullptr, // tp_richcompare offsetof(PyVTKObject, vtk_weakreflist), // tp_weaklistoffset nullptr, // tp_iter nullptr, // tp_iternext nullptr, // tp_methods nullptr, // tp_members PyVTKObject_GetSet, // tp_getset nullptr, // tp_base nullptr, // tp_dict nullptr, // tp_descr_get nullptr, // tp_descr_set offsetof(PyVTKObject, vtk_dict), // tp_dictoffset nullptr, // tp_init nullptr, // tp_alloc PyVTKObject_New, // tp_new PyObject_GC_Del, // tp_free nullptr, // tp_is_gc nullptr, // tp_bases nullptr, // tp_mro nullptr, // tp_cache nullptr, // tp_subclasses nullptr, // tp_weaklist VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED }; static vtkObjectBase *PyvtkBlockItem_StaticNew() { return vtkBlockItem::New(); } PyObject *PyvtkBlockItem_ClassNew() { PyVTKClass_Add( &PyvtkBlockItem_Type, PyvtkBlockItem_Methods, "vtkBlockItem", &PyvtkBlockItem_StaticNew); PyTypeObject *pytype = &PyvtkBlockItem_Type; if ((pytype->tp_flags & Py_TPFLAGS_READY) != 0) { return (PyObject *)pytype; } #if !defined(VTK_PY3K) && PY_VERSION_HEX >= 0x02060000 pytype->tp_flags |= Py_TPFLAGS_HAVE_NEWBUFFER; #endif pytype->tp_base = (PyTypeObject *)PyvtkContextItem_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkBlockItem( PyObject *dict) { PyObject *o; o = PyvtkBlockItem_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkBlockItem", o) != 0) { Py_DECREF(o); } }