// python wrapper for vtkCocoaRenderWindowInteractor // #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 "vtkCocoaRenderWindowInteractor.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkCocoaRenderWindowInteractor(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkCocoaRenderWindowInteractor_ClassNew(); } #ifndef DECLARED_PyvtkRenderWindowInteractor_ClassNew extern "C" { PyObject *PyvtkRenderWindowInteractor_ClassNew(); } #define DECLARED_PyvtkRenderWindowInteractor_ClassNew #endif static const char *PyvtkCocoaRenderWindowInteractor_Doc = "vtkCocoaRenderWindowInteractor - implements Cocoa specific functions\nrequired by vtkRenderWindowInteractor.\n\n" "Superclass: vtkRenderWindowInteractor\n\n" "The interactor interfaces with vtkCocoaRenderWindow and\n" "vtkCocoaGLView to trap messages from the Cocoa window manager and\n" "send them to vtk. Since OS X applications typically use the Command\n" "key where UNIX and Windows applications would use the Ctrl key, this\n" "interactor maps the Command key to Ctrl. In versions of VTK prior to\n" "VTK 6.2, it was mapped to Alt. On OS X, the Option key can be used\n" "as Alt.\n\n" "IMPORTANT: This header must be in C++ only because it is included by\n" ".cxx files. That means no Objective C may be used. That's why some\n" "instance variables are void* instead of what they really should be.\n\n"; static PyObject * PyvtkCocoaRenderWindowInteractor_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkCocoaRenderWindowInteractor::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *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->vtkCocoaRenderWindowInteractor::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkCocoaRenderWindowInteractor *tempr = vtkCocoaRenderWindowInteractor::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkCocoaRenderWindowInteractor *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkCocoaRenderWindowInteractor::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 * PyvtkCocoaRenderWindowInteractor_Initialize(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Initialize"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Initialize(); } else { op->vtkCocoaRenderWindowInteractor::Initialize(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_Enable(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Enable"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Enable(); } else { op->vtkCocoaRenderWindowInteractor::Enable(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_Disable(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Disable"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Disable(); } else { op->vtkCocoaRenderWindowInteractor::Disable(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_TerminateApp(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "TerminateApp"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->TerminateApp(); } else { op->vtkCocoaRenderWindowInteractor::TerminateApp(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_SetClassExitMethod(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SetClassExitMethod"); PyObject *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetFunction(temp0)) { vtkCocoaRenderWindowInteractor::SetClassExitMethod( (temp0 == Py_None ? nullptr : vtkPythonVoidFunc), (temp0 == Py_None ? nullptr : temp0)); if (temp0 != Py_None) { Py_INCREF(temp0); } vtkCocoaRenderWindowInteractor::SetClassExitMethodArgDelete( (temp0 == Py_None ? nullptr : vtkPythonVoidFuncArgDelete)); if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCocoaRenderWindowInteractor_ExitCallback(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ExitCallback"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCocoaRenderWindowInteractor *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->ExitCallback(); } else { op->vtkCocoaRenderWindowInteractor::ExitCallback(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkCocoaRenderWindowInteractor_Methods[] = { {"IsTypeOf", PyvtkCocoaRenderWindowInteractor_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", PyvtkCocoaRenderWindowInteractor_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", PyvtkCocoaRenderWindowInteractor_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkCocoaRenderWindowInteractor\nC++: static vtkCocoaRenderWindowInteractor *SafeDownCast(\n vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkCocoaRenderWindowInteractor_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkCocoaRenderWindowInteractor\nC++: vtkCocoaRenderWindowInteractor *NewInstance()\n\n"}, {"Initialize", PyvtkCocoaRenderWindowInteractor_Initialize, METH_VARARGS, "V.Initialize()\nC++: void Initialize() override;\n\nInitialize the even handler\n"}, {"Enable", PyvtkCocoaRenderWindowInteractor_Enable, METH_VARARGS, "V.Enable()\nC++: void Enable() override;\n\nEnable/Disable interactions. By default interactors are enabled\nwhen initialized. Initialize() must be called prior to\nenabling/disabling interaction. These methods are used when a\nwindow/widget is being shared by multiple renderers and\ninteractors. This allows a \"modal\" display where one interactor\nis active when its data is to be displayed and all other\ninteractors associated with the widget are disabled when their\ndata is not displayed.\n"}, {"Disable", PyvtkCocoaRenderWindowInteractor_Disable, METH_VARARGS, "V.Disable()\nC++: void Disable() override;\n\nEnable/Disable interactions. By default interactors are enabled\nwhen initialized. Initialize() must be called prior to\nenabling/disabling interaction. These methods are used when a\nwindow/widget is being shared by multiple renderers and\ninteractors. This allows a \"modal\" display where one interactor\nis active when its data is to be displayed and all other\ninteractors associated with the widget are disabled when their\ndata is not displayed.\n"}, {"TerminateApp", PyvtkCocoaRenderWindowInteractor_TerminateApp, METH_VARARGS, "V.TerminateApp()\nC++: void TerminateApp() override;\n\nCocoa specific application terminate, calls ClassExitMethod then\ncalls PostQuitMessage(0) to terminate app. An application can\nSpecify ExitMethod for alternative behaviour (i.e. suppresion of\nkeyboard exit)\n"}, {"SetClassExitMethod", PyvtkCocoaRenderWindowInteractor_SetClassExitMethod, METH_VARARGS, "V.SetClassExitMethod(function)\nC++: static void SetClassExitMethod(void (*f)(void *), void *arg)\n\nMethods to set the default exit method for the class. This method\nis only used if no instance level ExitMethod has been defined. \nIt is provided as a means to control how an interactor is exited\ngiven the various language bindings (tcl, Cocoa, etc.).\n"}, {"ExitCallback", PyvtkCocoaRenderWindowInteractor_ExitCallback, METH_VARARGS, "V.ExitCallback()\nC++: void ExitCallback() override;\n\nThese methods correspond to the the Exit, User and Pick\ncallbacks. They allow for the Style to invoke them.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkCocoaRenderWindowInteractor_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkRenderingOpenGL2Python.vtkCocoaRenderWindowInteractor", // 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 PyvtkCocoaRenderWindowInteractor_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 *PyvtkCocoaRenderWindowInteractor_StaticNew() { return vtkCocoaRenderWindowInteractor::New(); } PyObject *PyvtkCocoaRenderWindowInteractor_ClassNew() { PyVTKClass_Add( &PyvtkCocoaRenderWindowInteractor_Type, PyvtkCocoaRenderWindowInteractor_Methods, "vtkCocoaRenderWindowInteractor", &PyvtkCocoaRenderWindowInteractor_StaticNew); PyTypeObject *pytype = &PyvtkCocoaRenderWindowInteractor_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 *)PyvtkRenderWindowInteractor_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkCocoaRenderWindowInteractor( PyObject *dict) { PyObject *o; o = PyvtkCocoaRenderWindowInteractor_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkCocoaRenderWindowInteractor", o) != 0) { Py_DECREF(o); } }