// python wrapper for vtkImageStencil // #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 "vtkImageStencil.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkImageStencil(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkImageStencil_ClassNew(); } #ifndef DECLARED_PyvtkThreadedImageAlgorithm_ClassNew extern "C" { PyObject *PyvtkThreadedImageAlgorithm_ClassNew(); } #define DECLARED_PyvtkThreadedImageAlgorithm_ClassNew #endif static const char *PyvtkImageStencil_Doc = "vtkImageStencil - combine images via a cookie-cutter operation\n\n" "Superclass: vtkThreadedImageAlgorithm\n\n" "vtkImageStencil will combine two images together using a stencil. The\n" "stencil should be provided in the form of a vtkImageStencilData,\n\n"; static PyObject * PyvtkImageStencil_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkImageStencil::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageStencil_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *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->vtkImageStencil::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageStencil_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkImageStencil *tempr = vtkImageStencil::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImageStencil_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImageStencil *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkImageStencil::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 * PyvtkImageStencil_SetStencilData(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetStencilData"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); vtkImageStencilData *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkImageStencilData")) { if (ap.IsBound()) { op->SetStencilData(temp0); } else { op->vtkImageStencil::SetStencilData(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_GetStencil(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetStencil"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImageStencilData *tempr = (ap.IsBound() ? op->GetStencil() : op->vtkImageStencil::GetStencil()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImageStencil_SetStencilConnection(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetStencilConnection"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); vtkAlgorithmOutput *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkAlgorithmOutput")) { if (ap.IsBound()) { op->SetStencilConnection(temp0); } else { op->vtkImageStencil::SetStencilConnection(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_SetReverseStencil(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetReverseStencil"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetReverseStencil(temp0); } else { op->vtkImageStencil::SetReverseStencil(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_ReverseStencilOn(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ReverseStencilOn"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->ReverseStencilOn(); } else { op->vtkImageStencil::ReverseStencilOn(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_ReverseStencilOff(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ReverseStencilOff"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->ReverseStencilOff(); } else { op->vtkImageStencil::ReverseStencilOff(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_GetReverseStencil(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetReverseStencil"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetReverseStencil() : op->vtkImageStencil::GetReverseStencil()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageStencil_SetBackgroundInputData(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundInputData"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); vtkImageData *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkImageData")) { if (ap.IsBound()) { op->SetBackgroundInputData(temp0); } else { op->vtkImageStencil::SetBackgroundInputData(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_GetBackgroundInput(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBackgroundInput"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImageData *tempr = (ap.IsBound() ? op->GetBackgroundInput() : op->vtkImageStencil::GetBackgroundInput()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImageStencil_SetBackgroundValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); double temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetBackgroundValue(temp0); } else { op->vtkImageStencil::SetBackgroundValue(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_GetBackgroundValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBackgroundValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetBackgroundValue() : op->vtkImageStencil::GetBackgroundValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageStencil_SetBackgroundColor_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); double temp0; double temp1; double temp2; double 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->SetBackgroundColor(temp0, temp1, temp2, temp3); } else { op->vtkImageStencil::SetBackgroundColor(temp0, temp1, temp2, temp3); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_SetBackgroundColor_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); const int size0 = 4; double temp0[4]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetBackgroundColor(temp0); } else { op->vtkImageStencil::SetBackgroundColor(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageStencil_SetBackgroundColor(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 4: return PyvtkImageStencil_SetBackgroundColor_s1(self, args); case 1: return PyvtkImageStencil_SetBackgroundColor_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetBackgroundColor"); return nullptr; } static PyObject * PyvtkImageStencil_GetBackgroundColor(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageStencil *op = static_cast(vp); int sizer = 4; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetBackgroundColor() : op->vtkImageStencil::GetBackgroundColor()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyMethodDef PyvtkImageStencil_Methods[] = { {"IsTypeOf", PyvtkImageStencil_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", PyvtkImageStencil_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", PyvtkImageStencil_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkImageStencil\nC++: static vtkImageStencil *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkImageStencil_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkImageStencil\nC++: vtkImageStencil *NewInstance()\n\n"}, {"SetStencilData", PyvtkImageStencil_SetStencilData, METH_VARARGS, "V.SetStencilData(vtkImageStencilData)\nC++: virtual void SetStencilData(vtkImageStencilData *stencil)\n\nSpecify the stencil to use. The stencil can be created from a\nvtkImplicitFunction or a vtkPolyData. This function does not\nsetup a pipeline connection.\n"}, {"GetStencil", PyvtkImageStencil_GetStencil, METH_VARARGS, "V.GetStencil() -> vtkImageStencilData\nC++: vtkImageStencilData *GetStencil()\n\nSpecify the stencil to use. The stencil can be created from a\nvtkImplicitFunction or a vtkPolyData. This function does not\nsetup a pipeline connection.\n"}, {"SetStencilConnection", PyvtkImageStencil_SetStencilConnection, METH_VARARGS, "V.SetStencilConnection(vtkAlgorithmOutput)\nC++: void SetStencilConnection(vtkAlgorithmOutput *outputPort)\n\nSpecify the stencil to use. This sets up a pipeline connection.\n"}, {"SetReverseStencil", PyvtkImageStencil_SetReverseStencil, METH_VARARGS, "V.SetReverseStencil(int)\nC++: virtual void SetReverseStencil(int _arg)\n\nReverse the stencil.\n"}, {"ReverseStencilOn", PyvtkImageStencil_ReverseStencilOn, METH_VARARGS, "V.ReverseStencilOn()\nC++: virtual void ReverseStencilOn()\n\nReverse the stencil.\n"}, {"ReverseStencilOff", PyvtkImageStencil_ReverseStencilOff, METH_VARARGS, "V.ReverseStencilOff()\nC++: virtual void ReverseStencilOff()\n\nReverse the stencil.\n"}, {"GetReverseStencil", PyvtkImageStencil_GetReverseStencil, METH_VARARGS, "V.GetReverseStencil() -> int\nC++: virtual int GetReverseStencil()\n\nReverse the stencil.\n"}, {"SetBackgroundInputData", PyvtkImageStencil_SetBackgroundInputData, METH_VARARGS, "V.SetBackgroundInputData(vtkImageData)\nC++: virtual void SetBackgroundInputData(vtkImageData *input)\n\nSet the second input. This image will be used for the 'outside'\nof the stencil. If not set, the output voxels will be filled\nwith BackgroundValue instead.\n"}, {"GetBackgroundInput", PyvtkImageStencil_GetBackgroundInput, METH_VARARGS, "V.GetBackgroundInput() -> vtkImageData\nC++: vtkImageData *GetBackgroundInput()\n\nSet the second input. This image will be used for the 'outside'\nof the stencil. If not set, the output voxels will be filled\nwith BackgroundValue instead.\n"}, {"SetBackgroundValue", PyvtkImageStencil_SetBackgroundValue, METH_VARARGS, "V.SetBackgroundValue(float)\nC++: void SetBackgroundValue(double val)\n\nSet the default output value to use when the second input is not\nset.\n"}, {"GetBackgroundValue", PyvtkImageStencil_GetBackgroundValue, METH_VARARGS, "V.GetBackgroundValue() -> float\nC++: double GetBackgroundValue()\n\nSet the default output value to use when the second input is not\nset.\n"}, {"SetBackgroundColor", PyvtkImageStencil_SetBackgroundColor, METH_VARARGS, "V.SetBackgroundColor(float, float, float, float)\nC++: void SetBackgroundColor(double, double, double, double)\nV.SetBackgroundColor((float, float, float, float))\nC++: void SetBackgroundColor(double a[4])\n\n"}, {"GetBackgroundColor", PyvtkImageStencil_GetBackgroundColor, METH_VARARGS, "V.GetBackgroundColor() -> (float, float, float, float)\nC++: double *GetBackgroundColor()\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkImageStencil_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkImagingStencilPython.vtkImageStencil", // 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 PyvtkImageStencil_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 *PyvtkImageStencil_StaticNew() { return vtkImageStencil::New(); } PyObject *PyvtkImageStencil_ClassNew() { PyVTKClass_Add( &PyvtkImageStencil_Type, PyvtkImageStencil_Methods, "vtkImageStencil", &PyvtkImageStencil_StaticNew); PyTypeObject *pytype = &PyvtkImageStencil_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 *)PyvtkThreadedImageAlgorithm_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkImageStencil( PyObject *dict) { PyObject *o; o = PyvtkImageStencil_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkImageStencil", o) != 0) { Py_DECREF(o); } }