// python wrapper for vtkRowQuery // #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 "vtkRowQuery.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkRowQuery(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkRowQuery_ClassNew(); } #ifndef DECLARED_PyvtkObject_ClassNew extern "C" { PyObject *PyvtkObject_ClassNew(); } #define DECLARED_PyvtkObject_ClassNew #endif static const char *PyvtkRowQuery_Doc = "vtkRowQuery - abstract interface for queries that return row-oriented\nresults.\n\n" "Superclass: vtkObject\n\n" "The abstract superclass of query classes that return row-oriented\n" "(table) results. A subclass will provide database-specific query\n" "parameters and implement the vtkRowQuery API to return query results:\n\n" "Execute() - Execute the query. No results need to be retrieved at\n" "this\n" " point, unless you are performing caching.\n\n" "GetNumberOfFields() - After Execute() is performed, returns the\n" "number\n" " of fields in the query results.\n\n" "GetFieldName() - The name of the field at an index.\n\n" "GetFieldType() - The data type of the field at an index.\n\n" "NextRow() - Advances the query results by one row, and returns\n" "whether\n" " there are more rows left in the query.\n\n" "DataValue() - Extract a single data value from the current row.\n\n" "@par Thanks: Thanks to Andrew Wilson from Sandia National\n" "Laboratories for his work on the database classes.\n\n" "@sa\n" "vtkRowQueryToTable\n\n"; static PyObject * PyvtkRowQuery_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkRowQuery::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *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->vtkRowQuery::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkRowQuery *tempr = vtkRowQuery::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkRowQuery_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkRowQuery *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkRowQuery::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 * PyvtkRowQuery_Execute(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Execute"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { bool tempr = op->Execute(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_GetNumberOfFields(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetNumberOfFields"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { int tempr = op->GetNumberOfFields(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_GetFieldName(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetFieldName"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(1) && ap.GetValue(temp0)) { const char *tempr = op->GetFieldName(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_GetFieldType(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetFieldType"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = op->GetFieldType(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_GetFieldIndex(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetFieldIndex"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = (ap.IsBound() ? op->GetFieldIndex(temp0) : op->vtkRowQuery::GetFieldIndex(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_NextRow_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NextRow"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { bool tempr = op->NextRow(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_NextRow_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NextRow"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); vtkVariantArray *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkVariantArray")) { bool tempr = (ap.IsBound() ? op->NextRow(temp0) : op->vtkRowQuery::NextRow(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_NextRow(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 0: return PyvtkRowQuery_NextRow_s1(self, args); case 1: return PyvtkRowQuery_NextRow_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "NextRow"); return nullptr; } static PyObject * PyvtkRowQuery_IsActive(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsActive"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { bool tempr = op->IsActive(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_DataValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "DataValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); vtkIdType temp0; PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(1) && ap.GetValue(temp0)) { vtkVariant tempr = op->DataValue(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildSpecialObject(&tempr, "vtkVariant"); } } return result; } static PyObject * PyvtkRowQuery_HasError(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "HasError"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { bool tempr = op->HasError(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_GetLastErrorText(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetLastErrorText"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && !ap.IsPureVirtual() && ap.CheckArgCount(0)) { const char *tempr = op->GetLastErrorText(); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_SetCaseSensitiveFieldNames(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetCaseSensitiveFieldNames"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); bool temp0 = false; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetCaseSensitiveFieldNames(temp0); } else { op->vtkRowQuery::SetCaseSensitiveFieldNames(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkRowQuery_GetCaseSensitiveFieldNames(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetCaseSensitiveFieldNames"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { bool tempr = (ap.IsBound() ? op->GetCaseSensitiveFieldNames() : op->vtkRowQuery::GetCaseSensitiveFieldNames()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkRowQuery_CaseSensitiveFieldNamesOn(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CaseSensitiveFieldNamesOn"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CaseSensitiveFieldNamesOn(); } else { op->vtkRowQuery::CaseSensitiveFieldNamesOn(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkRowQuery_CaseSensitiveFieldNamesOff(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "CaseSensitiveFieldNamesOff"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkRowQuery *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->CaseSensitiveFieldNamesOff(); } else { op->vtkRowQuery::CaseSensitiveFieldNamesOff(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyMethodDef PyvtkRowQuery_Methods[] = { {"IsTypeOf", PyvtkRowQuery_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", PyvtkRowQuery_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", PyvtkRowQuery_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkRowQuery\nC++: static vtkRowQuery *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkRowQuery_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkRowQuery\nC++: vtkRowQuery *NewInstance()\n\n"}, {"Execute", PyvtkRowQuery_Execute, METH_VARARGS, "V.Execute() -> bool\nC++: virtual bool Execute()\n\nExecute the query. This must be performed before any field name\nor data access functions are used.\n"}, {"GetNumberOfFields", PyvtkRowQuery_GetNumberOfFields, METH_VARARGS, "V.GetNumberOfFields() -> int\nC++: virtual int GetNumberOfFields()\n\nThe number of fields in the query result.\n"}, {"GetFieldName", PyvtkRowQuery_GetFieldName, METH_VARARGS, "V.GetFieldName(int) -> string\nC++: virtual const char *GetFieldName(int i)\n\nReturn the name of the specified query field.\n"}, {"GetFieldType", PyvtkRowQuery_GetFieldType, METH_VARARGS, "V.GetFieldType(int) -> int\nC++: virtual int GetFieldType(int i)\n\nReturn the type of the field, using the constants defined in\nvtkType.h.\n"}, {"GetFieldIndex", PyvtkRowQuery_GetFieldIndex, METH_VARARGS, "V.GetFieldIndex(string) -> int\nC++: int GetFieldIndex(char *name)\n\nReturn the index of the specified query field. Uses\nGetNumberOfFields() and GetFieldName() to match field name.\n"}, {"NextRow", PyvtkRowQuery_NextRow, METH_VARARGS, "V.NextRow() -> bool\nC++: virtual bool NextRow()\nV.NextRow(vtkVariantArray) -> bool\nC++: bool NextRow(vtkVariantArray *rowArray)\n\nAdvance row, return false if past end.\n"}, {"IsActive", PyvtkRowQuery_IsActive, METH_VARARGS, "V.IsActive() -> bool\nC++: virtual bool IsActive()\n\nReturn true if the query is active (i.e. execution was successful\nand results are ready to be fetched). Returns false on error or\ninactive query.\n"}, {"DataValue", PyvtkRowQuery_DataValue, METH_VARARGS, "V.DataValue(int) -> vtkVariant\nC++: virtual vtkVariant DataValue(vtkIdType c)\n\nReturn data in current row, field c\n"}, {"HasError", PyvtkRowQuery_HasError, METH_VARARGS, "V.HasError() -> bool\nC++: virtual bool HasError()\n\nReturns true if an error is set, otherwise false.\n"}, {"GetLastErrorText", PyvtkRowQuery_GetLastErrorText, METH_VARARGS, "V.GetLastErrorText() -> string\nC++: virtual const char *GetLastErrorText()\n\nGet the last error text from the query\n"}, {"SetCaseSensitiveFieldNames", PyvtkRowQuery_SetCaseSensitiveFieldNames, METH_VARARGS, "V.SetCaseSensitiveFieldNames(bool)\nC++: virtual void SetCaseSensitiveFieldNames(bool _arg)\n\nMany databases do not preserve case in field names. This can\ncause GetFieldIndex to fail if you search for a field named\nsomeFieldName when the database actually stores it as\nSOMEFIELDNAME. This ivar controls whether GetFieldIndex()\nexpects field names to be case-sensitive. The default is OFF,\ni.e. case is not preserved.\n"}, {"GetCaseSensitiveFieldNames", PyvtkRowQuery_GetCaseSensitiveFieldNames, METH_VARARGS, "V.GetCaseSensitiveFieldNames() -> bool\nC++: virtual bool GetCaseSensitiveFieldNames()\n\nMany databases do not preserve case in field names. This can\ncause GetFieldIndex to fail if you search for a field named\nsomeFieldName when the database actually stores it as\nSOMEFIELDNAME. This ivar controls whether GetFieldIndex()\nexpects field names to be case-sensitive. The default is OFF,\ni.e. case is not preserved.\n"}, {"CaseSensitiveFieldNamesOn", PyvtkRowQuery_CaseSensitiveFieldNamesOn, METH_VARARGS, "V.CaseSensitiveFieldNamesOn()\nC++: virtual void CaseSensitiveFieldNamesOn()\n\nMany databases do not preserve case in field names. This can\ncause GetFieldIndex to fail if you search for a field named\nsomeFieldName when the database actually stores it as\nSOMEFIELDNAME. This ivar controls whether GetFieldIndex()\nexpects field names to be case-sensitive. The default is OFF,\ni.e. case is not preserved.\n"}, {"CaseSensitiveFieldNamesOff", PyvtkRowQuery_CaseSensitiveFieldNamesOff, METH_VARARGS, "V.CaseSensitiveFieldNamesOff()\nC++: virtual void CaseSensitiveFieldNamesOff()\n\nMany databases do not preserve case in field names. This can\ncause GetFieldIndex to fail if you search for a field named\nsomeFieldName when the database actually stores it as\nSOMEFIELDNAME. This ivar controls whether GetFieldIndex()\nexpects field names to be case-sensitive. The default is OFF,\ni.e. case is not preserved.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkRowQuery_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkIOSQLPython.vtkRowQuery", // 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 PyvtkRowQuery_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 *PyvtkRowQuery_ClassNew() { PyVTKClass_Add( &PyvtkRowQuery_Type, PyvtkRowQuery_Methods, "vtkRowQuery", nullptr); PyTypeObject *pytype = &PyvtkRowQuery_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_vtkRowQuery( PyObject *dict) { PyObject *o; o = PyvtkRowQuery_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkRowQuery", o) != 0) { Py_DECREF(o); } }