// python wrapper for vtkPlotPie // #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 "vtkRect.h" #include "vtkVector.h" #include "vtkPlotPie.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkPlotPie(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkPlotPie_ClassNew(); } #ifndef DECLARED_PyvtkPlot_ClassNew extern "C" { PyObject *PyvtkPlot_ClassNew(); } #define DECLARED_PyvtkPlot_ClassNew #endif static const char *PyvtkPlotPie_Doc = "vtkPlotPie - Class for drawing a Pie diagram.\n\n" "Superclass: vtkPlot\n\n" ; static PyObject * PyvtkPlotPie_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkPlotPie::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotPie_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *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->vtkPlotPie::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotPie_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkPlotPie *tempr = vtkPlotPie::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkPlotPie_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkPlotPie *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkPlotPie::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 * PyvtkPlotPie_Paint(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Paint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *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->vtkPlotPie::Paint(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotPie_PaintLegend(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "PaintLegend"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); vtkContext2D *temp0 = nullptr; vtkRectf *temp1 = nullptr; PyObject *pobj1 = nullptr; int temp2; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetVTKObject(temp0, "vtkContext2D") && ap.GetSpecialObject(temp1, pobj1, "vtkRectf") && ap.GetValue(temp2)) { bool tempr = (ap.IsBound() ? op->PaintLegend(temp0, *temp1, temp2) : op->vtkPlotPie::PaintLegend(temp0, *temp1, temp2)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj1); return result; } static PyObject * PyvtkPlotPie_SetDimensions_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); int temp0; int temp1; int temp2; int 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->vtkPlotPie::SetDimensions(temp0, temp1, temp2, temp3); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotPie_SetDimensions_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); const int size0 = 4; int temp0[4]; int save0[4]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { ap.SaveArray(temp0, save0, size0); if (ap.IsBound()) { op->SetDimensions(temp0); } else { op->vtkPlotPie::SetDimensions(temp0); } if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotPie_SetDimensions(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 4: return PyvtkPlotPie_SetDimensions_s1(self, args); case 1: return PyvtkPlotPie_SetDimensions_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetDimensions"); return nullptr; } static PyObject * PyvtkPlotPie_GetDimensions(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetDimensions"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); int sizer = 4; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int *tempr = (ap.IsBound() ? op->GetDimensions() : op->vtkPlotPie::GetDimensions()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkPlotPie_SetColorSeries(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetColorSeries"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); vtkColorSeries *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkColorSeries")) { if (ap.IsBound()) { op->SetColorSeries(temp0); } else { op->vtkPlotPie::SetColorSeries(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotPie_GetColorSeries(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetColorSeries"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotPie *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkColorSeries *tempr = (ap.IsBound() ? op->GetColorSeries() : op->vtkPlotPie::GetColorSeries()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyMethodDef PyvtkPlotPie_Methods[] = { {"IsTypeOf", PyvtkPlotPie_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", PyvtkPlotPie_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", PyvtkPlotPie_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkPlotPie\nC++: static vtkPlotPie *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkPlotPie_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkPlotPie\nC++: vtkPlotPie *NewInstance()\n\n"}, {"Paint", PyvtkPlotPie_Paint, METH_VARARGS, "V.Paint(vtkContext2D) -> bool\nC++: bool Paint(vtkContext2D *painter) override;\n\nPaint event for the item.\n"}, {"PaintLegend", PyvtkPlotPie_PaintLegend, METH_VARARGS, "V.PaintLegend(vtkContext2D, vtkRectf, int) -> bool\nC++: bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect,\n int legendIndex) override;\n\nPaint legend event for the XY plot, called whenever the legend\nneeds the plot items symbol/mark/line drawn. A rect is supplied\nwith the lower left corner of the rect (elements 0 and 1) and\nwith width x height (elements 2 and 3). The plot can choose how\nto fill the space supplied.\n"}, {"SetDimensions", PyvtkPlotPie_SetDimensions, METH_VARARGS, "V.SetDimensions(int, int, int, int)\nC++: void SetDimensions(int arg1, int arg2, int arg3, int arg4)\nV.SetDimensions([int, int, int, int])\nC++: void SetDimensions(int arg[4])\n\nSet the dimensions of the pie, arguments 1 and 2 are the x and y\ncoordinate of the bottom corner. Arguments 3 and 4 are the width\nand height.\n"}, {"GetDimensions", PyvtkPlotPie_GetDimensions, METH_VARARGS, "V.GetDimensions() -> (int, int, int, int)\nC++: int *GetDimensions()\n\n"}, {"SetColorSeries", PyvtkPlotPie_SetColorSeries, METH_VARARGS, "V.SetColorSeries(vtkColorSeries)\nC++: void SetColorSeries(vtkColorSeries *colorSeries)\n\nSet the color series to use for the Pie.\n"}, {"GetColorSeries", PyvtkPlotPie_GetColorSeries, METH_VARARGS, "V.GetColorSeries() -> vtkColorSeries\nC++: vtkColorSeries *GetColorSeries()\n\nGet the color series used.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkPlotPie_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkChartsCorePython.vtkPlotPie", // 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 PyvtkPlotPie_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 *PyvtkPlotPie_StaticNew() { return vtkPlotPie::New(); } PyObject *PyvtkPlotPie_ClassNew() { PyVTKClass_Add( &PyvtkPlotPie_Type, PyvtkPlotPie_Methods, "vtkPlotPie", &PyvtkPlotPie_StaticNew); PyTypeObject *pytype = &PyvtkPlotPie_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 *)PyvtkPlot_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkPlotPie( PyObject *dict) { PyObject *o; o = PyvtkPlotPie_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkPlotPie", o) != 0) { Py_DECREF(o); } }