// python wrapper for vtkGeoTransform // #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 "vtkGeoTransform.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkGeoTransform(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkGeoTransform_ClassNew(); } #ifndef DECLARED_PyvtkAbstractTransform_ClassNew extern "C" { PyObject *PyvtkAbstractTransform_ClassNew(); } #define DECLARED_PyvtkAbstractTransform_ClassNew #endif static const char *PyvtkGeoTransform_Doc = "vtkGeoTransform - A transformation between two geographic coordinate\nsystems\n\n" "Superclass: vtkAbstractTransform\n\n" "This class takes two geographic projections and transforms point\n" "coordinates between them.\n\n"; static PyObject * PyvtkGeoTransform_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkGeoTransform::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoTransform_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *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->vtkGeoTransform::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkGeoTransform_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkGeoTransform *tempr = vtkGeoTransform::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGeoTransform_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkGeoTransform *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkGeoTransform::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 * PyvtkGeoTransform_SetSourceProjection(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetSourceProjection"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); vtkGeoProjection *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGeoProjection")) { if (ap.IsBound()) { op->SetSourceProjection(temp0); } else { op->vtkGeoTransform::SetSourceProjection(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_GetSourceProjection(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetSourceProjection"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkGeoProjection *tempr = (ap.IsBound() ? op->GetSourceProjection() : op->vtkGeoTransform::GetSourceProjection()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGeoTransform_SetDestinationProjection(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetDestinationProjection"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); vtkGeoProjection *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkGeoProjection")) { if (ap.IsBound()) { op->SetDestinationProjection(temp0); } else { op->vtkGeoTransform::SetDestinationProjection(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_GetDestinationProjection(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetDestinationProjection"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkGeoProjection *tempr = (ap.IsBound() ? op->GetDestinationProjection() : op->vtkGeoTransform::GetDestinationProjection()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkGeoTransform_TransformPoints(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "TransformPoints"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); vtkPoints *temp0 = nullptr; vtkPoints *temp1 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetVTKObject(temp0, "vtkPoints") && ap.GetVTKObject(temp1, "vtkPoints")) { if (ap.IsBound()) { op->TransformPoints(temp0, temp1); } else { op->vtkGeoTransform::TransformPoints(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_Inverse(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "Inverse"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { if (ap.IsBound()) { op->Inverse(); } else { op->vtkGeoTransform::Inverse(); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_InternalTransformPoint(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "InternalTransformPoint"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); const int size0 = 3; double temp0[3]; const int size1 = 3; double temp1[3]; double save1[3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1)) { ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->InternalTransformPoint(temp0, temp1); } else { op->vtkGeoTransform::InternalTransformPoint(temp0, temp1); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_InternalTransformDerivative(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "InternalTransformDerivative"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); const int size0 = 3; double temp0[3]; const int size1 = 3; double temp1[3]; double save1[3]; static int size2[2] = { 3, 3 }; double temp2[3][3]; double save2[3][3]; PyObject *result = nullptr; if (op && ap.CheckArgCount(3) && ap.GetArray(temp0, size0) && ap.GetArray(temp1, size1) && ap.GetNArray(*temp2, 2, size2)) { ap.SaveArray(temp1, save1, size1); ap.SaveArray(*temp2, *save2, size2[0]*size2[1]); if (ap.IsBound()) { op->InternalTransformDerivative(temp0, temp1, temp2); } else { op->vtkGeoTransform::InternalTransformDerivative(temp0, temp1, temp2); } if (ap.ArrayHasChanged(temp1, save1, size1) && !ap.ErrorOccurred()) { ap.SetArray(1, temp1, size1); } if (ap.ArrayHasChanged(*temp2, *save2, size2[0]*size2[1]) && !ap.ErrorOccurred()) { ap.SetNArray(2, *temp2, 2, size2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkGeoTransform_MakeTransform(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "MakeTransform"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkGeoTransform *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkAbstractTransform *tempr = (ap.IsBound() ? op->MakeTransform() : op->vtkGeoTransform::MakeTransform()); 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 PyMethodDef PyvtkGeoTransform_Methods[] = { {"IsTypeOf", PyvtkGeoTransform_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", PyvtkGeoTransform_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", PyvtkGeoTransform_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkGeoTransform\nC++: static vtkGeoTransform *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkGeoTransform_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkGeoTransform\nC++: vtkGeoTransform *NewInstance()\n\n"}, {"SetSourceProjection", PyvtkGeoTransform_SetSourceProjection, METH_VARARGS, "V.SetSourceProjection(vtkGeoProjection)\nC++: void SetSourceProjection(vtkGeoProjection *source)\n\nThe source geographic projection.\n"}, {"GetSourceProjection", PyvtkGeoTransform_GetSourceProjection, METH_VARARGS, "V.GetSourceProjection() -> vtkGeoProjection\nC++: virtual vtkGeoProjection *GetSourceProjection()\n\nThe source geographic projection.\n"}, {"SetDestinationProjection", PyvtkGeoTransform_SetDestinationProjection, METH_VARARGS, "V.SetDestinationProjection(vtkGeoProjection)\nC++: void SetDestinationProjection(vtkGeoProjection *dest)\n\nThe target geographic projection.\n"}, {"GetDestinationProjection", PyvtkGeoTransform_GetDestinationProjection, METH_VARARGS, "V.GetDestinationProjection() -> vtkGeoProjection\nC++: virtual vtkGeoProjection *GetDestinationProjection()\n\nThe target geographic projection.\n"}, {"TransformPoints", PyvtkGeoTransform_TransformPoints, METH_VARARGS, "V.TransformPoints(vtkPoints, vtkPoints)\nC++: void TransformPoints(vtkPoints *src, vtkPoints *dst)\n override;\n\nTransform many points at once.\n"}, {"Inverse", PyvtkGeoTransform_Inverse, METH_VARARGS, "V.Inverse()\nC++: void Inverse() override;\n\nInvert the transformation.\n"}, {"InternalTransformPoint", PyvtkGeoTransform_InternalTransformPoint, METH_VARARGS, "V.InternalTransformPoint((float, float, float), [float, float,\n float])\nC++: void InternalTransformPoint(const double in[3],\n double out[3]) override;\n\nThis will calculate the transformation without calling Update.\nMeant for use only within other VTK classes.\n"}, {"InternalTransformDerivative", PyvtkGeoTransform_InternalTransformDerivative, METH_VARARGS, "V.InternalTransformDerivative((float, float, float), [float,\n float, float], [[float, float, float], [float, float, float],\n [float, float, float]])\nC++: void InternalTransformDerivative(const double in[3],\n double out[3], double derivative[3][3]) override;\n\nThis will transform a point and, at the same time, calculate a\n3x3 Jacobian matrix that provides the partial derivatives of the\ntransformation at that point. This method does not call Update.\nMeant for use only within other VTK classes.\n"}, {"MakeTransform", PyvtkGeoTransform_MakeTransform, METH_VARARGS, "V.MakeTransform() -> vtkAbstractTransform\nC++: vtkAbstractTransform *MakeTransform() override;\n\nMake another transform of the same type.\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkGeoTransform_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkGeovisCorePython.vtkGeoTransform", // 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 PyvtkGeoTransform_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 *PyvtkGeoTransform_StaticNew() { return vtkGeoTransform::New(); } PyObject *PyvtkGeoTransform_ClassNew() { PyVTKClass_Add( &PyvtkGeoTransform_Type, PyvtkGeoTransform_Methods, "vtkGeoTransform", &PyvtkGeoTransform_StaticNew); PyTypeObject *pytype = &PyvtkGeoTransform_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 *)PyvtkAbstractTransform_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkGeoTransform( PyObject *dict) { PyObject *o; o = PyvtkGeoTransform_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkGeoTransform", o) != 0) { Py_DECREF(o); } }