| 333 | } |
| 334 | |
| 335 | PyObject* ComplexGeoDataPy::getElementIndexedName(PyObject* args) const |
| 336 | { |
| 337 | char* input; |
| 338 | PyObject* returnID = Py_False; |
| 339 | if (!PyArg_ParseTuple(args, "s|O", &input, &returnID)) { |
| 340 | return NULL; |
| 341 | } |
| 342 | |
| 343 | ElementIDRefs ids; |
| 344 | Data::MappedElement res = |
| 345 | getComplexGeoDataPtr()->getElementName(input, PyObject_IsTrue(returnID) ? &ids : nullptr); |
| 346 | std::string s; |
| 347 | Py::String name(res.index.appendToStringBuffer(s)); |
| 348 | if (!PyObject_IsTrue(returnID)) { |
| 349 | return Py::new_reference_to(name); |
| 350 | } |
| 351 | |
| 352 | Py::List list; |
| 353 | for (auto& id : ids) { |
| 354 | list.append(Py::Long(id.value())); |
| 355 | } |
| 356 | return Py::new_reference_to(Py::TupleN(name, list)); |
| 357 | } |
| 358 | |
| 359 | PyObject* ComplexGeoDataPy::getElementMappedName(PyObject* args) const |
| 360 | { |
nothing calls this directly
no test coverage detected