rename Placement.isNull to Placement.isIdentity

implement Rotation.isNull and Rotation.isIdentity
This commit is contained in:
wmayer
2017-12-13 16:58:12 +01:00
parent 77174809db
commit df0a3ded78
6 changed files with 33 additions and 11 deletions

View File

@@ -200,16 +200,14 @@ PyObject* PlacementPy::inverse(PyObject * args)
return new PlacementPy(new Placement(p));
}
PyObject* PlacementPy::isNull(PyObject *args)
PyObject* PlacementPy::isIdentity(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
Base::Vector3d nullvec(0,0,0);
Base::Vector3d pos = getPlacementPtr()->getPosition();
Base::Rotation rot = getPlacementPtr()->getRotation();
Base::Vector3d nullvec(0,0,0);
Base::Rotation nullrot(0,0,0,1);
Base::Rotation nullrotinv(0,0,0,-1);
bool null = (pos == nullvec) & ((rot == nullrot) | (rot == nullrotinv));
bool null = (pos == nullvec) && (rot.isIdentity());
return Py_BuildValue("O", (null ? Py_True : Py_False));
}