// python wrapper for vtkImplicitVolume // #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 "vtkImplicitVolume.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkImplicitVolume(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkImplicitVolume_ClassNew(); } #ifndef DECLARED_PyvtkImplicitFunction_ClassNew extern "C" { PyObject *PyvtkImplicitFunction_ClassNew(); } #define DECLARED_PyvtkImplicitFunction_ClassNew #endif static const char *PyvtkImplicitVolume_Doc = "vtkImplicitVolume - treat a volume as if it were an implicit function\n\n" "Superclass: vtkImplicitFunction\n\n" "vtkImplicitVolume treats a volume (e.g., structured point dataset) as\n" "if it were an implicit function. This means it computes a function\n" "value and gradient. vtkImplicitVolume is a concrete implementation of\n" "vtkImplicitFunction.\n\n" "vtkImplicitDataSet computes the function (at the point x) by\n" "performing cell interpolation. That is, it finds the cell containing\n" "x, and then uses the cell's interpolation functions to compute an\n" "interpolated scalar value at x. (A similar approach is used to find\n" "the gradient, if requested.) Points outside of the dataset are\n" "assigned the value of the ivar OutValue, and the gradient value\n" "OutGradient.\n\n" "@warning\n" "The input volume data is only updated when GetMTime() is called.\n" "Works for 3D structured points datasets, 0D-2D datasets won't work\n" "properly.\n\n" "@sa\n" "vtkImplicitFunction vtkImplicitDataSet vtkClipPolyData vtkCutter\n" "vtkImplicitWindowFunction\n\n"; static PyObject * PyvtkImplicitVolume_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkImplicitVolume::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *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->vtkImplicitVolume::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkImplicitVolume *tempr = vtkImplicitVolume::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImplicitVolume *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkImplicitVolume::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 * PyvtkImplicitVolume_GetMTime(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMTime"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { unsigned long tempr = (ap.IsBound() ? op->GetMTime() : op->vtkImplicitVolume::GetMTime()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_EvaluateFunction_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *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); double tempr = (ap.IsBound() ? op->EvaluateFunction(temp0) : op->vtkImplicitVolume::EvaluateFunction(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 * PyvtkImplicitVolume_EvaluateFunction_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); vtkDataArray *temp0 = nullptr; vtkDataArray *temp1 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetVTKObject(temp0, "vtkDataArray") && ap.GetVTKObject(temp1, "vtkDataArray")) { if (ap.IsBound()) { op->EvaluateFunction(temp0, temp1); } else { op->vtkImplicitVolume::EvaluateFunction(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImplicitVolume_EvaluateFunction_s3(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *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)) { double tempr = (ap.IsBound() ? op->EvaluateFunction(temp0, temp1, temp2) : op->vtkImplicitVolume::EvaluateFunction(temp0, temp1, temp2)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_EvaluateFunction(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 1: return PyvtkImplicitVolume_EvaluateFunction_s1(self, args); case 2: return PyvtkImplicitVolume_EvaluateFunction_s2(self, args); case 3: return PyvtkImplicitVolume_EvaluateFunction_s3(self, args); } vtkPythonArgs::ArgCountError(nargs, "EvaluateFunction"); return nullptr; } static PyObject * PyvtkImplicitVolume_EvaluateGradient(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateGradient"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); const int size0 = 3; double temp0[3]; double save0[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(temp0, save0, size0); ap.SaveArray(temp1, save1, size1); if (ap.IsBound()) { op->EvaluateGradient(temp0, temp1); } else { op->vtkImplicitVolume::EvaluateGradient(temp0, temp1); } 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 * PyvtkImplicitVolume_SetVolume(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetVolume"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); vtkImageData *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkImageData")) { if (ap.IsBound()) { op->SetVolume(temp0); } else { op->vtkImplicitVolume::SetVolume(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImplicitVolume_GetVolume(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetVolume"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImageData *tempr = (ap.IsBound() ? op->GetVolume() : op->vtkImplicitVolume::GetVolume()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_SetOutValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetOutValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); double temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetOutValue(temp0); } else { op->vtkImplicitVolume::SetOutValue(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImplicitVolume_GetOutValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetOutValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetOutValue() : op->vtkImplicitVolume::GetOutValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImplicitVolume_SetOutGradient_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetOutGradient"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *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->SetOutGradient(temp0, temp1, temp2); } else { op->vtkImplicitVolume::SetOutGradient(temp0, temp1, temp2); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImplicitVolume_SetOutGradient_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetOutGradient"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *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->SetOutGradient(temp0); } else { op->vtkImplicitVolume::SetOutGradient(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImplicitVolume_SetOutGradient(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 3: return PyvtkImplicitVolume_SetOutGradient_s1(self, args); case 1: return PyvtkImplicitVolume_SetOutGradient_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetOutGradient"); return nullptr; } static PyObject * PyvtkImplicitVolume_GetOutGradient(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetOutGradient"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImplicitVolume *op = static_cast(vp); int sizer = 3; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetOutGradient() : op->vtkImplicitVolume::GetOutGradient()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyMethodDef PyvtkImplicitVolume_Methods[] = { {"IsTypeOf", PyvtkImplicitVolume_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", PyvtkImplicitVolume_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", PyvtkImplicitVolume_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkImplicitVolume\nC++: static vtkImplicitVolume *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkImplicitVolume_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkImplicitVolume\nC++: vtkImplicitVolume *NewInstance()\n\n"}, {"GetMTime", PyvtkImplicitVolume_GetMTime, METH_VARARGS, "V.GetMTime() -> int\nC++: vtkMTimeType GetMTime() override;\n\nReturns the mtime also considering the volume. This also calls\nUpdate on the volume, and it therefore must be called before the\nfunction is evaluated.\n"}, {"EvaluateFunction", PyvtkImplicitVolume_EvaluateFunction, METH_VARARGS, "V.EvaluateFunction([float, float, float]) -> float\nC++: double EvaluateFunction(double x[3]) override;\nV.EvaluateFunction(vtkDataArray, vtkDataArray)\nC++: virtual void EvaluateFunction(vtkDataArray *input,\n vtkDataArray *output)\nV.EvaluateFunction(float, float, float) -> float\nC++: virtual double EvaluateFunction(double x, double y, double z)\n\nEvaluate the ImplicitVolume. This returns the interpolated scalar\nvalue at x[3].\n"}, {"EvaluateGradient", PyvtkImplicitVolume_EvaluateGradient, METH_VARARGS, "V.EvaluateGradient([float, float, float], [float, float, float])\nC++: void EvaluateGradient(double x[3], double n[3]) override;\n\nEvaluate ImplicitVolume gradient.\n"}, {"SetVolume", PyvtkImplicitVolume_SetVolume, METH_VARARGS, "V.SetVolume(vtkImageData)\nC++: virtual void SetVolume(vtkImageData *)\n\nSpecify the volume for the implicit function.\n"}, {"GetVolume", PyvtkImplicitVolume_GetVolume, METH_VARARGS, "V.GetVolume() -> vtkImageData\nC++: virtual vtkImageData *GetVolume()\n\nSpecify the volume for the implicit function.\n"}, {"SetOutValue", PyvtkImplicitVolume_SetOutValue, METH_VARARGS, "V.SetOutValue(float)\nC++: virtual void SetOutValue(double _arg)\n\nSet the function value to use for points outside of the dataset.\n"}, {"GetOutValue", PyvtkImplicitVolume_GetOutValue, METH_VARARGS, "V.GetOutValue() -> float\nC++: virtual double GetOutValue()\n\nSet the function value to use for points outside of the dataset.\n"}, {"SetOutGradient", PyvtkImplicitVolume_SetOutGradient, METH_VARARGS, "V.SetOutGradient(float, float, float)\nC++: void SetOutGradient(double, double, double)\nV.SetOutGradient((float, float, float))\nC++: void SetOutGradient(double a[3])\n\n"}, {"GetOutGradient", PyvtkImplicitVolume_GetOutGradient, METH_VARARGS, "V.GetOutGradient() -> (float, float, float)\nC++: double *GetOutGradient()\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkImplicitVolume_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkCommonDataModelPython.vtkImplicitVolume", // 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 PyvtkImplicitVolume_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 *PyvtkImplicitVolume_StaticNew() { return vtkImplicitVolume::New(); } PyObject *PyvtkImplicitVolume_ClassNew() { PyVTKClass_Add( &PyvtkImplicitVolume_Type, PyvtkImplicitVolume_Methods, "vtkImplicitVolume", &PyvtkImplicitVolume_StaticNew); PyTypeObject *pytype = &PyvtkImplicitVolume_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 *)PyvtkImplicitFunction_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkImplicitVolume( PyObject *dict) { PyObject *o; o = PyvtkImplicitVolume_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkImplicitVolume", o) != 0) { Py_DECREF(o); } }