Base: use NoArgs in MatrixPy
This commit is contained in:
@@ -352,11 +352,8 @@ PyObject* MatrixPy::hasScale(PyObject * args)
|
||||
return Py::new_reference_to(mod.callMemberFunction("ScaleType", Py::TupleN(Py::Int(static_cast<int>(type)))));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::nullify(PyObject * args)
|
||||
PyObject* MatrixPy::nullify()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->nullify();
|
||||
Py_Return;
|
||||
@@ -364,11 +361,8 @@ PyObject* MatrixPy::nullify(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::isNull(PyObject * args)
|
||||
PyObject* MatrixPy::isNull()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
bool ok = getMatrixPtr()->isNull();
|
||||
return Py::new_reference_to(Py::Boolean(ok));
|
||||
@@ -376,11 +370,8 @@ PyObject* MatrixPy::isNull(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::unity(PyObject * args)
|
||||
PyObject* MatrixPy::unity()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->setToUnity();
|
||||
Py_Return;
|
||||
@@ -388,11 +379,8 @@ PyObject* MatrixPy::unity(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::isUnity(PyObject * args)
|
||||
PyObject* MatrixPy::isUnity()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
bool ok = getMatrixPtr()->isUnity();
|
||||
return Py::new_reference_to(Py::Boolean(ok));
|
||||
@@ -487,11 +475,8 @@ PyObject* MatrixPy::setRow(PyObject * args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::diagonal(PyObject * args)
|
||||
PyObject* MatrixPy::diagonal()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->diagonal();
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
@@ -628,11 +613,8 @@ PyObject* MatrixPy::multVec(PyObject * args)
|
||||
return new VectorPy(new Vector3d(vec));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::invert(PyObject * args)
|
||||
PyObject* MatrixPy::invert()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
|
||||
getMatrixPtr()->inverseGauss();
|
||||
@@ -646,11 +628,8 @@ PyObject* MatrixPy::invert(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::inverse(PyObject * args)
|
||||
PyObject* MatrixPy::inverse()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
|
||||
Base::Matrix4D m = *getMatrixPtr();
|
||||
@@ -665,11 +644,8 @@ PyObject* MatrixPy::inverse(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::determinant(PyObject * args)
|
||||
PyObject* MatrixPy::determinant()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
return PyFloat_FromDouble(getMatrixPtr()->determinant());
|
||||
}
|
||||
|
||||
@@ -741,11 +717,8 @@ PyObject* MatrixPy::isOrthogonal(PyObject * args)
|
||||
return Py::new_reference_to(Py::Float(ok ? mult : 0.0));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::transposed(PyObject * args)
|
||||
PyObject* MatrixPy::transposed()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
Base::Matrix4D m = *getMatrixPtr();
|
||||
m.transpose();
|
||||
@@ -754,11 +727,8 @@ PyObject* MatrixPy::transposed(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::transpose(PyObject * args)
|
||||
PyObject* MatrixPy::transpose()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->transpose();
|
||||
Py_Return;
|
||||
@@ -766,11 +736,8 @@ PyObject* MatrixPy::transpose(PyObject * args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::analyze(PyObject * args)
|
||||
PyObject* MatrixPy::analyze()
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
std::string type = getMatrixPtr()->analyse();
|
||||
return PyUnicode_FromString(type.c_str());
|
||||
|
||||
Reference in New Issue
Block a user