| 610 | } |
| 611 | |
| 612 | Py::Dict MaterialPy::getPropertyObjects() const |
| 613 | { |
| 614 | Py::Dict dict; |
| 615 | |
| 616 | auto properties = getMaterialPtr()->getPhysicalProperties(); |
| 617 | for (auto& it : properties) { |
| 618 | QString key = it.first; |
| 619 | auto materialProperty = it.second; |
| 620 | |
| 621 | // if (materialProperty->getType() == MaterialValue::Array2D) { |
| 622 | // auto value = std::static_pointer_cast<Materials::Array2D>( |
| 623 | // materialProperty->getMaterialValue()); |
| 624 | // dict.setItem(Py::String(key.toStdString()), |
| 625 | // Py::Object(new Array2DPy(new Array2D(*value)), true)); |
| 626 | // } |
| 627 | // else if (materialProperty->getType() == MaterialValue::Array3D) { |
| 628 | // auto value = std::static_pointer_cast<Materials::Array3D>( |
| 629 | // materialProperty->getMaterialValue()); |
| 630 | // dict.setItem(Py::String(key.toStdString()), |
| 631 | // Py::Object(new Array3DPy(new Array3D(*value)), true)); |
| 632 | // } |
| 633 | // else { |
| 634 | dict.setItem( |
| 635 | Py::String(key.toStdString()), |
| 636 | Py::Object(new MaterialPropertyPy(new MaterialProperty(materialProperty)), true)); |
| 637 | // } |
| 638 | } |
| 639 | |
| 640 | properties = getMaterialPtr()->getAppearanceProperties(); |
| 641 | for (auto& it : properties) { |
| 642 | QString key = it.first; |
| 643 | auto materialProperty = it.second; |
| 644 | dict.setItem( |
| 645 | Py::String(key.toStdString()), |
| 646 | Py::Object(new MaterialPropertyPy(new MaterialProperty(materialProperty)), true)); |
| 647 | } |
| 648 | |
| 649 | return dict; |
| 650 | } |
| 651 | |
| 652 | PyObject* MaterialPy::keys() |
| 653 | { |
nothing calls this directly
no test coverage detected