// python wrapper for vtkLineWidget2 // #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 "vtkLineWidget2.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkLineWidget2(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkLineWidget2_ClassNew(); } #ifndef DECLARED_PyvtkAbstractWidget_ClassNew extern "C" { PyObject *PyvtkAbstractWidget_ClassNew(); } #define DECLARED_PyvtkAbstractWidget_ClassNew #endif static const char *PyvtkLineWidget2_Doc = "vtkLineWidget2 - 3D widget for manipulating a finite, straight line\n\n" "Superclass: vtkAbstractWidget\n\n" "This 3D widget defines a straight line that can be interactively\n" "placed in a scene. The widget is assumed to consist of two parts: 1)\n" "two end points and 2) a straight line connecting the two points. (The\n" "representation paired with this widget determines the actual geometry\n" "of the widget.) The positioning of the two end points is facilitated\n" "by using vtkHandleWidgets to position the points.\n\n" "To use this widget, you generally pair it with a\n" "vtkLineRepresentation (or a subclass). Various options are available\n" "in the representation for controlling how the widget appears, and how\n" "the widget functions.\n\n" "@par Event Bindings: By default, the widget responds to the following\n" "VTK events (i.e., it watches the vtkRenderWindowInteractor for these\n" "events):\n\n" "If one of the two end points are selected:\n" " LeftButtonPressEvent - activate the associated handle widget\n" " LeftButtonReleaseEvent - release the handle widget associated with\n" "the point\n" " MouseMoveEvent - move the point If the line is selected:\n" " LeftButtonPressEvent - activate a handle widget accociated with the\n" "line\n" " LeftButtonReleaseEvent - release the handle widget associated with\n" "the line\n" " MouseMoveEvent - translate the line In all the cases, independent\n" "of what is picked, the widget responds to the following VTK events:\n" " MiddleButtonPressEvent - translate the widget\n" " MiddleButtonReleaseEvent - release the widget\n" " RightButtonPressEvent - scale the widget's representation\n" " RightButtonReleaseEvent - stop scaling the widget\n" " MouseMoveEvent - scale (if right button) or move (if middle button)\n" "the widget \n\n" "@par Event Bindings: Note that the event bindings described above can\n" "be changed using this class's vtkWidgetEventTranslator. This class\n" "translates VTK events into the vtkLineWidget2's widget events:\n\n\n" " vtkWidgetEvent::Select -- some part of the widget has been selected\n" " vtkWidgetEvent::EndSelect -- the selection process has completed\n" " vtkWidgetEvent::Move -- a request for slider motion has been\n" "invoked \n\n" "@par Event Bindings: In turn, when these widget events are processed,\n" "the vtkLineWidget2 invokes the following VTK events on itself (which\n" "observers can listen for):\n\n\n" " vtkCommand::StartInteractionEvent (on vtkWidgetEvent::Select)\n" " vtkCommand::EndInteractionEvent (on vtkWidgetEvent::EndSelect)\n" " vtkCommand::InteractionEvent (on vtkWidgetEvent::Move) \n\n" "@par Event Bindings: This class, and vtkLineRepresentation, are next\n" "generation VTK widgets. An earlier version of this functionality was\n" "defined in the class vtkLineWidget.\n\n" "@sa\n" "vtkLineRepresentation vtkLineWidget vtk3DWidget\n" "vtkImplicitPlaneWidget vtkImplicitPlaneWidget2\n\n"; static PyObject * PyvtkLineWidget2_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkLineWidget2::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkLineWidget2_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *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->vtkLineWidget2::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkLineWidget2_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkLineWidget2 *tempr = vtkLineWidget2::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkLineWidget2_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkLineWidget2 *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkLineWidget2::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 * PyvtkLineWidget2_SetEnabled(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetEnabled"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetEnabled(temp0); } else { op->vtkLineWidget2::SetEnabled(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkLineWidget2_SetRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); vtkLineRepresentation *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkLineRepresentation")) { if (ap.IsBound()) { op->SetRepresentation(temp0); } else { op->vtkLineWidget2::SetRepresentation(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkLineWidget2_GetLineRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLineRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkLineRepresentation *tempr = (ap.IsBound() ? op->GetLineRepresentation() : op->vtkLineWidget2::GetLineRepresentation()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkLineWidget2_CreateDefaultRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CreateDefaultRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CreateDefaultRepresentation(); } else { op->vtkLineWidget2::CreateDefaultRepresentation(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkLineWidget2_SetProcessEvents(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetProcessEvents"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLineWidget2 *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetProcessEvents(temp0); } else { op->vtkLineWidget2::SetProcessEvents(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkLineWidget2_Methods[] = { {"IsTypeOf", PyvtkLineWidget2_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nStandard vtkObject methods\n"}, {"IsA", PyvtkLineWidget2_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nStandard vtkObject methods\n"}, {"SafeDownCast", PyvtkLineWidget2_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkLineWidget2\nC++: static vtkLineWidget2 *SafeDownCast(vtkObjectBase *o)\n\nStandard vtkObject methods\n"}, {"NewInstance", PyvtkLineWidget2_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkLineWidget2\nC++: vtkLineWidget2 *NewInstance()\n\nStandard vtkObject methods\n"}, {"SetEnabled", PyvtkLineWidget2_SetEnabled, METH_VARARGS, "V.SetEnabled(int)\nC++: void SetEnabled(int enabling) override;\n\nOverride superclasses' SetEnabled() method because the line\nwidget must enable its internal handle widgets.\n"}, {"SetRepresentation", PyvtkLineWidget2_SetRepresentation, METH_VARARGS, "V.SetRepresentation(vtkLineRepresentation)\nC++: void SetRepresentation(vtkLineRepresentation *r)\n\nSpecify an instance of vtkWidgetRepresentation used to represent\nthis widget in the scene. Note that the representation is a\nsubclass of vtkProp so it can be added to the renderer\nindependent of the widget.\n"}, {"GetLineRepresentation", PyvtkLineWidget2_GetLineRepresentation, METH_VARARGS, "V.GetLineRepresentation() -> vtkLineRepresentation\nC++: vtkLineRepresentation *GetLineRepresentation()\n\nReturn the representation as a vtkLineRepresentation.\n"}, {"CreateDefaultRepresentation", PyvtkLineWidget2_CreateDefaultRepresentation, METH_VARARGS, "V.CreateDefaultRepresentation()\nC++: void CreateDefaultRepresentation() override;\n\nCreate the default widget representation if one is not set.\n"}, {"SetProcessEvents", PyvtkLineWidget2_SetProcessEvents, METH_VARARGS, "V.SetProcessEvents(int)\nC++: void SetProcessEvents(int) override;\n\nMethods to change the whether the widget responds to interaction.\nOverridden to pass the state to component widgets.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkLineWidget2_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkInteractionWidgetsPython.vtkLineWidget2", // 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 PyvtkLineWidget2_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 *PyvtkLineWidget2_StaticNew() { return vtkLineWidget2::New(); } PyObject *PyvtkLineWidget2_ClassNew() { PyVTKClass_Add( &PyvtkLineWidget2_Type, PyvtkLineWidget2_Methods, "vtkLineWidget2", &PyvtkLineWidget2_StaticNew); PyTypeObject *pytype = &PyvtkLineWidget2_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 *)PyvtkAbstractWidget_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkLineWidget2( PyObject *dict) { PyObject *o; o = PyvtkLineWidget2_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkLineWidget2", o) != 0) { Py_DECREF(o); } }