// python wrapper for vtkPlotBox // #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 "vtkStdString.h" #include "vtkVector.h" #include "vtkPlotBox.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkPlotBox(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkPlotBox_ClassNew(); } #ifndef DECLARED_PyvtkPlot_ClassNew extern "C" { PyObject *PyvtkPlot_ClassNew(); } #define DECLARED_PyvtkPlot_ClassNew #endif static const char *PyvtkPlotBox_Doc = "vtkPlotBox - Class for drawing box plots.\n\n" "Superclass: vtkPlot\n\n" "Plots to draw box plots given columns from a vtkTable that may\n" "contains 5 lines with quartiles and median.\n\n"; static PyObject * PyvtkPlotBox_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkPlotBox::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotBox_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *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->vtkPlotBox::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotBox_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkPlotBox *tempr = vtkPlotBox::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkPlotBox_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkPlotBox *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkPlotBox::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 * PyvtkPlotBox_Update(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Update"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Update(); } else { op->vtkPlotBox::Update(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_Paint(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Paint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *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->vtkPlotBox::Paint(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotBox_PaintLegend(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "PaintLegend"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *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->vtkPlotBox::PaintLegend(temp0, *temp1, temp2)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } Py_XDECREF(pobj1); return result; } static PyObject * PyvtkPlotBox_SetInputData_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInputData"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); vtkTable *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkTable")) { if (ap.IsBound()) { op->SetInputData(temp0); } else { op->vtkPlotBox::SetInputData(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_SetInputData_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetInputData"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); vtkTable *temp0 = nullptr; vtkStdString temp1; vtkStdString temp2; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetVTKObject(temp0, "vtkTable") && ap.GetValue(temp1) && ap.GetValue(temp2)) { if (ap.IsBound()) { op->SetInputData(temp0, temp1, temp2); } else { op->vtkPlotBox::SetInputData(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_SetInputData(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 1: return PyvtkPlotBox_SetInputData_s1(self, args); case 3: return PyvtkPlotBox_SetInputData_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetInputData"); return nullptr; } static PyObject * PyvtkPlotBox_GetLabels(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLabels"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkStringArray *tempr = (ap.IsBound() ? op->GetLabels() : op->vtkPlotBox::GetLabels()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkPlotBox_SetLookupTable(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetLookupTable"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); vtkScalarsToColors *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkScalarsToColors")) { if (ap.IsBound()) { op->SetLookupTable(temp0); } else { op->vtkPlotBox::SetLookupTable(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_GetLookupTable(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLookupTable"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkScalarsToColors *tempr = (ap.IsBound() ? op->GetLookupTable() : op->vtkPlotBox::GetLookupTable()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkPlotBox_SetColumnColor(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetColumnColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); vtkStdString temp0; int size1 = ap.GetArgSize(1); vtkPythonArgs::Array store1(2*size1); double *temp1 = store1.Data(); double *save1 = (size1 == 0 ? nullptr : temp1 + size1); PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetArray(temp1, size1)) { ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->SetColumnColor(temp0, temp1); } else { op->vtkPlotBox::SetColumnColor(temp0, temp1); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_CreateDefaultLookupTable(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CreateDefaultLookupTable"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CreateDefaultLookupTable(); } else { op->vtkPlotBox::CreateDefaultLookupTable(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_GetBoxWidth(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBoxWidth"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { float tempr = (ap.IsBound() ? op->GetBoxWidth() : op->vtkPlotBox::GetBoxWidth()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkPlotBox_SetBoxWidth(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBoxWidth"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); float temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetBoxWidth(temp0); } else { op->vtkPlotBox::SetBoxWidth(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkPlotBox_GetTitleProperties(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetTitleProperties"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkPlotBox *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkTextProperty *tempr = (ap.IsBound() ? op->GetTitleProperties() : op->vtkPlotBox::GetTitleProperties()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyMethodDef PyvtkPlotBox_Methods[] = { {"IsTypeOf", PyvtkPlotBox_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", PyvtkPlotBox_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", PyvtkPlotBox_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkPlotBox\nC++: static vtkPlotBox *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkPlotBox_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkPlotBox\nC++: vtkPlotBox *NewInstance()\n\n"}, {"Update", PyvtkPlotBox_Update, METH_VARARGS, "V.Update()\nC++: void Update() override;\n\nPerform any updates to the item that may be necessary before\nrendering. The scene should take care of calling this on all\nitems before their Paint function is invoked.\n"}, {"Paint", PyvtkPlotBox_Paint, METH_VARARGS, "V.Paint(vtkContext2D) -> bool\nC++: bool Paint(vtkContext2D *painter) override;\n\nPaint event for the plot, called whenever the chart needs to be\ndrawn\n"}, {"PaintLegend", PyvtkPlotBox_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 plot, called whenever the legend needs\nthe plot items symbol/mark/line drawn. A rect is supplied with\nthe lower left corner of the rect (elements 0 and 1) and with\nwidth x height (elements 2 and 3). The plot can choose how to\nfill the space supplied.\n"}, {"SetInputData", PyvtkPlotBox_SetInputData, METH_VARARGS, "V.SetInputData(vtkTable)\nC++: void SetInputData(vtkTable *table) override;\nV.SetInputData(vtkTable, string, string)\nC++: void SetInputData(vtkTable *table, const vtkStdString &,\n const vtkStdString &) override;\n\nThis is a convenience function to set the input table.\n"}, {"GetLabels", PyvtkPlotBox_GetLabels, METH_VARARGS, "V.GetLabels() -> vtkStringArray\nC++: vtkStringArray *GetLabels() override;\n\nGet the plot labels. If this array has a length greater than 1\nthe index refers to the stacked objects in the plot.\n"}, {"SetLookupTable", PyvtkPlotBox_SetLookupTable, METH_VARARGS, "V.SetLookupTable(vtkScalarsToColors)\nC++: void SetLookupTable(vtkScalarsToColors *lut)\n\nSpecify a lookup table for the mapper to use.\n"}, {"GetLookupTable", PyvtkPlotBox_GetLookupTable, METH_VARARGS, "V.GetLookupTable() -> vtkScalarsToColors\nC++: vtkScalarsToColors *GetLookupTable()\n\nSpecify a lookup table for the mapper to use.\n"}, {"SetColumnColor", PyvtkPlotBox_SetColumnColor, METH_VARARGS, "V.SetColumnColor(string, [float, ...])\nC++: void SetColumnColor(const vtkStdString &colName, double *rgb)\n\nHelper function to set the color of a given column.\n"}, {"CreateDefaultLookupTable", PyvtkPlotBox_CreateDefaultLookupTable, METH_VARARGS, "V.CreateDefaultLookupTable()\nC++: virtual void CreateDefaultLookupTable()\n\nCreate default lookup table. Generally used to create one when\nnone is available with the scalar data.\n"}, {"GetBoxWidth", PyvtkPlotBox_GetBoxWidth, METH_VARARGS, "V.GetBoxWidth() -> float\nC++: virtual float GetBoxWidth()\n\nGet/Set the width of boxes.\n"}, {"SetBoxWidth", PyvtkPlotBox_SetBoxWidth, METH_VARARGS, "V.SetBoxWidth(float)\nC++: virtual void SetBoxWidth(float _arg)\n\nGet/Set the width of boxes.\n"}, {"GetTitleProperties", PyvtkPlotBox_GetTitleProperties, METH_VARARGS, "V.GetTitleProperties() -> vtkTextProperty\nC++: virtual vtkTextProperty *GetTitleProperties()\n\nGet the vtkTextProperty that governs how the plot title is\ndisplayed.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkPlotBox_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkChartsCorePython.vtkPlotBox", // 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 PyvtkPlotBox_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 *PyvtkPlotBox_StaticNew() { return vtkPlotBox::New(); } PyObject *PyvtkPlotBox_ClassNew() { PyVTKClass_Add( &PyvtkPlotBox_Type, PyvtkPlotBox_Methods, "vtkPlotBox", &PyvtkPlotBox_StaticNew); PyTypeObject *pytype = &PyvtkPlotBox_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_vtkPlotBox( PyObject *dict) { PyObject *o; o = PyvtkPlotBox_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkPlotBox", o) != 0) { Py_DECREF(o); } }