// python wrapper for vtkTextSource // #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 "vtkTextSource.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkTextSource(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkTextSource_ClassNew(); } #ifndef DECLARED_PyvtkPolyDataAlgorithm_ClassNew extern "C" { PyObject *PyvtkPolyDataAlgorithm_ClassNew(); } #define DECLARED_PyvtkPolyDataAlgorithm_ClassNew #endif static const char *PyvtkTextSource_Doc = "vtkTextSource - create polygonal text\n\n" "Superclass: vtkPolyDataAlgorithm\n\n" "vtkTextSource converts a text string into polygons. This way you can\n" "insert text into your renderings. It uses the 9x15 font from X\n" "Windows. You can specify if you want the background to be drawn or\n" "not. The characters are formed by scan converting the raster font\n" "into quadrilaterals. Colors are assigned to the letters using scalar\n" "data. To set the color of the characters with the source's actor\n" "property, set BackingOff on the text source and ScalarVisibilityOff\n" "on the associated vtkPolyDataMapper. Then, the color can be set using\n" "the associated actor's property.\n\n" "vtkVectorText generates higher quality polygonal representations of\n" "characters.\n\n" "@sa\n" "vtkVectorText\n\n"; static PyObject * PyvtkTextSource_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkTextSource::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkTextSource_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *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->vtkTextSource::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkTextSource_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkTextSource *tempr = vtkTextSource::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkTextSource_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkTextSource *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkTextSource::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 * PyvtkTextSource_SetText(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetText"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetText(temp0); } else { op->vtkTextSource::SetText(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_GetText(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetText"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { char *tempr = (ap.IsBound() ? op->GetText() : op->vtkTextSource::GetText()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkTextSource_SetBacking(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBacking"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetBacking(temp0); } else { op->vtkTextSource::SetBacking(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_GetBacking(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBacking"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetBacking() : op->vtkTextSource::GetBacking()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkTextSource_BackingOn(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BackingOn"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BackingOn(); } else { op->vtkTextSource::BackingOn(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_BackingOff(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "BackingOff"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->BackingOff(); } else { op->vtkTextSource::BackingOff(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_SetForegroundColor_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetForegroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); double temp0; double temp1; double temp2; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetValue(temp0) && ap.GetValue(temp1) && ap.GetValue(temp2)) { if (ap.IsBound()) { op->SetForegroundColor(temp0, temp1, temp2); } else { op->vtkTextSource::SetForegroundColor(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_SetForegroundColor_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetForegroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); const int size0 = 3; double temp0[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetForegroundColor(temp0); } else { op->vtkTextSource::SetForegroundColor(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_SetForegroundColor(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 3: return PyvtkTextSource_SetForegroundColor_s1(self, args); case 1: return PyvtkTextSource_SetForegroundColor_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetForegroundColor"); return nullptr; } static PyObject * PyvtkTextSource_GetForegroundColor(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetForegroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); int sizer = 3; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetForegroundColor() : op->vtkTextSource::GetForegroundColor()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkTextSource_SetBackgroundColor_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); double temp0; double temp1; double temp2; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetValue(temp0) && ap.GetValue(temp1) && ap.GetValue(temp2)) { if (ap.IsBound()) { op->SetBackgroundColor(temp0, temp1, temp2); } else { op->vtkTextSource::SetBackgroundColor(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_SetBackgroundColor_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); const int size0 = 3; double temp0[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetBackgroundColor(temp0); } else { op->vtkTextSource::SetBackgroundColor(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_SetBackgroundColor(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 3: return PyvtkTextSource_SetBackgroundColor_s1(self, args); case 1: return PyvtkTextSource_SetBackgroundColor_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetBackgroundColor"); return nullptr; } static PyObject * PyvtkTextSource_GetBackgroundColor(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetBackgroundColor"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); int sizer = 3; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetBackgroundColor() : op->vtkTextSource::GetBackgroundColor()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkTextSource_SetOutputPointsPrecision(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetOutputPointsPrecision"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); int temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetOutputPointsPrecision(temp0); } else { op->vtkTextSource::SetOutputPointsPrecision(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkTextSource_GetOutputPointsPrecision(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetOutputPointsPrecision"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkTextSource *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { int tempr = (ap.IsBound() ? op->GetOutputPointsPrecision() : op->vtkTextSource::GetOutputPointsPrecision()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyMethodDef PyvtkTextSource_Methods[] = { {"IsTypeOf", PyvtkTextSource_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", PyvtkTextSource_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", PyvtkTextSource_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkTextSource\nC++: static vtkTextSource *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkTextSource_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkTextSource\nC++: vtkTextSource *NewInstance()\n\n"}, {"SetText", PyvtkTextSource_SetText, METH_VARARGS, "V.SetText(string)\nC++: virtual void SetText(const char *_arg)\n\nSet/Get the text to be drawn.\n"}, {"GetText", PyvtkTextSource_GetText, METH_VARARGS, "V.GetText() -> string\nC++: virtual char *GetText()\n\nSet/Get the text to be drawn.\n"}, {"SetBacking", PyvtkTextSource_SetBacking, METH_VARARGS, "V.SetBacking(int)\nC++: virtual void SetBacking(int _arg)\n\nControls whether or not a background is drawn with the text.\n"}, {"GetBacking", PyvtkTextSource_GetBacking, METH_VARARGS, "V.GetBacking() -> int\nC++: virtual int GetBacking()\n\nControls whether or not a background is drawn with the text.\n"}, {"BackingOn", PyvtkTextSource_BackingOn, METH_VARARGS, "V.BackingOn()\nC++: virtual void BackingOn()\n\nControls whether or not a background is drawn with the text.\n"}, {"BackingOff", PyvtkTextSource_BackingOff, METH_VARARGS, "V.BackingOff()\nC++: virtual void BackingOff()\n\nControls whether or not a background is drawn with the text.\n"}, {"SetForegroundColor", PyvtkTextSource_SetForegroundColor, METH_VARARGS, "V.SetForegroundColor(float, float, float)\nC++: void SetForegroundColor(double, double, double)\nV.SetForegroundColor((float, float, float))\nC++: void SetForegroundColor(double a[3])\n\n"}, {"GetForegroundColor", PyvtkTextSource_GetForegroundColor, METH_VARARGS, "V.GetForegroundColor() -> (float, float, float)\nC++: double *GetForegroundColor()\n\nSet/Get the foreground color. Default is white (1,1,1). ALpha is\nalways 1.\n"}, {"SetBackgroundColor", PyvtkTextSource_SetBackgroundColor, METH_VARARGS, "V.SetBackgroundColor(float, float, float)\nC++: void SetBackgroundColor(double, double, double)\nV.SetBackgroundColor((float, float, float))\nC++: void SetBackgroundColor(double a[3])\n\n"}, {"GetBackgroundColor", PyvtkTextSource_GetBackgroundColor, METH_VARARGS, "V.GetBackgroundColor() -> (float, float, float)\nC++: double *GetBackgroundColor()\n\nSet/Get the background color. Default is black (0,0,0). Alpha is\nalways 1.\n"}, {"SetOutputPointsPrecision", PyvtkTextSource_SetOutputPointsPrecision, METH_VARARGS, "V.SetOutputPointsPrecision(int)\nC++: virtual void SetOutputPointsPrecision(int _arg)\n\nSet/get the desired precision for the output points.\nvtkAlgorithm::SINGLE_PRECISION - Output single-precision floating\npoint. vtkAlgorithm::DOUBLE_PRECISION - Output double-precision\nfloating point.\n"}, {"GetOutputPointsPrecision", PyvtkTextSource_GetOutputPointsPrecision, METH_VARARGS, "V.GetOutputPointsPrecision() -> int\nC++: virtual int GetOutputPointsPrecision()\n\nSet/get the desired precision for the output points.\nvtkAlgorithm::SINGLE_PRECISION - Output single-precision floating\npoint. vtkAlgorithm::DOUBLE_PRECISION - Output double-precision\nfloating point.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkTextSource_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkFiltersSourcesPython.vtkTextSource", // 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 PyvtkTextSource_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 *PyvtkTextSource_StaticNew() { return vtkTextSource::New(); } PyObject *PyvtkTextSource_ClassNew() { PyVTKClass_Add( &PyvtkTextSource_Type, PyvtkTextSource_Methods, "vtkTextSource", &PyvtkTextSource_StaticNew); PyTypeObject *pytype = &PyvtkTextSource_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 *)PyvtkPolyDataAlgorithm_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkTextSource( PyObject *dict) { PyObject *o; o = PyvtkTextSource_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkTextSource", o) != 0) { Py_DECREF(o); } }