// python wrapper for vtkROIStencilSource // #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 "vtkROIStencilSource.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkROIStencilSource(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkROIStencilSource_ClassNew(); } #ifndef DECLARED_PyvtkImageStencilSource_ClassNew extern "C" { PyObject *PyvtkImageStencilSource_ClassNew(); } #define DECLARED_PyvtkImageStencilSource_ClassNew #endif static const char *PyvtkROIStencilSource_Doc = "vtkROIStencilSource - create simple mask shapes\n\n" "Superclass: vtkImageStencilSource\n\n" "vtkROIStencilSource will create an image stencil with a simple shape\n" "like a box, a sphere, or a cylinder. Its output can be used with\n" "vtkImageStecil or other vtk classes that apply a stencil to an image.\n" "@sa\n" "vtkImplicitFunctionToImageStencil vtkLassoStencilSource@par Thanks:\n" "Thanks to David Gobbi for contributing this class to VTK.\n\n"; static PyObject * PyvtkROIStencilSource_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkROIStencilSource::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *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->vtkROIStencilSource::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkROIStencilSource *tempr = vtkROIStencilSource::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkROIStencilSource *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkROIStencilSource::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 * PyvtkROIStencilSource_GetShape(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetShape"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetShape() : op->vtkROIStencilSource::GetShape()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_SetShape(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShape"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetShape(temp0); } else { op->vtkROIStencilSource::SetShape(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_GetShapeMinValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetShapeMinValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetShapeMinValue() : op->vtkROIStencilSource::GetShapeMinValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_GetShapeMaxValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetShapeMaxValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetShapeMaxValue() : op->vtkROIStencilSource::GetShapeMaxValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_SetShapeToBox(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShapeToBox"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetShapeToBox(); } else { op->vtkROIStencilSource::SetShapeToBox(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetShapeToEllipsoid(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShapeToEllipsoid"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetShapeToEllipsoid(); } else { op->vtkROIStencilSource::SetShapeToEllipsoid(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetShapeToCylinderX(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShapeToCylinderX"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetShapeToCylinderX(); } else { op->vtkROIStencilSource::SetShapeToCylinderX(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetShapeToCylinderY(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShapeToCylinderY"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetShapeToCylinderY(); } else { op->vtkROIStencilSource::SetShapeToCylinderY(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetShapeToCylinderZ(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetShapeToCylinderZ"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->SetShapeToCylinderZ(); } else { op->vtkROIStencilSource::SetShapeToCylinderZ(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_GetShapeAsString(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetShapeAsString"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { const char *tempr = (ap.IsBound() ? op->GetShapeAsString() : op->vtkROIStencilSource::GetShapeAsString()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkROIStencilSource_GetBounds(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBounds"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); int sizer = 6; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetBounds() : op->vtkROIStencilSource::GetBounds()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkROIStencilSource_SetBounds_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBounds"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); double temp0; double temp1; double temp2; double temp3; double temp4; double temp5; PyObject *result = nullptr; if (op && ap.CheckArgCount(6) && ap.GetValue(temp0) && ap.GetValue(temp1) && ap.GetValue(temp2) && ap.GetValue(temp3) && ap.GetValue(temp4) && ap.GetValue(temp5)) { if (ap.IsBound()) { op->SetBounds(temp0, temp1, temp2, temp3, temp4, temp5); } else { op->vtkROIStencilSource::SetBounds(temp0, temp1, temp2, temp3, temp4, temp5); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetBounds_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBounds"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkROIStencilSource *op = static_cast(vp); const int size0 = 6; double temp0[6]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetBounds(temp0); } else { op->vtkROIStencilSource::SetBounds(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkROIStencilSource_SetBounds(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 6: return PyvtkROIStencilSource_SetBounds_s1(self, args); case 1: return PyvtkROIStencilSource_SetBounds_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetBounds"); return nullptr; } static PyMethodDef PyvtkROIStencilSource_Methods[] = { {"IsTypeOf", PyvtkROIStencilSource_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", PyvtkROIStencilSource_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", PyvtkROIStencilSource_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkROIStencilSource\nC++: static vtkROIStencilSource *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkROIStencilSource_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkROIStencilSource\nC++: vtkROIStencilSource *NewInstance()\n\n"}, {"GetShape", PyvtkROIStencilSource_GetShape, METH_VARARGS, "V.GetShape() -> int\nC++: virtual int GetShape()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShape", PyvtkROIStencilSource_SetShape, METH_VARARGS, "V.SetShape(int)\nC++: virtual void SetShape(int _arg)\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"GetShapeMinValue", PyvtkROIStencilSource_GetShapeMinValue, METH_VARARGS, "V.GetShapeMinValue() -> int\nC++: virtual int GetShapeMinValue()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"GetShapeMaxValue", PyvtkROIStencilSource_GetShapeMaxValue, METH_VARARGS, "V.GetShapeMaxValue() -> int\nC++: virtual int GetShapeMaxValue()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShapeToBox", PyvtkROIStencilSource_SetShapeToBox, METH_VARARGS, "V.SetShapeToBox()\nC++: void SetShapeToBox()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShapeToEllipsoid", PyvtkROIStencilSource_SetShapeToEllipsoid, METH_VARARGS, "V.SetShapeToEllipsoid()\nC++: void SetShapeToEllipsoid()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShapeToCylinderX", PyvtkROIStencilSource_SetShapeToCylinderX, METH_VARARGS, "V.SetShapeToCylinderX()\nC++: void SetShapeToCylinderX()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShapeToCylinderY", PyvtkROIStencilSource_SetShapeToCylinderY, METH_VARARGS, "V.SetShapeToCylinderY()\nC++: void SetShapeToCylinderY()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"SetShapeToCylinderZ", PyvtkROIStencilSource_SetShapeToCylinderZ, METH_VARARGS, "V.SetShapeToCylinderZ()\nC++: void SetShapeToCylinderZ()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"GetShapeAsString", PyvtkROIStencilSource_GetShapeAsString, METH_VARARGS, "V.GetShapeAsString() -> string\nC++: virtual const char *GetShapeAsString()\n\nThe shape of the region of interest. Cylinders can be oriented\nalong the X, Y, or Z axes. The default shape is \"Box\".\n"}, {"GetBounds", PyvtkROIStencilSource_GetBounds, METH_VARARGS, "V.GetBounds() -> (float, float, float, float, float, float)\nC++: double *GetBounds()\n\n"}, {"SetBounds", PyvtkROIStencilSource_SetBounds, METH_VARARGS, "V.SetBounds(float, float, float, float, float, float)\nC++: void SetBounds(double, double, double, double, double,\n double)\nV.SetBounds((float, float, float, float, float, float))\nC++: void SetBounds(double a[6])\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkROIStencilSource_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkImagingStencilPython.vtkROIStencilSource", // 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 PyvtkROIStencilSource_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 *PyvtkROIStencilSource_StaticNew() { return vtkROIStencilSource::New(); } PyObject *PyvtkROIStencilSource_ClassNew() { PyVTKClass_Add( &PyvtkROIStencilSource_Type, PyvtkROIStencilSource_Methods, "vtkROIStencilSource", &PyvtkROIStencilSource_StaticNew); PyTypeObject *pytype = &PyvtkROIStencilSource_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 *)PyvtkImageStencilSource_ClassNew(); PyObject *d = pytype->tp_dict; PyObject *o; for (int c = 0; c < 5; c++) { static const struct { const char *name; int value; } constants[5] = { { "BOX", vtkROIStencilSource::BOX }, { "ELLIPSOID", vtkROIStencilSource::ELLIPSOID }, { "CYLINDERX", vtkROIStencilSource::CYLINDERX }, { "CYLINDERY", vtkROIStencilSource::CYLINDERY }, { "CYLINDERZ", vtkROIStencilSource::CYLINDERZ }, }; o = PyInt_FromLong(constants[c].value); if (o) { PyDict_SetItemString(d, constants[c].name, o); Py_DECREF(o); } } PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkROIStencilSource( PyObject *dict) { PyObject *o; o = PyvtkROIStencilSource_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkROIStencilSource", o) != 0) { Py_DECREF(o); } }