| 204 | } |
| 205 | |
| 206 | bool PropertyVector::getPyPathValue(const ObjectIdentifier& path, Py::Object& res) const |
| 207 | { |
| 208 | Base::Unit unit = getUnit(); |
| 209 | if (unit == Unit::One) { |
| 210 | return false; |
| 211 | } |
| 212 | |
| 213 | std::string p = path.getSubPathStr(); |
| 214 | if (p == ".x") { |
| 215 | res = Py::asObject(new QuantityPy(new Quantity(getValue().x, unit))); |
| 216 | } |
| 217 | else if (p == ".y") { |
| 218 | res = Py::asObject(new QuantityPy(new Quantity(getValue().y, unit))); |
| 219 | } |
| 220 | else if (p == ".z") { |
| 221 | res = Py::asObject(new QuantityPy(new Quantity(getValue().z, unit))); |
| 222 | } |
| 223 | else { |
| 224 | return false; |
| 225 | } |
| 226 | return true; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | //************************************************************************** |
no test coverage detected