| 52 | // (LinkGeom or RobotJoint). Missing attributes leave the target's defaults. |
| 53 | template <typename T> |
| 54 | void parseOriginInto(const QDomElement& parent, T& out) { |
| 55 | const QDomElement origin = parent.firstChildElement(QStringLiteral("origin")); |
| 56 | if (origin.isNull()) { |
| 57 | return; |
| 58 | } |
| 59 | std::array<double, 3> xyz{0, 0, 0}; |
| 60 | std::array<double, 3> rpy{0, 0, 0}; |
| 61 | if (parseDoubles(origin.attribute(QStringLiteral("xyz")), xyz)) { |
| 62 | out.origin_xyz = {xyz[0], xyz[1], xyz[2]}; |
| 63 | } |
| 64 | if (parseDoubles(origin.attribute(QStringLiteral("rpy")), rpy)) { |
| 65 | out.origin_rpy = {rpy[0], rpy[1], rpy[2]}; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Read <geometry> into a GeomShape. Mesh refs are dispatched to the resolver. |
| 70 | // Returns false if no recognized child geometry is present. |
no test coverage detected