MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getElementName

Method getElementName

src/App/ComplexGeoDataPyImp.cpp:311–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311PyObject* ComplexGeoDataPy::getElementName(PyObject* args) const
312{
313 char* input;
314 int direction = 0;
315 if (!PyArg_ParseTuple(args, "s|i", &input, &direction)) {
316 return NULL;
317 }
318
319 Data::MappedElement res = getComplexGeoDataPtr()->getElementName(input);
320 std::string s;
321 if (direction == 1) {
322 return Py::new_reference_to(Py::String(res.name.appendToBuffer(s)));
323 }
324 else if (direction == 0) {
325 return Py::new_reference_to(Py::String(res.index.appendToStringBuffer(s)));
326 }
327 else if (Data::IndexedName(input)) {
328 return Py::new_reference_to(Py::String(res.name.appendToBuffer(s)));
329 }
330 else {
331 return Py::new_reference_to(Py::String(res.index.appendToStringBuffer(s)));
332 }
333}
334
335PyObject* ComplexGeoDataPy::getElementIndexedName(PyObject* args) const
336{

Callers 2

getElementIndexedNameMethod · 0.45
getElementMappedNameMethod · 0.45

Calls 3

new_reference_toFunction · 0.85
StringClass · 0.70
IndexedNameClass · 0.70

Tested by

no test coverage detected