| 496 | } |
| 497 | |
| 498 | PyObject* MatrixPy::row(PyObject* args) const |
| 499 | { |
| 500 | int index {}; |
| 501 | if (!PyArg_ParseTuple(args, "i", &index)) { |
| 502 | return nullptr; |
| 503 | } |
| 504 | |
| 505 | if (index < 0 || index > 3) { |
| 506 | PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]"); |
| 507 | return nullptr; |
| 508 | } |
| 509 | |
| 510 | Matrix4D* mat = getMatrixPtr(); |
| 511 | Vector3d v = mat->getRow(index); |
| 512 | return Py::new_reference_to(Py::Vector(v)); |
| 513 | } |
| 514 | |
| 515 | PyObject* MatrixPy::setRow(PyObject* args) |
| 516 | { |