// python wrapper for vtkCellLocator // #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 "vtkCellLocator.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkCellLocator(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkCellLocator_ClassNew(); } #ifndef DECLARED_PyvtkAbstractCellLocator_ClassNew extern "C" { PyObject *PyvtkAbstractCellLocator_ClassNew(); } #define DECLARED_PyvtkAbstractCellLocator_ClassNew #endif static const char *PyvtkCellLocator_Doc = "vtkCellLocator - octree-based spatial search object to quickly locate\ncells\n\n" "Superclass: vtkAbstractCellLocator\n\n" "vtkCellLocator is a spatial search object to quickly locate cells in\n" "3D. vtkCellLocator uses a uniform-level octree subdivision, where\n" "each octant (an octant is also referred to as a bucket) carries an\n" "indication of whether it is empty or not, and each leaf octant\n" "carries a list of the cells inside of it. (An octant is not empty if\n" "it has one or more cells inside of it.) Typical operations are\n" "intersection with a line to return candidate cells, or intersection\n" "with another vtkCellLocator to return candidate cells.\n\n" "@warning\n" "Many other types of spatial locators have been developed, such as\n" "variable depth octrees and kd-trees. These are often more efficient\n" "for the operations described here. vtkCellLocator has been designed\n" "for subclassing; so these locators can be derived if necessary.\n\n" "@sa\n" "vtkLocator vtkPointLocator vtkOBBTree\n\n"; static PyObject * PyvtkCellLocator_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkCellLocator::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *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->vtkCellLocator::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkCellLocator *tempr = vtkCellLocator::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCellLocator_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkCellLocator *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkCellLocator::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 * PyvtkCellLocator_SetNumberOfCellsPerBucket(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetNumberOfCellsPerBucket"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetNumberOfCellsPerBucket(temp0); } else { op->vtkCellLocator::SetNumberOfCellsPerBucket(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_GetNumberOfCellsPerBucket(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetNumberOfCellsPerBucket"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetNumberOfCellsPerBucket() : op->vtkCellLocator::GetNumberOfCellsPerBucket()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IntersectWithLine_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; double temp2; double temp3; const int size4 = 3; double temp4[3]; double save4[3]; const int size5 = 3; double temp5[3]; double save5[3]; int temp6; vtkIdType temp7; vtkGenericCell *temp8 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(9) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2) && ap.GetValue(temp3) && ap.GetArray(temp4, size4) && ap.GetArray(temp5, size5) && ap.GetValue(temp6) && ap.GetValue(temp7) && ap.GetVTKObject(temp8, "vtkGenericCell")) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp4, save4, size4); ap.SaveArray(temp5, save5, size5); int tempr = (ap.IsBound() ? op->IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8) : op->vtkCellLocator::IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (ap.ArrayHasChanged(temp4, save4, size4) && !ap.ErrorOccurred()) { ap.SetArray(4, temp4, size4); } if (ap.ArrayHasChanged(temp5, save5, size5) && !ap.ErrorOccurred()) { ap.SetArray(5, temp5, size5); } if (!ap.ErrorOccurred()) { ap.SetArgValue(6, temp6); } if (!ap.ErrorOccurred()) { ap.SetArgValue(7, temp7); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IntersectWithLine_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; double temp2; double temp3; const int size4 = 3; double temp4[3]; double save4[3]; const int size5 = 3; double temp5[3]; double save5[3]; int temp6; PyObject *result = nullptr; if (op && ap.CheckArgCount(7) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2) && ap.GetValue(temp3) && ap.GetArray(temp4, size4) && ap.GetArray(temp5, size5) && ap.GetValue(temp6)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp4, save4, size4); ap.SaveArray(temp5, save5, size5); int tempr = (ap.IsBound() ? op->IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6) : op->vtkCellLocator::IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (ap.ArrayHasChanged(temp4, save4, size4) && !ap.ErrorOccurred()) { ap.SetArray(4, temp4, size4); } if (ap.ArrayHasChanged(temp5, save5, size5) && !ap.ErrorOccurred()) { ap.SetArray(5, temp5, size5); } if (!ap.ErrorOccurred()) { ap.SetArgValue(6, temp6); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IntersectWithLine_s3(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; double temp2; double temp3; const int size4 = 3; double temp4[3]; double save4[3]; const int size5 = 3; double temp5[3]; double save5[3]; int temp6; vtkIdType temp7; PyObject *result = nullptr; if (op && ap.CheckArgCount(8) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2) && ap.GetValue(temp3) && ap.GetArray(temp4, size4) && ap.GetArray(temp5, size5) && ap.GetValue(temp6) && ap.GetValue(temp7)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp4, save4, size4); ap.SaveArray(temp5, save5, size5); int tempr = (ap.IsBound() ? op->IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7) : op->vtkCellLocator::IntersectWithLine(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (ap.ArrayHasChanged(temp4, save4, size4) && !ap.ErrorOccurred()) { ap.SetArray(4, temp4, size4); } if (ap.ArrayHasChanged(temp5, save5, size5) && !ap.ErrorOccurred()) { ap.SetArray(5, temp5, size5); } if (!ap.ErrorOccurred()) { ap.SetArgValue(6, temp6); } if (!ap.ErrorOccurred()) { ap.SetArgValue(7, temp7); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IntersectWithLine_s4(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; const int size1 = 3; double temp1[3]; vtkPoints *temp2 = nullptr; vtkIdList *temp3 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(4) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetVTKObject(temp2, "vtkPoints") && ap.GetVTKObject(temp3, "vtkIdList")) { int tempr = (ap.IsBound() ? op->IntersectWithLine(temp0, temp1, temp2, temp3) : op->vtkCellLocator::IntersectWithLine(temp0, temp1, temp2, temp3)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_IntersectWithLine(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 9: return PyvtkCellLocator_IntersectWithLine_s1(self, args); case 7: return PyvtkCellLocator_IntersectWithLine_s2(self, args); case 8: return PyvtkCellLocator_IntersectWithLine_s3(self, args); case 4: return PyvtkCellLocator_IntersectWithLine_s4(self, args); } vtkPythonArgs::ArgCountError(nargs, "IntersectWithLine"); return nullptr; } static PyObject * PyvtkCellLocator_FindClosestPoint_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPoint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; vtkGenericCell *temp2 = nullptr; vtkIdType temp3; int temp4; double temp5; PyObject *result = nullptr; if (op && ap.CheckArgCount(6) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetVTKObject(temp2, "vtkGenericCell") && ap.GetValue(temp3) && ap.GetValue(temp4) && ap.GetValue(temp5)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->FindClosestPoint(temp0, temp1, temp2, temp3, temp4, temp5); } else { op->vtkCellLocator::FindClosestPoint(temp0, temp1, temp2, temp3, temp4, temp5); } if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (!ap.ErrorOccurred()) { ap.SetArgValue(4, temp4); } if (!ap.ErrorOccurred()) { ap.SetArgValue(5, temp5); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_FindClosestPoint_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPoint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; vtkIdType temp2; int temp3; double temp4; PyObject *result = nullptr; if (op && ap.CheckArgCount(5) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2) && ap.GetValue(temp3) && ap.GetValue(temp4)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->FindClosestPoint(temp0, temp1, temp2, temp3, temp4); } else { op->vtkCellLocator::FindClosestPoint(temp0, temp1, temp2, temp3, temp4); } if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { ap.SetArgValue(2, temp2); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (!ap.ErrorOccurred()) { ap.SetArgValue(4, temp4); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_FindClosestPoint(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 6: return PyvtkCellLocator_FindClosestPoint_s1(self, args); case 5: return PyvtkCellLocator_FindClosestPoint_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "FindClosestPoint"); return nullptr; } static PyObject * PyvtkCellLocator_FindClosestPointWithinRadius_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPointWithinRadius"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; double temp1; const int size2 = 3; double temp2[3]; double save2[3]; vtkGenericCell *temp3 = nullptr; vtkIdType temp4; int temp5; double temp6; int temp7; PyObject *result = nullptr; if (op && ap.CheckArgCount(8) && ap.GetArray(temp0, size0) && ap.GetValue(temp1) && ap.GetArray(temp2, size2) && ap.GetVTKObject(temp3, "vtkGenericCell") && ap.GetValue(temp4) && ap.GetValue(temp5) && ap.GetValue(temp6) && ap.GetValue(temp7)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp2, save2, size2); vtkIdType tempr = (ap.IsBound() ? op->FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7) : op->vtkCellLocator::FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } if (!ap.ErrorOccurred()) { ap.SetArgValue(4, temp4); } if (!ap.ErrorOccurred()) { ap.SetArgValue(5, temp5); } if (!ap.ErrorOccurred()) { ap.SetArgValue(6, temp6); } if (!ap.ErrorOccurred()) { ap.SetArgValue(7, temp7); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_FindClosestPointWithinRadius_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPointWithinRadius"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; double temp1; const int size2 = 3; double temp2[3]; double save2[3]; vtkIdType temp3; int temp4; double temp5; PyObject *result = nullptr; if (op && ap.CheckArgCount(6) && ap.GetArray(temp0, size0) && ap.GetValue(temp1) && ap.GetArray(temp2, size2) && ap.GetValue(temp3) && ap.GetValue(temp4) && ap.GetValue(temp5)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp2, save2, size2); vtkIdType tempr = (ap.IsBound() ? op->FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5) : op->vtkCellLocator::FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } if (!ap.ErrorOccurred()) { ap.SetArgValue(3, temp3); } if (!ap.ErrorOccurred()) { ap.SetArgValue(4, temp4); } if (!ap.ErrorOccurred()) { ap.SetArgValue(5, temp5); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_FindClosestPointWithinRadius_s3(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindClosestPointWithinRadius"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; double temp1; const int size2 = 3; double temp2[3]; double save2[3]; vtkGenericCell *temp3 = nullptr; vtkIdType temp4; int temp5; double temp6; PyObject *result = nullptr; if (op && ap.CheckArgCount(7) && ap.GetArray(temp0, size0) && ap.GetValue(temp1) && ap.GetArray(temp2, size2) && ap.GetVTKObject(temp3, "vtkGenericCell") && ap.GetValue(temp4) && ap.GetValue(temp5) && ap.GetValue(temp6)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp2, save2, size2); vtkIdType tempr = (ap.IsBound() ? op->FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5, temp6) : op->vtkCellLocator::FindClosestPointWithinRadius(temp0, temp1, temp2, temp3, temp4, temp5, temp6)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } if (!ap.ErrorOccurred()) { ap.SetArgValue(4, temp4); } if (!ap.ErrorOccurred()) { ap.SetArgValue(5, temp5); } if (!ap.ErrorOccurred()) { ap.SetArgValue(6, temp6); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_FindClosestPointWithinRadius(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 8: return PyvtkCellLocator_FindClosestPointWithinRadius_s1(self, args); case 6: return PyvtkCellLocator_FindClosestPointWithinRadius_s2(self, args); case 7: return PyvtkCellLocator_FindClosestPointWithinRadius_s3(self, args); } vtkPythonArgs::ArgCountError(nargs, "FindClosestPointWithinRadius"); return nullptr; } static PyObject * PyvtkCellLocator_GetCells(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetCells"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { vtkIdList *tempr = (ap.IsBound() ? op->GetCells(temp0) : op->vtkCellLocator::GetCells(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCellLocator_GetNumberOfBuckets(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetNumberOfBuckets"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetNumberOfBuckets() : op->vtkCellLocator::GetNumberOfBuckets()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_FindCell_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindCell"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; double temp1; vtkGenericCell *temp2 = nullptr; const int size3 = 3; double temp3[3]; double save3[3]; int size4 = ap.GetArgSize(4); vtkPythonArgs::Array store4(2*size4); double *temp4 = store4.Data(); double *save4 = (size4 == 0 ? nullptr : temp4 + size4); PyObject *result = nullptr; if (op && ap.CheckArgCount(5) && ap.GetArray(temp0, size0) && ap.GetValue(temp1) && ap.GetVTKObject(temp2, "vtkGenericCell") && ap.GetArray(temp3, size3) && ap.GetArray(temp4, size4)) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp3, save3, size3); ap.SaveArray(temp4, save4, size4); vtkIdType tempr = (ap.IsBound() ? op->FindCell(temp0, temp1, temp2, temp3, temp4) : op->vtkCellLocator::FindCell(temp0, temp1, temp2, temp3, temp4)); if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp3, save3, size3) && !ap.ErrorOccurred()) { ap.SetArray(3, temp3, size3); } if (ap.ArrayHasChanged(temp4, save4, size4) && !ap.ErrorOccurred()) { ap.SetArray(4, temp4, size4); } if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCellLocator_FindCell_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindCell"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { ap.SaveArray(temp0, save0, size0); vtkIdType tempr = (ap.IsBound() ? op->FindCell(temp0) : op->vtkCellLocator::FindCell(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 * PyvtkCellLocator_FindCell(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 5: return PyvtkCellLocator_FindCell_s1(self, args); case 1: return PyvtkCellLocator_FindCell_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "FindCell"); return nullptr; } static PyObject * PyvtkCellLocator_FindCellsWithinBounds(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindCellsWithinBounds"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); int size0 = ap.GetArgSize(0); vtkPythonArgs::Array store0(2*size0); double *temp0 = store0.Data(); double *save0 = (size0 == 0 ? nullptr : temp0 + size0); vtkIdList *temp1 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetArray(temp0, size0) && ap.GetVTKObject(temp1, "vtkIdList")) { ap.SaveArray(temp0, save0, size0); if (ap.IsBound()) { op->FindCellsWithinBounds(temp0, temp1); } else { op->vtkCellLocator::FindCellsWithinBounds(temp0, temp1); } if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_FindCellsAlongLine(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FindCellsAlongLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[3]; const int size1 = 3; double temp1[3]; double save1[3]; double temp2; vtkIdList *temp3 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(4) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetValue(temp2) && ap.GetVTKObject(temp3, "vtkIdList")) { ap.SaveArray(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->FindCellsAlongLine(temp0, temp1, temp2, temp3); } else { op->vtkCellLocator::FindCellsAlongLine(temp0, temp1, temp2, temp3); } if (ap.ArrayHasChanged(temp0, save0, size0) && !ap.ErrorOccurred()) { ap.SetArray(0, temp0, size0); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_FreeSearchStructure(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FreeSearchStructure"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->FreeSearchStructure(); } else { op->vtkCellLocator::FreeSearchStructure(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_BuildLocator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BuildLocator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BuildLocator(); } else { op->vtkCellLocator::BuildLocator(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_BuildLocatorIfNeeded(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BuildLocatorIfNeeded"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BuildLocatorIfNeeded(); } else { op->vtkCellLocator::BuildLocatorIfNeeded(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_ForceBuildLocator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ForceBuildLocator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->ForceBuildLocator(); } else { op->vtkCellLocator::ForceBuildLocator(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_BuildLocatorInternal(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BuildLocatorInternal"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BuildLocatorInternal(); } else { op->vtkCellLocator::BuildLocatorInternal(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCellLocator_GenerateRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GenerateRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCellLocator *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->vtkCellLocator::GenerateRepresentation(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkCellLocator_Methods[] = { {"IsTypeOf", PyvtkCellLocator_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nStandard type and print methods.\n"}, {"IsA", PyvtkCellLocator_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nStandard type and print methods.\n"}, {"SafeDownCast", PyvtkCellLocator_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkCellLocator\nC++: static vtkCellLocator *SafeDownCast(vtkObjectBase *o)\n\nStandard type and print methods.\n"}, {"NewInstance", PyvtkCellLocator_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkCellLocator\nC++: vtkCellLocator *NewInstance()\n\nStandard type and print methods.\n"}, {"SetNumberOfCellsPerBucket", PyvtkCellLocator_SetNumberOfCellsPerBucket, METH_VARARGS, "V.SetNumberOfCellsPerBucket(int)\nC++: void SetNumberOfCellsPerBucket(int N)\n\nSpecify the average number of cells in each octant.\n"}, {"GetNumberOfCellsPerBucket", PyvtkCellLocator_GetNumberOfCellsPerBucket, METH_VARARGS, "V.GetNumberOfCellsPerBucket() -> int\nC++: int GetNumberOfCellsPerBucket()\n\n"}, {"IntersectWithLine", PyvtkCellLocator_IntersectWithLine, METH_VARARGS, "V.IntersectWithLine([float, float, float], [float, float, float],\n float, float, [float, float, float], [float, float, float],\n int, int, vtkGenericCell) -> int\nC++: int IntersectWithLine(double a0[3], double a1[3], double tol,\n double &t, double x[3], double pcoords[3], int &subId,\n vtkIdType &cellId, vtkGenericCell *cell) override;\nV.IntersectWithLine([float, float, float], [float, float, float],\n float, float, [float, float, float], [float, float, float],\n int) -> int\nC++: virtual int IntersectWithLine(double p1[3], double p2[3],\n double tol, double &t, double x[3], double pcoords[3],\n int &subId)\nV.IntersectWithLine([float, float, float], [float, float, float],\n float, float, [float, float, float], [float, float, float],\n int, int) -> int\nC++: virtual int IntersectWithLine(double p1[3], double p2[3],\n double tol, double &t, double x[3], double pcoords[3],\n int &subId, vtkIdType &cellId)\nV.IntersectWithLine((float, float, float), (float, float, float),\n vtkPoints, vtkIdList) -> int\nC++: virtual int IntersectWithLine(const double p1[3],\n const double p2[3], vtkPoints *points, vtkIdList *cellIds)\n\nReturn intersection point (if any) AND the cell which was\nintersected by the finite line. The cell is returned as a cell id\nand as a generic cell. For other IntersectWithLine signatures,\nsee vtkAbstractCellLocator\n"}, {"FindClosestPoint", PyvtkCellLocator_FindClosestPoint, METH_VARARGS, "V.FindClosestPoint([float, float, float], [float, float, float],\n vtkGenericCell, int, int, float)\nC++: void FindClosestPoint(double x[3], double closestPoint[3],\n vtkGenericCell *cell, vtkIdType &cellId, int &subId,\n double &dist2) override;\nV.FindClosestPoint([float, float, float], [float, float, float],\n int, int, float)\nC++: virtual void FindClosestPoint(double x[3],\n double closestPoint[3], vtkIdType &cellId, int &subId,\n double &dist2)\n\nReturn the closest point and the cell which is closest to the\npoint x. The closest point is somewhere on a cell, it need not be\none of the vertices of the cell. This version takes in a\nvtkGenericCell to avoid allocating and deallocating the cell. \nThis is much faster than the version which does not take a *cell,\nespecially when this function is called many times in a row such\nas by a for loop, where the allocation and deallocation can be\ndone only once outside the for loop. If a cell is found, \"cell\"\ncontains the points and ptIds for the cell \"cellId\" upon exit.\n"}, {"FindClosestPointWithinRadius", PyvtkCellLocator_FindClosestPointWithinRadius, METH_VARARGS, "V.FindClosestPointWithinRadius([float, float, float], float,\n [float, float, float], vtkGenericCell, int, int, float, int)\n -> int\nC++: vtkIdType FindClosestPointWithinRadius(double x[3],\n double radius, double closestPoint[3], vtkGenericCell *cell,\n vtkIdType &cellId, int &subId, double &dist2, int &inside)\n override;\nV.FindClosestPointWithinRadius([float, float, float], float,\n [float, float, float], int, int, float) -> int\nC++: virtual vtkIdType FindClosestPointWithinRadius(double x[3],\n double radius, double closestPoint[3], vtkIdType &cellId,\n int &subId, double &dist2)\nV.FindClosestPointWithinRadius([float, float, float], float,\n [float, float, float], vtkGenericCell, int, int, float) -> int\nC++: virtual vtkIdType FindClosestPointWithinRadius(double x[3],\n double radius, double closestPoint[3], vtkGenericCell *cell,\n vtkIdType &cellId, int &subId, double &dist2)\n\nReturn the closest point within a specified radius and the cell\nwhich is closest to the point x. The closest point is somewhere\non a cell, it need not be one of the vertices of the cell. This\nmethod returns 1 if a point is found within the specified radius.\nIf there are no cells within the specified radius, the method\nreturns 0 and the values of closestPoint, cellId, subId, and\ndist2 are undefined. This version takes in a vtkGenericCell to\navoid allocating and deallocating the cell. This is much faster\nthan the version which does not take a *cell, especially when\nthis function is called many times in a row such as by a for\nloop, where the allocation and dealloction can be done only once\noutside the for loop. If a closest point is found, \"cell\"\ncontains the points and ptIds for the cell \"cellId\" upon exit. \nIf a closest point is found, inside returns the return value of\nthe EvaluatePosition call to the closest cell; inside(=1) or\noutside(=0). For other FindClosestPointWithinRadius signatures,\nsee vtkAbstractCellLocator\n"}, {"GetCells", PyvtkCellLocator_GetCells, METH_VARARGS, "V.GetCells(int) -> vtkIdList\nC++: virtual vtkIdList *GetCells(int bucket)\n\nGet the cells in a particular bucket.\n"}, {"GetNumberOfBuckets", PyvtkCellLocator_GetNumberOfBuckets, METH_VARARGS, "V.GetNumberOfBuckets() -> int\nC++: virtual int GetNumberOfBuckets(void)\n\nReturn number of buckets available. Insure that the locator has\nbeen built before attempting to access buckets (octants).\n"}, {"FindCell", PyvtkCellLocator_FindCell, METH_VARARGS, "V.FindCell([float, float, float], float, vtkGenericCell, [float,\n float, float], [float, ...]) -> int\nC++: vtkIdType FindCell(double x[3], double tol2,\n vtkGenericCell *GenCell, double pcoords[3], double *weights)\n override;\nV.FindCell([float, float, float]) -> int\nC++: virtual vtkIdType FindCell(double x[3])\n\nFind the cell containing a given point. returns -1 if no cell\nfound the cell parameters are copied into the supplied variables,\na cell must be provided to store the information.\n"}, {"FindCellsWithinBounds", PyvtkCellLocator_FindCellsWithinBounds, METH_VARARGS, "V.FindCellsWithinBounds([float, ...], vtkIdList)\nC++: void FindCellsWithinBounds(double *bbox, vtkIdList *cells)\n override;\n\nReturn a list of unique cell ids inside of a given bounding box.\nThe user must provide the vtkIdList to populate. This method\nreturns data only after the locator has been built.\n"}, {"FindCellsAlongLine", PyvtkCellLocator_FindCellsAlongLine, METH_VARARGS, "V.FindCellsAlongLine([float, float, float], [float, float, float],\n float, vtkIdList)\nC++: void FindCellsAlongLine(double p1[3], double p2[3],\n double tolerance, vtkIdList *cells) override;\n\nGiven a finite line defined by the two points (p1,p2), return the\nlist of unique cell ids in the buckets containing the line. It is\npossible that an empty cell list is returned. The user must\nprovide the vtkIdList to populate. This method returns data only\nafter the locator has been built.\n"}, {"FreeSearchStructure", PyvtkCellLocator_FreeSearchStructure, METH_VARARGS, "V.FreeSearchStructure()\nC++: void FreeSearchStructure() override;\n\nSatisfy vtkLocator abstract interface.\n"}, {"BuildLocator", PyvtkCellLocator_BuildLocator, METH_VARARGS, "V.BuildLocator()\nC++: void BuildLocator() override;\n\nSatisfy vtkLocator abstract interface.\n"}, {"BuildLocatorIfNeeded", PyvtkCellLocator_BuildLocatorIfNeeded, METH_VARARGS, "V.BuildLocatorIfNeeded()\nC++: virtual void BuildLocatorIfNeeded()\n\nSatisfy vtkLocator abstract interface.\n"}, {"ForceBuildLocator", PyvtkCellLocator_ForceBuildLocator, METH_VARARGS, "V.ForceBuildLocator()\nC++: virtual void ForceBuildLocator()\n\nSatisfy vtkLocator abstract interface.\n"}, {"BuildLocatorInternal", PyvtkCellLocator_BuildLocatorInternal, METH_VARARGS, "V.BuildLocatorInternal()\nC++: virtual void BuildLocatorInternal()\n\nSatisfy vtkLocator abstract interface.\n"}, {"GenerateRepresentation", PyvtkCellLocator_GenerateRepresentation, METH_VARARGS, "V.GenerateRepresentation(int, vtkPolyData)\nC++: void GenerateRepresentation(int level, vtkPolyData *pd)\n override;\n\nSatisfy vtkLocator abstract interface.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkCellLocator_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkCommonDataModelPython.vtkCellLocator", // 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 PyvtkCellLocator_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 *PyvtkCellLocator_StaticNew() { return vtkCellLocator::New(); } PyObject *PyvtkCellLocator_ClassNew() { PyVTKClass_Add( &PyvtkCellLocator_Type, PyvtkCellLocator_Methods, "vtkCellLocator", &PyvtkCellLocator_StaticNew); PyTypeObject *pytype = &PyvtkCellLocator_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 *)PyvtkAbstractCellLocator_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkCellLocator( PyObject *dict) { PyObject *o; o = PyvtkCellLocator_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkCellLocator", o) != 0) { Py_DECREF(o); } }