// python wrapper for vtkAreaLayout // #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 "vtkAreaLayout.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkAreaLayout(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkAreaLayout_ClassNew(); } #ifndef DECLARED_PyvtkTreeAlgorithm_ClassNew extern "C" { PyObject *PyvtkTreeAlgorithm_ClassNew(); } #define DECLARED_PyvtkTreeAlgorithm_ClassNew #endif static const char *PyvtkAreaLayout_Doc = "vtkAreaLayout - layout a vtkTree into a tree map\n\n" "Superclass: vtkTreeAlgorithm\n\n" "vtkAreaLayout assigns sector regions to each vertex in the tree,\n" "creating a tree ring. The data is added as a data array with four\n" "components per tuple representing the location and size of the sector\n" "using the format (StartAngle, EndAngle, innerRadius, outerRadius).\n\n" "This algorithm relies on a helper class to perform the actual layout.\n" "This helper class is a subclass of vtkAreaLayoutStrategy.\n\n" "@par Thanks: Thanks to Jason Shepherd from Sandia National\n" "Laboratories for help developing this class.\n\n"; static PyObject * PyvtkAreaLayout_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkAreaLayout::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *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->vtkAreaLayout::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkAreaLayout *tempr = vtkAreaLayout::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkAreaLayout_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkAreaLayout *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkAreaLayout::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 * PyvtkAreaLayout_SetSizeArrayName(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetSizeArrayName"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetSizeArrayName(temp0); } else { op->vtkAreaLayout::SetSizeArrayName(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_GetAreaArrayName(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAreaArrayName"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { char *tempr = (ap.IsBound() ? op->GetAreaArrayName() : op->vtkAreaLayout::GetAreaArrayName()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_SetAreaArrayName(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAreaArrayName"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetAreaArrayName(temp0); } else { op->vtkAreaLayout::SetAreaArrayName(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_GetEdgeRoutingPoints(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetEdgeRoutingPoints"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { bool tempr = (ap.IsBound() ? op->GetEdgeRoutingPoints() : op->vtkAreaLayout::GetEdgeRoutingPoints()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_SetEdgeRoutingPoints(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetEdgeRoutingPoints"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); bool temp0 = false; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetEdgeRoutingPoints(temp0); } else { op->vtkAreaLayout::SetEdgeRoutingPoints(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_EdgeRoutingPointsOn(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EdgeRoutingPointsOn"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->EdgeRoutingPointsOn(); } else { op->vtkAreaLayout::EdgeRoutingPointsOn(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_EdgeRoutingPointsOff(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EdgeRoutingPointsOff"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->EdgeRoutingPointsOff(); } else { op->vtkAreaLayout::EdgeRoutingPointsOff(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_GetLayoutStrategy(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLayoutStrategy"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkAreaLayoutStrategy *tempr = (ap.IsBound() ? op->GetLayoutStrategy() : op->vtkAreaLayout::GetLayoutStrategy()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkAreaLayout_SetLayoutStrategy(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetLayoutStrategy"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); vtkAreaLayoutStrategy *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkAreaLayoutStrategy")) { if (ap.IsBound()) { op->SetLayoutStrategy(temp0); } else { op->vtkAreaLayout::SetLayoutStrategy(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkAreaLayout_GetMTime(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMTime"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { unsigned long tempr = (ap.IsBound() ? op->GetMTime() : op->vtkAreaLayout::GetMTime()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_FindVertex(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindVertex"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); const int size0 = 2; float temp0[2]; float save0[2]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { ap.SaveArray(temp0, save0, size0); vtkIdType tempr = (ap.IsBound() ? op->FindVertex(temp0) : op->vtkAreaLayout::FindVertex(temp0)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkAreaLayout_GetBoundingArea(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBoundingArea"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkAreaLayout *op = static_cast(vp); vtkIdType temp0; int size1 = ap.GetArgSize(1); vtkPythonArgs::Array store1(2*size1); float *temp1 = store1.Data(); float *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->GetBoundingArea(temp0, temp1); } else { op->vtkAreaLayout::GetBoundingArea(temp0, temp1); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkAreaLayout_Methods[] = { {"IsTypeOf", PyvtkAreaLayout_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", PyvtkAreaLayout_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", PyvtkAreaLayout_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkAreaLayout\nC++: static vtkAreaLayout *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkAreaLayout_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkAreaLayout\nC++: vtkAreaLayout *NewInstance()\n\n"}, {"SetSizeArrayName", PyvtkAreaLayout_SetSizeArrayName, METH_VARARGS, "V.SetSizeArrayName(string)\nC++: virtual void SetSizeArrayName(const char *name)\n\nThe array name to use for retrieving the relative size of each\nvertex. If this array is not found, use constant size for each\nvertex.\n"}, {"GetAreaArrayName", PyvtkAreaLayout_GetAreaArrayName, METH_VARARGS, "V.GetAreaArrayName() -> string\nC++: virtual char *GetAreaArrayName()\n\nThe name for the array created for the area for each vertex. The\nrectangles are stored in a quadruple float array (startAngle,\nendAngle, innerRadius, outerRadius). For rectangular layouts,\nthis is (minx, maxx, miny, maxy).\n"}, {"SetAreaArrayName", PyvtkAreaLayout_SetAreaArrayName, METH_VARARGS, "V.SetAreaArrayName(string)\nC++: virtual void SetAreaArrayName(const char *_arg)\n\nThe name for the array created for the area for each vertex. The\nrectangles are stored in a quadruple float array (startAngle,\nendAngle, innerRadius, outerRadius). For rectangular layouts,\nthis is (minx, maxx, miny, maxy).\n"}, {"GetEdgeRoutingPoints", PyvtkAreaLayout_GetEdgeRoutingPoints, METH_VARARGS, "V.GetEdgeRoutingPoints() -> bool\nC++: virtual bool GetEdgeRoutingPoints()\n\nWhether to output a second output tree with vertex locations\nappropriate for routing bundled edges. Default is on.\n"}, {"SetEdgeRoutingPoints", PyvtkAreaLayout_SetEdgeRoutingPoints, METH_VARARGS, "V.SetEdgeRoutingPoints(bool)\nC++: virtual void SetEdgeRoutingPoints(bool _arg)\n\nWhether to output a second output tree with vertex locations\nappropriate for routing bundled edges. Default is on.\n"}, {"EdgeRoutingPointsOn", PyvtkAreaLayout_EdgeRoutingPointsOn, METH_VARARGS, "V.EdgeRoutingPointsOn()\nC++: virtual void EdgeRoutingPointsOn()\n\nWhether to output a second output tree with vertex locations\nappropriate for routing bundled edges. Default is on.\n"}, {"EdgeRoutingPointsOff", PyvtkAreaLayout_EdgeRoutingPointsOff, METH_VARARGS, "V.EdgeRoutingPointsOff()\nC++: virtual void EdgeRoutingPointsOff()\n\nWhether to output a second output tree with vertex locations\nappropriate for routing bundled edges. Default is on.\n"}, {"GetLayoutStrategy", PyvtkAreaLayout_GetLayoutStrategy, METH_VARARGS, "V.GetLayoutStrategy() -> vtkAreaLayoutStrategy\nC++: virtual vtkAreaLayoutStrategy *GetLayoutStrategy()\n\nThe strategy to use when laying out the tree map.\n"}, {"SetLayoutStrategy", PyvtkAreaLayout_SetLayoutStrategy, METH_VARARGS, "V.SetLayoutStrategy(vtkAreaLayoutStrategy)\nC++: void SetLayoutStrategy(vtkAreaLayoutStrategy *strategy)\n\nThe strategy to use when laying out the tree map.\n"}, {"GetMTime", PyvtkAreaLayout_GetMTime, METH_VARARGS, "V.GetMTime() -> int\nC++: vtkMTimeType GetMTime() override;\n\nGet the modification time of the layout algorithm.\n"}, {"FindVertex", PyvtkAreaLayout_FindVertex, METH_VARARGS, "V.FindVertex([float, float]) -> int\nC++: vtkIdType FindVertex(float pnt[2])\n\nGet the vertex whose area contains the point, or return -1 if no\nvertex area covers the point.\n"}, {"GetBoundingArea", PyvtkAreaLayout_GetBoundingArea, METH_VARARGS, "V.GetBoundingArea(int, [float, ...])\nC++: void GetBoundingArea(vtkIdType id, float *sinfo)\n\nThe bounding area information for a certain vertex id.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkAreaLayout_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkInfovisLayoutPython.vtkAreaLayout", // 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 PyvtkAreaLayout_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 *PyvtkAreaLayout_StaticNew() { return vtkAreaLayout::New(); } PyObject *PyvtkAreaLayout_ClassNew() { PyVTKClass_Add( &PyvtkAreaLayout_Type, PyvtkAreaLayout_Methods, "vtkAreaLayout", &PyvtkAreaLayout_StaticNew); PyTypeObject *pytype = &PyvtkAreaLayout_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 *)PyvtkTreeAlgorithm_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkAreaLayout( PyObject *dict) { PyObject *o; o = PyvtkAreaLayout_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkAreaLayout", o) != 0) { Py_DECREF(o); } }