| 552 | } |
| 553 | |
| 554 | PyObject* MatrixPy::rotateX(PyObject* args) |
| 555 | { |
| 556 | double angle = 0; |
| 557 | do { |
| 558 | PyObject* object {}; |
| 559 | if (PyArg_ParseTuple(args, "O!", &(QuantityPy::Type), &object)) { |
| 560 | Quantity* q = static_cast<QuantityPy*>(object)->getQuantityPtr(); |
| 561 | if (q->getUnit() == Unit::Angle) { |
| 562 | angle = q->getValueAs(Quantity::Radian); |
| 563 | break; |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | PyErr_Clear(); |
| 568 | if (PyArg_ParseTuple(args, "d: angle to rotate (double) needed", &angle)) { |
| 569 | break; |
| 570 | } |
| 571 | |
| 572 | PyErr_SetString(PyExc_TypeError, "For angle either float or Quantity expected"); |
| 573 | return nullptr; |
| 574 | } while (false); |
| 575 | |
| 576 | PY_TRY |
| 577 | { |
| 578 | getMatrixPtr()->rotX(angle); |
| 579 | Py_Return; |
| 580 | } |
| 581 | PY_CATCH; |
| 582 | } |
| 583 |
nothing calls this directly
no test coverage detected