// python wrapper for vtkConeLayoutStrategy // #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 "vtkConeLayoutStrategy.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkConeLayoutStrategy(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkConeLayoutStrategy_ClassNew(); } #ifndef DECLARED_PyvtkGraphLayoutStrategy_ClassNew extern "C" { PyObject *PyvtkGraphLayoutStrategy_ClassNew(); } #define DECLARED_PyvtkGraphLayoutStrategy_ClassNew #endif static const char *PyvtkConeLayoutStrategy_Doc = "vtkConeLayoutStrategy - produce a cone-tree layout for a forest\n\n" "Superclass: vtkGraphLayoutStrategy\n\n" "vtkConeLayoutStrategy positions the nodes of a tree(forest) in 3D\n" "space based on the cone-tree approach first described by Robertson,\n" "Mackinlay and Card in Proc. CHI'91. This implementation incorporates\n" "refinements to the layout developed by Carriere and Kazman, and by\n" "Auber.\n\n" "The input graph must be a forest (i.e. a set of trees, or a single\n" "tree); in the case of a forest, the input will be converted to a\n" "single tree by introducing a new root node, and connecting each root\n" "in the input forest to the meta-root. The tree is then laid out,\n" "after which the meta-root is removed.\n\n" "The cones are positioned so that children lie in planes parallel to\n" "the X-Y plane, with the axis of cones parallel to Z, and with Z\n" "coordinate increasing with distance of nodes from the root.\n\n" "@par Thanks: Thanks to David Duke from the University of Leeds for\n" "providing this implementation.\n\n"; static PyObject * PyvtkConeLayoutStrategy_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkConeLayoutStrategy::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *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->vtkConeLayoutStrategy::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkConeLayoutStrategy *tempr = vtkConeLayoutStrategy::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkConeLayoutStrategy *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkConeLayoutStrategy::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 * PyvtkConeLayoutStrategy_SetCompactness(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetCompactness"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); float temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetCompactness(temp0); } else { op->vtkConeLayoutStrategy::SetCompactness(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkConeLayoutStrategy_GetCompactness(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetCompactness"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { float tempr = (ap.IsBound() ? op->GetCompactness() : op->vtkConeLayoutStrategy::GetCompactness()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_SetCompression(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetCompression"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetCompression(temp0); } else { op->vtkConeLayoutStrategy::SetCompression(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkConeLayoutStrategy_GetCompression(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetCompression"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetCompression() : op->vtkConeLayoutStrategy::GetCompression()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_CompressionOn(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CompressionOn"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CompressionOn(); } else { op->vtkConeLayoutStrategy::CompressionOn(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkConeLayoutStrategy_CompressionOff(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CompressionOff"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CompressionOff(); } else { op->vtkConeLayoutStrategy::CompressionOff(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkConeLayoutStrategy_SetSpacing(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetSpacing"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); float temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetSpacing(temp0); } else { op->vtkConeLayoutStrategy::SetSpacing(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkConeLayoutStrategy_GetSpacing(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetSpacing"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { float tempr = (ap.IsBound() ? op->GetSpacing() : op->vtkConeLayoutStrategy::GetSpacing()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkConeLayoutStrategy_Layout(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Layout"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkConeLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Layout(); } else { op->vtkConeLayoutStrategy::Layout(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkConeLayoutStrategy_Methods[] = { {"IsTypeOf", PyvtkConeLayoutStrategy_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", PyvtkConeLayoutStrategy_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", PyvtkConeLayoutStrategy_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkConeLayoutStrategy\nC++: static vtkConeLayoutStrategy *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkConeLayoutStrategy_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkConeLayoutStrategy\nC++: vtkConeLayoutStrategy *NewInstance()\n\n"}, {"SetCompactness", PyvtkConeLayoutStrategy_SetCompactness, METH_VARARGS, "V.SetCompactness(float)\nC++: virtual void SetCompactness(float _arg)\n\nDetermine the compactness, the ratio between the average width of\na cone in the tree, and the height of the cone. The default\nsetting is 0.75 which (empirically) seems reasonable, but this\nwill need adapting depending on the data.\n"}, {"GetCompactness", PyvtkConeLayoutStrategy_GetCompactness, METH_VARARGS, "V.GetCompactness() -> float\nC++: virtual float GetCompactness()\n\nDetermine the compactness, the ratio between the average width of\na cone in the tree, and the height of the cone. The default\nsetting is 0.75 which (empirically) seems reasonable, but this\nwill need adapting depending on the data.\n"}, {"SetCompression", PyvtkConeLayoutStrategy_SetCompression, METH_VARARGS, "V.SetCompression(int)\nC++: virtual void SetCompression(int _arg)\n\nDetermine if layout should be compressed, i.e. the layout puts\nchildren closer together, possibly allowing sub-trees to overlap.\n This is useful if the tree is actually the spanning tree of a\ngraph. For \"real\" trees, non-compressed layout is best, and is\nthe default.\n"}, {"GetCompression", PyvtkConeLayoutStrategy_GetCompression, METH_VARARGS, "V.GetCompression() -> int\nC++: virtual int GetCompression()\n\nDetermine if layout should be compressed, i.e. the layout puts\nchildren closer together, possibly allowing sub-trees to overlap.\n This is useful if the tree is actually the spanning tree of a\ngraph. For \"real\" trees, non-compressed layout is best, and is\nthe default.\n"}, {"CompressionOn", PyvtkConeLayoutStrategy_CompressionOn, METH_VARARGS, "V.CompressionOn()\nC++: virtual void CompressionOn()\n\nDetermine if layout should be compressed, i.e. the layout puts\nchildren closer together, possibly allowing sub-trees to overlap.\n This is useful if the tree is actually the spanning tree of a\ngraph. For \"real\" trees, non-compressed layout is best, and is\nthe default.\n"}, {"CompressionOff", PyvtkConeLayoutStrategy_CompressionOff, METH_VARARGS, "V.CompressionOff()\nC++: virtual void CompressionOff()\n\nDetermine if layout should be compressed, i.e. the layout puts\nchildren closer together, possibly allowing sub-trees to overlap.\n This is useful if the tree is actually the spanning tree of a\ngraph. For \"real\" trees, non-compressed layout is best, and is\nthe default.\n"}, {"SetSpacing", PyvtkConeLayoutStrategy_SetSpacing, METH_VARARGS, "V.SetSpacing(float)\nC++: virtual void SetSpacing(float _arg)\n\nSet the spacing parameter that affects space between layers of\nthe tree. If compression is on, Spacing is the actual distance\nbetween layers. If compression is off, actual distance also\nincludes a factor of the compactness and maximum cone radius.\n"}, {"GetSpacing", PyvtkConeLayoutStrategy_GetSpacing, METH_VARARGS, "V.GetSpacing() -> float\nC++: virtual float GetSpacing()\n\nSet the spacing parameter that affects space between layers of\nthe tree. If compression is on, Spacing is the actual distance\nbetween layers. If compression is off, actual distance also\nincludes a factor of the compactness and maximum cone radius.\n"}, {"Layout", PyvtkConeLayoutStrategy_Layout, METH_VARARGS, "V.Layout()\nC++: void Layout() override;\n\nPerform the layout.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkConeLayoutStrategy_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkInfovisLayoutPython.vtkConeLayoutStrategy", // 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 PyvtkConeLayoutStrategy_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 *PyvtkConeLayoutStrategy_StaticNew() { return vtkConeLayoutStrategy::New(); } PyObject *PyvtkConeLayoutStrategy_ClassNew() { PyVTKClass_Add( &PyvtkConeLayoutStrategy_Type, PyvtkConeLayoutStrategy_Methods, "vtkConeLayoutStrategy", &PyvtkConeLayoutStrategy_StaticNew); PyTypeObject *pytype = &PyvtkConeLayoutStrategy_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 *)PyvtkGraphLayoutStrategy_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkConeLayoutStrategy( PyObject *dict) { PyObject *o; o = PyvtkConeLayoutStrategy_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkConeLayoutStrategy", o) != 0) { Py_DECREF(o); } }