| 357 | } |
| 358 | |
| 359 | PyObject* ComplexGeoDataPy::getElementMappedName(PyObject* args) const |
| 360 | { |
| 361 | char* input; |
| 362 | PyObject* returnID = Py_False; |
| 363 | if (!PyArg_ParseTuple(args, "s|O", &input, &returnID)) { |
| 364 | return NULL; |
| 365 | } |
| 366 | |
| 367 | ElementIDRefs ids; |
| 368 | Data::MappedElement res = |
| 369 | getComplexGeoDataPtr()->getElementName(input, PyObject_IsTrue(returnID) ? &ids : nullptr); |
| 370 | std::string s; |
| 371 | Py::String name(res.name.appendToBuffer(s)); |
| 372 | if (!PyObject_IsTrue(returnID)) { |
| 373 | return Py::new_reference_to(name); |
| 374 | } |
| 375 | |
| 376 | Py::List list; |
| 377 | for (auto& id : ids) { |
| 378 | list.append(Py::Long(id.value())); |
| 379 | } |
| 380 | return Py::new_reference_to(Py::TupleN(name, list)); |
| 381 | } |
| 382 | |
| 383 | PyObject* ComplexGeoDataPy::setElementName(PyObject* args, PyObject* kwds) |
| 384 | { |
nothing calls this directly
no test coverage detected