Exposed vector negative to python

This commit is contained in:
Yorik van Havre
2013-07-30 12:17:06 -03:00
parent 64d18ceac8
commit f1dc173a0f
2 changed files with 17 additions and 0 deletions

View File

@@ -215,6 +215,16 @@ PyObject* VectorPy::sub(PyObject *args)
return new VectorPy(v);
}
PyObject* VectorPy::negative(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
VectorPy::PointerType this_ptr = reinterpret_cast<VectorPy::PointerType>(_pcTwinPointer);
Base::Vector3d v = -(*this_ptr);
return new VectorPy(v);
}
PyObject* VectorPy::richCompare(PyObject *v, PyObject *w, int op)
{
if (PyObject_TypeCheck(v, &(VectorPy::Type)) &&