Base: add Python number protocol support to Placement/Rotation

This commit is contained in:
Zheng, Lei
2019-09-03 17:38:15 +08:00
committed by wmayer
parent d6ad2f09c0
commit ff3ec0c7fd
6 changed files with 408 additions and 2 deletions

View File

@@ -151,6 +151,13 @@ PyObject* VectorPy::number_multiply_handler(PyObject *self, PyObject *other)
return new MatrixPy(b);
}
if (PyObject_TypeCheck(other, &PlacementPy::Type)) {
Base::Placement b = static_cast<PlacementPy*>(other)->value();
Vector3d res;
b.multVec(a,res);
return new VectorPy(res);
}
if (PyObject_TypeCheck(other, &RotationPy::Type)) {
Base::Rotation b = static_cast<RotationPy*>(other)->value();
return new VectorPy(b.multVec(a));