// python wrapper for vtkKdTreePointLocator // #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 "vtkKdTreePointLocator.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkKdTreePointLocator(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkKdTreePointLocator_ClassNew(); } #ifndef DECLARED_PyvtkAbstractPointLocator_ClassNew extern "C" { PyObject *PyvtkAbstractPointLocator_ClassNew(); } #define DECLARED_PyvtkAbstractPointLocator_ClassNew #endif static const char *PyvtkKdTreePointLocator_Doc = "vtkKdTreePointLocator - class to quickly locate points in 3-space\n\n" "Superclass: vtkAbstractPointLocator\n\n" "vtkKdTreePointLocator is a wrapper class that derives from\n" "vtkAbstractPointLocator and calls the search functions in vtkKdTree.\n\n" "@sa\n" "vtkKdTree\n\n"; static PyObject * PyvtkKdTreePointLocator_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkKdTreePointLocator::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkKdTreePointLocator_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *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->vtkKdTreePointLocator::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkKdTreePointLocator_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkKdTreePointLocator *tempr = vtkKdTreePointLocator::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkKdTreePointLocator_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkKdTreePointLocator *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkKdTreePointLocator::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 * PyvtkKdTreePointLocator_FindClosestPoint(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPoint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { vtkIdType tempr = (ap.IsBound() ? op->FindClosestPoint(temp0) : op->vtkKdTreePointLocator::FindClosestPoint(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkKdTreePointLocator_FindClosestPointWithinRadius(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPointWithinRadius"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); double temp0; const int size1 = 3; double temp1[3]; double temp2; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetValue(temp0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2)) { vtkIdType tempr = (ap.IsBound() ? op->FindClosestPointWithinRadius(temp0, temp1, temp2) : op->vtkKdTreePointLocator::FindClosestPointWithinRadius(temp0, temp1, temp2)); if (!ap.ErrorOccurred()) { ap.SetArgValue(2, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkKdTreePointLocator_FindClosestNPoints(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestNPoints"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); int temp0; const int size1 = 3; double temp1[3]; vtkIdList *temp2 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetValue(temp0) && ap.GetArray(temp1, size1) && ap.GetVTKObject(temp2, "vtkIdList")) { if (ap.IsBound()) { op->FindClosestNPoints(temp0, temp1, temp2); } else { op->vtkKdTreePointLocator::FindClosestNPoints(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkKdTreePointLocator_FindPointsWithinRadius(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindPointsWithinRadius"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); double temp0; const int size1 = 3; double temp1[3]; vtkIdList *temp2 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetValue(temp0) && ap.GetArray(temp1, size1) && ap.GetVTKObject(temp2, "vtkIdList")) { if (ap.IsBound()) { op->FindPointsWithinRadius(temp0, temp1, temp2); } else { op->vtkKdTreePointLocator::FindPointsWithinRadius(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkKdTreePointLocator_FreeSearchStructure(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FreeSearchStructure"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->FreeSearchStructure(); } else { op->vtkKdTreePointLocator::FreeSearchStructure(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkKdTreePointLocator_BuildLocator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BuildLocator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BuildLocator(); } else { op->vtkKdTreePointLocator::BuildLocator(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkKdTreePointLocator_GenerateRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GenerateRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkKdTreePointLocator *op = static_cast(vp); int temp0; vtkPolyData *temp1 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetVTKObject(temp1, "vtkPolyData")) { if (ap.IsBound()) { op->GenerateRepresentation(temp0, temp1); } else { op->vtkKdTreePointLocator::GenerateRepresentation(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkKdTreePointLocator_Methods[] = { {"IsTypeOf", PyvtkKdTreePointLocator_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nStandard type and print methods.\n"}, {"IsA", PyvtkKdTreePointLocator_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nStandard type and print methods.\n"}, {"SafeDownCast", PyvtkKdTreePointLocator_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkKdTreePointLocator\nC++: static vtkKdTreePointLocator *SafeDownCast(vtkObjectBase *o)\n\nStandard type and print methods.\n"}, {"NewInstance", PyvtkKdTreePointLocator_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkKdTreePointLocator\nC++: vtkKdTreePointLocator *NewInstance()\n\nStandard type and print methods.\n"}, {"FindClosestPoint", PyvtkKdTreePointLocator_FindClosestPoint, METH_VARARGS, "V.FindClosestPoint((float, float, float)) -> int\nC++: vtkIdType FindClosestPoint(const double x[3]) override;\n\nGiven a position x, return the id of the point closest to it.\nAlternative method requires separate x-y-z values. These methods\nare thread safe if BuildLocator() is directly or indirectly\ncalled from a single thread first.\n"}, {"FindClosestPointWithinRadius", PyvtkKdTreePointLocator_FindClosestPointWithinRadius, METH_VARARGS, "V.FindClosestPointWithinRadius(float, (float, float, float),\n float) -> int\nC++: vtkIdType FindClosestPointWithinRadius(double radius,\n const double x[3], double &dist2) override;\n\nGiven a position x and a radius r, return the id of the point\nclosest to the point in that radius. dist2 returns the squared\ndistance to the point.\n"}, {"FindClosestNPoints", PyvtkKdTreePointLocator_FindClosestNPoints, METH_VARARGS, "V.FindClosestNPoints(int, (float, float, float), vtkIdList)\nC++: void FindClosestNPoints(int N, const double x[3],\n vtkIdList *result) override;\n\nFind the closest N points to a position. This returns the closest\nN points to a position. A faster method could be created that\nreturned N close points to a position, but necessarily the exact\nN closest. The returned points are sorted from closest to\nfarthest. These methods are thread safe if BuildLocator() is\ndirectly or indirectly called from a single thread first.\n"}, {"FindPointsWithinRadius", PyvtkKdTreePointLocator_FindPointsWithinRadius, METH_VARARGS, "V.FindPointsWithinRadius(float, (float, float, float), vtkIdList)\nC++: void FindPointsWithinRadius(double R, const double x[3],\n vtkIdList *result) override;\n\nFind all points within a specified radius R of position x. The\nresult is not sorted in any specific manner. These methods are\nthread safe if BuildLocator() is directly or indirectly called\nfrom a single thread first.\n"}, {"FreeSearchStructure", PyvtkKdTreePointLocator_FreeSearchStructure, METH_VARARGS, "V.FreeSearchStructure()\nC++: void FreeSearchStructure() override;\n\nSee vtkLocator interface documentation. These methods are not\nthread safe.\n"}, {"BuildLocator", PyvtkKdTreePointLocator_BuildLocator, METH_VARARGS, "V.BuildLocator()\nC++: void BuildLocator() override;\n\nSee vtkLocator interface documentation. These methods are not\nthread safe.\n"}, {"GenerateRepresentation", PyvtkKdTreePointLocator_GenerateRepresentation, METH_VARARGS, "V.GenerateRepresentation(int, vtkPolyData)\nC++: void GenerateRepresentation(int level, vtkPolyData *pd)\n override;\n\nSee vtkLocator interface documentation. These methods are not\nthread safe.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkKdTreePointLocator_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkCommonDataModelPython.vtkKdTreePointLocator", // 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 PyvtkKdTreePointLocator_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 *PyvtkKdTreePointLocator_StaticNew() { return vtkKdTreePointLocator::New(); } PyObject *PyvtkKdTreePointLocator_ClassNew() { PyVTKClass_Add( &PyvtkKdTreePointLocator_Type, PyvtkKdTreePointLocator_Methods, "vtkKdTreePointLocator", &PyvtkKdTreePointLocator_StaticNew); PyTypeObject *pytype = &PyvtkKdTreePointLocator_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 *)PyvtkAbstractPointLocator_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkKdTreePointLocator( PyObject *dict) { PyObject *o; o = PyvtkKdTreePointLocator_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkKdTreePointLocator", o) != 0) { Py_DECREF(o); } }