// python wrapper for vtkGraphLayoutStrategy // #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 "vtkGraphLayoutStrategy.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkGraphLayoutStrategy(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkGraphLayoutStrategy_ClassNew(); } #ifndef DECLARED_PyvtkObject_ClassNew extern "C" { PyObject *PyvtkObject_ClassNew(); } #define DECLARED_PyvtkObject_ClassNew #endif static const char *PyvtkGraphLayoutStrategy_Doc = "vtkGraphLayoutStrategy - abstract superclass for all graph layout\nstrategies\n\n" "Superclass: vtkObject\n\n" "All graph layouts should subclass from this class. \n" "vtkGraphLayoutStrategy works as a plug-in to the vtkGraphLayout\n" "algorithm. The Layout() function should perform some reasonable\n" "\"chunk\" of the layout. This allows the user to be able to see the\n" "progress of the layout. Use IsLayoutComplete() to tell the user when\n" "there is no more layout to perform.\n\n" "@par Thanks: Thanks to Brian Wylie from Sandia National Laboratories\n" "for adding incremental layout capabilities.\n\n"; static PyObject * PyvtkGraphLayoutStrategy_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkGraphLayoutStrategy::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *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->vtkGraphLayoutStrategy::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkGraphLayoutStrategy *tempr = vtkGraphLayoutStrategy::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkGraphLayoutStrategy *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkGraphLayoutStrategy::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 * PyvtkGraphLayoutStrategy_SetGraph(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetGraph"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); vtkGraph *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGraph")) { if (ap.IsBound()) { op->SetGraph(temp0); } else { op->vtkGraphLayoutStrategy::SetGraph(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_Initialize(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Initialize"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Initialize(); } else { op->vtkGraphLayoutStrategy::Initialize(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_Layout(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Layout"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { op->Layout(); if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_IsLayoutComplete(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsLayoutComplete"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->IsLayoutComplete() : op->vtkGraphLayoutStrategy::IsLayoutComplete()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_SetWeightEdges(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetWeightEdges"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); bool temp0 = false; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetWeightEdges(temp0); } else { op->vtkGraphLayoutStrategy::SetWeightEdges(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_GetWeightEdges(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetWeightEdges"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { bool tempr = (ap.IsBound() ? op->GetWeightEdges() : op->vtkGraphLayoutStrategy::GetWeightEdges()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_SetEdgeWeightField(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetEdgeWeightField"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetEdgeWeightField(temp0); } else { op->vtkGraphLayoutStrategy::SetEdgeWeightField(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGraphLayoutStrategy_GetEdgeWeightField(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetEdgeWeightField"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGraphLayoutStrategy *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { char *tempr = (ap.IsBound() ? op->GetEdgeWeightField() : op->vtkGraphLayoutStrategy::GetEdgeWeightField()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyMethodDef PyvtkGraphLayoutStrategy_Methods[] = { {"IsTypeOf", PyvtkGraphLayoutStrategy_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", PyvtkGraphLayoutStrategy_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", PyvtkGraphLayoutStrategy_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkGraphLayoutStrategy\nC++: static vtkGraphLayoutStrategy *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkGraphLayoutStrategy_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkGraphLayoutStrategy\nC++: vtkGraphLayoutStrategy *NewInstance()\n\n"}, {"SetGraph", PyvtkGraphLayoutStrategy_SetGraph, METH_VARARGS, "V.SetGraph(vtkGraph)\nC++: virtual void SetGraph(vtkGraph *graph)\n\nSetting the graph for the layout strategy\n"}, {"Initialize", PyvtkGraphLayoutStrategy_Initialize, METH_VARARGS, "V.Initialize()\nC++: virtual void Initialize()\n\nThis method allows the layout strategy to do initialization of\ndata structures or whatever else it might want to do.\n"}, {"Layout", PyvtkGraphLayoutStrategy_Layout, METH_VARARGS, "V.Layout()\nC++: virtual void Layout()\n\nThis is the layout method where the graph that was set in\nSetGraph() is laid out. The method can either entirely layout the\ngraph or iteratively lay out the graph. If you have an iterative\nlayout please implement the IsLayoutComplete() method.\n"}, {"IsLayoutComplete", PyvtkGraphLayoutStrategy_IsLayoutComplete, METH_VARARGS, "V.IsLayoutComplete() -> int\nC++: virtual int IsLayoutComplete()\n\nIf your concrete class is iterative than you should overload\nIsLayoutComplete() otherwise it simply returns 1 by default;\n"}, {"SetWeightEdges", PyvtkGraphLayoutStrategy_SetWeightEdges, METH_VARARGS, "V.SetWeightEdges(bool)\nC++: virtual void SetWeightEdges(bool state)\n\nWhether to use edge weights in the layout or not.\n"}, {"GetWeightEdges", PyvtkGraphLayoutStrategy_GetWeightEdges, METH_VARARGS, "V.GetWeightEdges() -> bool\nC++: virtual bool GetWeightEdges()\n\nWhether to use edge weights in the layout or not.\n"}, {"SetEdgeWeightField", PyvtkGraphLayoutStrategy_SetEdgeWeightField, METH_VARARGS, "V.SetEdgeWeightField(string)\nC++: virtual void SetEdgeWeightField(const char *field)\n\nSet/Get the field to use for the edge weights.\n"}, {"GetEdgeWeightField", PyvtkGraphLayoutStrategy_GetEdgeWeightField, METH_VARARGS, "V.GetEdgeWeightField() -> string\nC++: virtual char *GetEdgeWeightField()\n\nSet/Get the field to use for the edge weights.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkGraphLayoutStrategy_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkInfovisLayoutPython.vtkGraphLayoutStrategy", // 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 PyvtkGraphLayoutStrategy_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 }; PyObject *PyvtkGraphLayoutStrategy_ClassNew() { PyVTKClass_Add( &PyvtkGraphLayoutStrategy_Type, PyvtkGraphLayoutStrategy_Methods, "vtkGraphLayoutStrategy", nullptr); PyTypeObject *pytype = &PyvtkGraphLayoutStrategy_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 *)PyvtkObject_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkGraphLayoutStrategy( PyObject *dict) { PyObject *o; o = PyvtkGraphLayoutStrategy_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkGraphLayoutStrategy", o) != 0) { Py_DECREF(o); } }