// python wrapper for vtkCone // #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 "vtkCone.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkCone(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkCone_ClassNew(); } #ifndef DECLARED_PyvtkImplicitFunction_ClassNew extern "C" { PyObject *PyvtkImplicitFunction_ClassNew(); } #define DECLARED_PyvtkImplicitFunction_ClassNew #endif static const char *PyvtkCone_Doc = "vtkCone - implicit function for a cone\n\n" "Superclass: vtkImplicitFunction\n\n" "vtkCone computes the implicit function and function gradient for a\n" "cone. vtkCone is a concrete implementation of vtkImplicitFunction.\n" "The cone vertex is located at the origin with axis of rotation\n" "coincident with x-axis. (Use the superclass' vtkImplicitFunction\n" "transformation matrix if necessary to reposition.) The angle\n" "specifies the angle between the axis of rotation and the side of the\n" "cone.\n\n" "@warning\n" "The cone is infinite in extent. To truncate the cone use the\n" "vtkImplicitBoolean in combination with clipping planes.\n\n"; static PyObject * PyvtkCone_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkCone::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCone_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *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->vtkCone::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCone_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkCone *tempr = vtkCone::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkCone_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkCone *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkCone::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 * PyvtkCone_EvaluateFunction_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *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->vtkCone::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 * PyvtkCone_EvaluateFunction_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *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->vtkCone::EvaluateFunction(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCone_EvaluateFunction_s3(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateFunction"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *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->vtkCone::EvaluateFunction(temp0, temp1, temp2)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCone_EvaluateFunction(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 1: return PyvtkCone_EvaluateFunction_s1(self, args); case 2: return PyvtkCone_EvaluateFunction_s2(self, args); case 3: return PyvtkCone_EvaluateFunction_s3(self, args); } vtkPythonArgs::ArgCountError(nargs, "EvaluateFunction"); return nullptr; } static PyObject * PyvtkCone_EvaluateGradient(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "EvaluateGradient"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *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->vtkCone::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 * PyvtkCone_SetAngle(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAngle"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *op = static_cast(vp); double temp0; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { if (ap.IsBound()) { op->SetAngle(temp0); } else { op->vtkCone::SetAngle(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkCone_GetAngleMinValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAngleMinValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetAngleMinValue() : op->vtkCone::GetAngleMinValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCone_GetAngleMaxValue(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAngleMaxValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetAngleMaxValue() : op->vtkCone::GetAngleMaxValue()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkCone_GetAngle(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAngle"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkCone *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetAngle() : op->vtkCone::GetAngle()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyMethodDef PyvtkCone_Methods[] = { {"IsTypeOf", PyvtkCone_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", PyvtkCone_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", PyvtkCone_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkCone\nC++: static vtkCone *SafeDownCast(vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkCone_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkCone\nC++: vtkCone *NewInstance()\n\n"}, {"EvaluateFunction", PyvtkCone_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 cone equation.\n"}, {"EvaluateGradient", PyvtkCone_EvaluateGradient, METH_VARARGS, "V.EvaluateGradient([float, float, float], [float, float, float])\nC++: void EvaluateGradient(double x[3], double g[3]) override;\n\nEvaluate cone normal.\n"}, {"SetAngle", PyvtkCone_SetAngle, METH_VARARGS, "V.SetAngle(float)\nC++: virtual void SetAngle(double _arg)\n\nSet/Get the cone angle (expressed in degrees).\n"}, {"GetAngleMinValue", PyvtkCone_GetAngleMinValue, METH_VARARGS, "V.GetAngleMinValue() -> float\nC++: virtual double GetAngleMinValue()\n\nSet/Get the cone angle (expressed in degrees).\n"}, {"GetAngleMaxValue", PyvtkCone_GetAngleMaxValue, METH_VARARGS, "V.GetAngleMaxValue() -> float\nC++: virtual double GetAngleMaxValue()\n\nSet/Get the cone angle (expressed in degrees).\n"}, {"GetAngle", PyvtkCone_GetAngle, METH_VARARGS, "V.GetAngle() -> float\nC++: virtual double GetAngle()\n\nSet/Get the cone angle (expressed in degrees).\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkCone_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkCommonDataModelPython.vtkCone", // 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 PyvtkCone_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 *PyvtkCone_StaticNew() { return vtkCone::New(); } PyObject *PyvtkCone_ClassNew() { PyVTKClass_Add( &PyvtkCone_Type, PyvtkCone_Methods, "vtkCone", &PyvtkCone_StaticNew); PyTypeObject *pytype = &PyvtkCone_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_vtkCone( PyObject *dict) { PyObject *o; o = PyvtkCone_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkCone", o) != 0) { Py_DECREF(o); } }