// python wrapper for vtkOBBTree // #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 "vtkOBBTree.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkOBBTree(PyObject *); } static const char *PyvtkOBBNode_Doc = "vtkOBBNode - no description provided.\n\n" "vtkOBBNode()\n"; static PyObject * PyvtkOBBNode_DebugPrintTree(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "DebugPrintTree"); void *vp = ap.GetSelfSpecialPointer(self, args); vtkOBBNode *op = static_cast(vp); int temp0; int size1 = ap.GetArgSize(1); vtkPythonArgs::Array store1(2*size1); double *temp1 = store1.Data(); double *save1 = (size1 == 0 ? nullptr : temp1 + size1); int size2 = ap.GetArgSize(2); vtkPythonArgs::Array store2(2*size2); int *temp2 = store2.Data(); int *save2 = (size2 == 0 ? nullptr : temp2 + size2); int size3 = ap.GetArgSize(3); vtkPythonArgs::Array store3(2*size3); int *temp3 = store3.Data(); int *save3 = (size3 == 0 ? nullptr : temp3 + size3); PyObject *result = nullptr; if (op && ap.CheckArgCount(4) && ap.GetValue(temp0) && ap.GetArray(temp1, size1) && ap.GetArray(temp2, size2) && ap.GetArray(temp3, size3)) { ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp2, save2, size2); ap.SaveArray(temp3, save3, size3); op->DebugPrintTree(temp0, temp1, temp2, temp3); if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } if (ap.ArrayHasChanged(temp3, save3, size3) && !ap.ErrorOccurred()) { ap.SetArray(3, temp3, size3); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkOBBNode_Methods[] = { {"DebugPrintTree", PyvtkOBBNode_DebugPrintTree, METH_VARARGS, "V.DebugPrintTree(int, [float, ...], [int, ...], [int, ...])\nC++: void DebugPrintTree(int level, double *leaf_vol,\n int *minCells, int *maxCells)\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyObject * PyvtkOBBNode_vtkOBBNode(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "vtkOBBNode"); PyObject *result = nullptr; if (ap.CheckArgCount(0)) { vtkOBBNode *op = new vtkOBBNode(); result = PyVTKSpecialObject_New("vtkOBBNode", op); } return result; } static PyMethodDef PyvtkOBBNode_vtkOBBNode_Methods[] = { {nullptr, nullptr, 0, nullptr} }; static PyObject * PyvtkOBBNode_New(PyTypeObject *, PyObject *args, PyObject *kwds) { if (kwds && PyDict_Size(kwds)) { PyErr_SetString(PyExc_TypeError, "this function takes no keyword arguments"); return nullptr; } return PyvtkOBBNode_vtkOBBNode(nullptr, args); } static void PyvtkOBBNode_Delete(PyObject *self) { PyVTKSpecialObject *obj = (PyVTKSpecialObject *)self; delete static_cast(obj->vtk_ptr); PyObject_Del(self); } static Py_hash_t PyvtkOBBNode_Hash(PyObject *self) { #if PY_VERSION_HEX >= 0x020600B2 return PyObject_HashNotImplemented(self); #else char text[256]; sprintf(text, "unhashable type: '%s'", Py_TYPE(self)->tp_name); PyErr_SetString(PyExc_TypeError, text); return -1; #endif } static PyTypeObject PyvtkOBBNode_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkFiltersGeneralPython.vtkOBBNode", // tp_name sizeof(PyVTKSpecialObject), // tp_basicsize 0, // tp_itemsize PyvtkOBBNode_Delete, // tp_dealloc 0, // tp_print nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare PyVTKSpecialObject_Repr, // tp_repr nullptr, // tp_as_number nullptr, // tp_as_sequence nullptr, // tp_as_mapping PyvtkOBBNode_Hash, // tp_hash nullptr, // tp_call nullptr, // tp_str PyObject_GenericGetAttr, // tp_getattro nullptr, // tp_setattro nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags PyvtkOBBNode_Doc, // tp_doc nullptr, // tp_traverse nullptr, // tp_clear nullptr, // tp_richcompare 0, // tp_weaklistoffset nullptr, // tp_iter nullptr, // tp_iternext nullptr, // tp_methods nullptr, // tp_members nullptr, // tp_getset nullptr, // tp_base nullptr, // tp_dict nullptr, // tp_descr_get nullptr, // tp_descr_set 0, // tp_dictoffset nullptr, // tp_init nullptr, // tp_alloc PyvtkOBBNode_New, // tp_new PyObject_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 }; extern "C" { VTK_ABI_EXPORT PyObject *PyvtkOBBNode_TypeNew(); } PyObject *PyvtkOBBNode_TypeNew() { PyVTKSpecialType_Add( &PyvtkOBBNode_Type, PyvtkOBBNode_Methods, PyvtkOBBNode_vtkOBBNode_Methods, nullptr); PyTypeObject *pytype = &PyvtkOBBNode_Type; if ((pytype->tp_flags & Py_TPFLAGS_READY) != 0) { return (PyObject *)pytype; } PyType_Ready(pytype); return (PyObject *)pytype; } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkOBBTree_ClassNew(); } #ifndef DECLARED_PyvtkAbstractCellLocator_ClassNew extern "C" { PyObject *PyvtkAbstractCellLocator_ClassNew(); } #define DECLARED_PyvtkAbstractCellLocator_ClassNew #endif static const char *PyvtkOBBTree_Doc = "vtkOBBTree - generate oriented bounding box (OBB) tree\n\n" "Superclass: vtkAbstractCellLocator\n\n" "vtkOBBTree is an object to generate oriented bounding box (OBB)\n" "trees. An oriented bounding box is a bounding box that does not\n" "necessarily line up along coordinate axes. The OBB tree is a\n" "hierarchical tree structure of such boxes, where deeper levels of OBB\n" "confine smaller regions of space.\n\n" "To build the OBB, a recursive, top-down process is used. First, the\n" "root OBB is constructed by finding the mean and covariance matrix of\n" "the cells (and their points) that define the dataset. The\n" "eigenvectors of the covariance matrix are extracted, giving a set of\n" "three orthogonal vectors that define the tightest-fitting OBB. To\n" "create the two children OBB's, a split plane is found that\n" "(approximately) divides the number cells in half. These are then\n" "assigned to the children OBB's. This process then continues until the\n" "MaxLevel ivar limits the recursion, or no split plane can be found.\n\n" "A good reference for OBB-trees is Gottschalk & Manocha in Proceedings\n" "of Siggraph `96.\n\n" "@warning\n" "Since this algorithms works from a list of cells, the OBB tree will\n" "only bound the \"geometry\" attached to the cells if the convex hull of\n" "the cells bounds the geometry.\n\n" "@warning\n" "Long, skinny cells (i.e., cells with poor aspect ratio) may cause\n" "unsatisfactory results. This is due to the fact that this is a\n" "top-down implementation of the OBB tree, requiring that one or more\n" "complete cells are contained in each OBB. This requirement makes it\n" "hard to find good split planes during the recursion process. A\n" "bottom-up implementation would go a long way to correcting this\n" "problem.\n\n" "@sa\n" "vtkLocator vtkCellLocator vtkPointLocator\n\n"; static PyObject * PyvtkOBBTree_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkOBBTree::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkOBBTree_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkOBBTree_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkOBBTree *tempr = vtkOBBTree::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkOBBTree_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkOBBTree *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkOBBTree::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 * PyvtkOBBTree_IntersectWithLine_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::IntersectWithLine(temp0, temp1, temp2, temp3)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkOBBTree_IntersectWithLine_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::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 * PyvtkOBBTree_IntersectWithLine_s3(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::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 * PyvtkOBBTree_IntersectWithLine_s4(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IntersectWithLine"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::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 * PyvtkOBBTree_IntersectWithLine(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 4: return PyvtkOBBTree_IntersectWithLine_s1(self, args); case 9: return PyvtkOBBTree_IntersectWithLine_s2(self, args); case 7: return PyvtkOBBTree_IntersectWithLine_s3(self, args); case 8: return PyvtkOBBTree_IntersectWithLine_s4(self, args); } vtkPythonArgs::ArgCountError(nargs, "IntersectWithLine"); return nullptr; } static PyObject * PyvtkOBBTree_ComputeOBB_s1(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "ComputeOBB"); vtkPoints *temp0 = nullptr; const int size1 = 3; double temp1[3]; double save1[3]; const int size2 = 3; double temp2[3]; double save2[3]; const int size3 = 3; double temp3[3]; double save3[3]; const int size4 = 3; double temp4[3]; double save4[3]; const int size5 = 3; double temp5[3]; double save5[3]; PyObject *result = nullptr; if (ap.CheckArgCount(6) && ap.GetVTKObject(temp0, "vtkPoints") && ap.GetArray(temp1, size1) && ap.GetArray(temp2, size2) && ap.GetArray(temp3, size3) && ap.GetArray(temp4, size4) && ap.GetArray(temp5, size5)) { ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp2, save2, size2); ap.SaveArray(temp3, save3, size3); ap.SaveArray(temp4, save4, size4); ap.SaveArray(temp5, save5, size5); vtkOBBTree::ComputeOBB(temp0, temp1, temp2, temp3, temp4, temp5); if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } 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.ArrayHasChanged(temp5, save5, size5) && !ap.ErrorOccurred()) { ap.SetArray(5, temp5, size5); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkOBBTree_ComputeOBB_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "ComputeOBB"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *op = static_cast(vp); vtkDataSet *temp0 = nullptr; const int size1 = 3; double temp1[3]; double save1[3]; const int size2 = 3; double temp2[3]; double save2[3]; const int size3 = 3; double temp3[3]; double save3[3]; const int size4 = 3; double temp4[3]; double save4[3]; const int size5 = 3; double temp5[3]; double save5[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(6) && ap.GetVTKObject(temp0, "vtkDataSet") && ap.GetArray(temp1, size1) && ap.GetArray(temp2, size2) && ap.GetArray(temp3, size3) && ap.GetArray(temp4, size4) && ap.GetArray(temp5, size5)) { ap.SaveArray(temp1, save1, size1); ap.SaveArray(temp2, save2, size2); ap.SaveArray(temp3, save3, size3); ap.SaveArray(temp4, save4, size4); ap.SaveArray(temp5, save5, size5); if (ap.IsBound()) { op->ComputeOBB(temp0, temp1, temp2, temp3, temp4, temp5); } else { op->vtkOBBTree::ComputeOBB(temp0, temp1, temp2, temp3, temp4, temp5); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (ap.ArrayHasChanged(temp2, save2, size2) && !ap.ErrorOccurred()) { ap.SetArray(2, temp2, size2); } 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.ArrayHasChanged(temp5, save5, size5) && !ap.ErrorOccurred()) { ap.SetArray(5, temp5, size5); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkOBBTree_ComputeOBB_Methods[] = { {nullptr, PyvtkOBBTree_ComputeOBB_s1, METH_VARARGS | METH_STATIC, "VPPPPP *vtkPoints *d *d *d *d *d"}, {nullptr, PyvtkOBBTree_ComputeOBB_s2, METH_VARARGS, "@VPPPPP *vtkDataSet *d *d *d *d *d"}, {nullptr, nullptr, 0, nullptr} }; static PyObject * PyvtkOBBTree_ComputeOBB(PyObject *self, PyObject *args) { PyMethodDef *methods = PyvtkOBBTree_ComputeOBB_Methods; int nargs = vtkPythonArgs::GetArgCount(args); switch(nargs) { case 7: return PyvtkOBBTree_ComputeOBB_s2(self, args); case 6: return vtkPythonOverload::CallMethod(methods, self, args); } vtkPythonArgs::ArgCountError(nargs, "ComputeOBB"); return nullptr; } static PyObject * PyvtkOBBTree_InsideOrOutside(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "InsideOrOutside"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *op = static_cast(vp); const int size0 = 3; double temp0[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { int tempr = (ap.IsBound() ? op->InsideOrOutside(temp0) : op->vtkOBBTree::InsideOrOutside(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkOBBTree_FreeSearchStructure(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "FreeSearchStructure"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->FreeSearchStructure(); } else { op->vtkOBBTree::FreeSearchStructure(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkOBBTree_BuildLocator(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BuildLocator"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BuildLocator(); } else { op->vtkOBBTree::BuildLocator(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkOBBTree_GenerateRepresentation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GenerateRepresentation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkOBBTree *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->vtkOBBTree::GenerateRepresentation(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkOBBTree_Methods[] = { {"IsTypeOf", PyvtkOBBTree_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nStandard type and print methods.\n"}, {"IsA", PyvtkOBBTree_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nStandard type and print methods.\n"}, {"SafeDownCast", PyvtkOBBTree_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkOBBTree\nC++: static vtkOBBTree *SafeDownCast(vtkObjectBase *o)\n\nStandard type and print methods.\n"}, {"NewInstance", PyvtkOBBTree_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkOBBTree\nC++: vtkOBBTree *NewInstance()\n\nStandard type and print methods.\n"}, {"IntersectWithLine", PyvtkOBBTree_IntersectWithLine, METH_VARARGS, "V.IntersectWithLine((float, float, float), (float, float, float),\n vtkPoints, vtkIdList) -> int\nC++: int IntersectWithLine(const double a0[3], const double a1[3],\n vtkPoints *points, vtkIdList *cellIds) override;\nV.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)\n\nTake the passed line segment and intersect it with the data set.\nThis method assumes that the data set is a vtkPolyData that\ndescribes a closed surface, and the intersection points that are\nreturned in 'points' alternate between entrance points and exit\npoints. The return value of the function is 0 if no intersections\nwere found,\n-1 if point 'a0' lies inside the closed surface, or +1 if point\n 'a0' lies outside the closed surface. Either 'points' or\n 'cellIds' can be set to nullptr if you don't want to receive\n that information.\n"}, {"ComputeOBB", PyvtkOBBTree_ComputeOBB, METH_VARARGS, "V.ComputeOBB(vtkPoints, [float, float, float], [float, float,\n float], [float, float, float], [float, float, float], [float,\n float, float])\nC++: static void ComputeOBB(vtkPoints *pts, double corner[3],\n double max[3], double mid[3], double min[3], double size[3])\nV.ComputeOBB(vtkDataSet, [float, float, float], [float, float,\n float], [float, float, float], [float, float, float], [float,\n float, float])\nC++: void ComputeOBB(vtkDataSet *input, double corner[3],\n double max[3], double mid[3], double min[3], double size[3])\n\nCompute an OBB from the list of points given. Return the corner\npoint and the three axes defining the orientation of the OBB.\nAlso return a sorted list of relative \"sizes\" of axes for\ncomparison purposes.\n"}, {"InsideOrOutside", PyvtkOBBTree_InsideOrOutside, METH_VARARGS, "V.InsideOrOutside((float, float, float)) -> int\nC++: int InsideOrOutside(const double point[3])\n\nDetermine whether a point is inside or outside the data used to\nbuild this OBB tree. The data must be a closed surface\nvtkPolyData data set. The return value is +1 if outside, -1 if\ninside, and 0 if undecided.\n"}, {"FreeSearchStructure", PyvtkOBBTree_FreeSearchStructure, METH_VARARGS, "V.FreeSearchStructure()\nC++: void FreeSearchStructure() override;\n\nSatisfy locator's abstract interface, see vtkLocator.\n"}, {"BuildLocator", PyvtkOBBTree_BuildLocator, METH_VARARGS, "V.BuildLocator()\nC++: void BuildLocator() override;\n\nSatisfy locator's abstract interface, see vtkLocator.\n"}, {"GenerateRepresentation", PyvtkOBBTree_GenerateRepresentation, METH_VARARGS, "V.GenerateRepresentation(int, vtkPolyData)\nC++: void GenerateRepresentation(int level, vtkPolyData *pd)\n override;\n\nCreate polygonal representation for OBB tree at specified level.\nIf level < 0, then the leaf OBB nodes will be gathered. The\naspect ratio (ar) and line diameter (d) are used to control the\nbuilding of the representation. If a OBB node edge ratio's are\ngreater than ar, then the dimension of the OBB is collapsed\n(OBB->plane->line). A \"line\" OBB will be represented either as\ntwo crossed polygons, or as a line, depending on the relative\ndiameter of the OBB compared to the diameter (d).\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkOBBTree_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkFiltersGeneralPython.vtkOBBTree", // 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 PyvtkOBBTree_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 *PyvtkOBBTree_StaticNew() { return vtkOBBTree::New(); } PyObject *PyvtkOBBTree_ClassNew() { PyVTKClass_Add( &PyvtkOBBTree_Type, PyvtkOBBTree_Methods, "vtkOBBTree", &PyvtkOBBTree_StaticNew); PyTypeObject *pytype = &PyvtkOBBTree_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_vtkOBBTree( PyObject *dict) { PyObject *o; o = PyvtkOBBNode_TypeNew(); if (o && PyDict_SetItemString(dict, "vtkOBBNode", o) != 0) { Py_DECREF(o); } o = PyvtkOBBTree_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkOBBTree", o) != 0) { Py_DECREF(o); } }