// python wrapper for vtkGeoSource // #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include "vtkPythonArgs.h" #include "vtkPythonOverload.h" #include "vtkConfigure.h" #include #include #include "vtkVariant.h" #include "vtkGeoSource.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkGeoSource(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkGeoSource_ClassNew(); } #ifndef DECLARED_PyvtkObject_ClassNew extern "C" { PyObject *PyvtkObject_ClassNew(); } #define DECLARED_PyvtkObject_ClassNew #endif static const char *PyvtkGeoSource_Doc = "vtkGeoSource - A multi-resolution geographic data source\n\n" "Superclass: vtkObject\n\n" "vtkGeoSource is an abstract superclass for all multi-resolution data\n" "sources shown in a geographic view like vtkGeoView or vtkGeoView2D.\n" "vtkGeoSource subclasses need to implement the FetchRoot() method,\n" "which fills a vtkGeoTreeNode with the low-res data at the root, and\n" "FetchChild(), which produces a refinement of a parent node. Other\n" "geovis classes such as vtkGeoTerrain, vtkGeoTerrain2D, and\n" "vtkGeoAlignedImageSource use a vtkGeoSource subclass to build their\n" "geometry or image caches which are stored in trees. The source itself\n" "does not maintain the tree, but simply provides a mechanism for\n" "generating refined tree nodes.\n\n" "Sources are multi-threaded. Each source may have one or more worker\n" "threads associated with it, which this superclass manages. It is\n" "essential that the FetchChild() method is thread-safe, since it may\n" "be called from multiple workers simultaneously.\n\n"; static PyObject * PyvtkGeoSource_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkGeoSource::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoSource_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *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->vtkGeoSource::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoSource_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkGeoSource *tempr = vtkGeoSource::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGeoSource_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkGeoSource *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkGeoSource::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 * PyvtkGeoSource_FetchRoot(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FetchRoot"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); vtkGeoTreeNode *temp0 = nullptr; PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGeoTreeNode")) { bool tempr = op->FetchRoot(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoSource_FetchChild(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FetchChild"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); vtkGeoTreeNode *temp0 = nullptr; int temp1; vtkGeoTreeNode *temp2 = nullptr; PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(3) && ap.GetVTKObject(temp0, "vtkGeoTreeNode") && ap.GetValue(temp1) && ap.GetVTKObject(temp2, "vtkGeoTreeNode")) { bool tempr = op->FetchChild(temp0, temp1, temp2); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoSource_RequestChildren(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "RequestChildren"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); vtkGeoTreeNode *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGeoTreeNode")) { if (ap.IsBound()) { op->RequestChildren(temp0); } else { op->vtkGeoSource::RequestChildren(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoSource_GetRequestedNodes(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetRequestedNodes"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); vtkGeoTreeNode *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGeoTreeNode")) { vtkCollection *tempr = (ap.IsBound() ? op->GetRequestedNodes(temp0) : op->vtkGeoSource::GetRequestedNodes(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGeoSource_Initialize(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Initialize"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); int temp0 = 1; PyObject *result = nullptr; if (op && ap.CheckArgCount(0, 1) && (ap.NoArgsLeft() || ap.GetValue(temp0))) { if (ap.IsBound()) { op->Initialize(temp0); } else { op->vtkGeoSource::Initialize(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoSource_ShutDown(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ShutDown"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->ShutDown(); } else { op->vtkGeoSource::ShutDown(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoSource_WorkerThread(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "WorkerThread"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->WorkerThread(); } else { op->vtkGeoSource::WorkerThread(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoSource_GetTransform(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetTransform"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkAbstractTransform *tempr = (ap.IsBound() ? op->GetTransform() : op->vtkGeoSource::GetTransform()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyMethodDef PyvtkGeoSource_Methods[] = { {"IsTypeOf", PyvtkGeoSource_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", PyvtkGeoSource_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", PyvtkGeoSource_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkGeoSource\nC++: static vtkGeoSource *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkGeoSource_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkGeoSource\nC++: vtkGeoSource *NewInstance()\n\n"}, {"FetchRoot", PyvtkGeoSource_FetchRoot, METH_VARARGS, "V.FetchRoot(vtkGeoTreeNode) -> bool\nC++: virtual bool FetchRoot(vtkGeoTreeNode *root)\n\nBlocking access methods to be implemented in subclasses.\n"}, {"FetchChild", PyvtkGeoSource_FetchChild, METH_VARARGS, "V.FetchChild(vtkGeoTreeNode, int, vtkGeoTreeNode) -> bool\nC++: virtual bool FetchChild(vtkGeoTreeNode *node, int index,\n vtkGeoTreeNode *child)\n\nBlocking access methods to be implemented in subclasses.\n"}, {"RequestChildren", PyvtkGeoSource_RequestChildren, METH_VARARGS, "V.RequestChildren(vtkGeoTreeNode)\nC++: virtual void RequestChildren(vtkGeoTreeNode *node)\n\nNon-blocking methods for to use from the main application. After\ncalling RequestChildren() for a certain node, GetRequestedNodes()\nwill after a certain period of time return a non-null pointer to\na collection of four vtkGeoTreeNode objects, which are the four\nchildren of the requested node. The collection is reference\ncounted, so you need to eventually call Delete() on the returned\ncollection pointer (if it is non-null).\n"}, {"GetRequestedNodes", PyvtkGeoSource_GetRequestedNodes, METH_VARARGS, "V.GetRequestedNodes(vtkGeoTreeNode) -> vtkCollection\nC++: virtual vtkCollection *GetRequestedNodes(\n vtkGeoTreeNode *node)\n\nNon-blocking methods for to use from the main application. After\ncalling RequestChildren() for a certain node, GetRequestedNodes()\nwill after a certain period of time return a non-null pointer to\na collection of four vtkGeoTreeNode objects, which are the four\nchildren of the requested node. The collection is reference\ncounted, so you need to eventually call Delete() on the returned\ncollection pointer (if it is non-null).\n"}, {"Initialize", PyvtkGeoSource_Initialize, METH_VARARGS, "V.Initialize(int)\nC++: void Initialize(int numThreads=1)\n\nSpawn worker threads.\n"}, {"ShutDown", PyvtkGeoSource_ShutDown, METH_VARARGS, "V.ShutDown()\nC++: void ShutDown()\n\nShut down the source. This terminates the thread and releases\nmemory.\n"}, {"WorkerThread", PyvtkGeoSource_WorkerThread, METH_VARARGS, "V.WorkerThread()\nC++: void WorkerThread()\n\n"}, {"GetTransform", PyvtkGeoSource_GetTransform, METH_VARARGS, "V.GetTransform() -> vtkAbstractTransform\nC++: virtual vtkAbstractTransform *GetTransform()\n\nReturn the projection transformation used by this source.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkGeoSource_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkGeovisCorePython.vtkGeoSource", // 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 PyvtkGeoSource_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 *PyvtkGeoSource_ClassNew() { PyVTKClass_Add( &PyvtkGeoSource_Type, PyvtkGeoSource_Methods, "vtkGeoSource", nullptr); PyTypeObject *pytype = &PyvtkGeoSource_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_vtkGeoSource( PyObject *dict) { PyObject *o; o = PyvtkGeoSource_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkGeoSource", o) != 0) { Py_DECREF(o); } }