diff --git a/VirtualRobot/Nodes/RobotNode.h b/VirtualRobot/Nodes/RobotNode.h index 4437628d38b51fc915c0bedf85de7e485b16bb67..0c3a40f327464aca67d95652fdc3918b3778bdd7 100644 --- a/VirtualRobot/Nodes/RobotNode.h +++ b/VirtualRobot/Nodes/RobotNode.h @@ -126,6 +126,22 @@ namespace VirtualRobot return localTransformation; } + using SceneObject::getChildren; + template<class T> + auto getChildren() + { + std::vector<std::shared_ptr<T>> result; + for (const auto& c : getChildren()) + { + RobotNodePtr n = std::dynamic_pointer_cast<T>(c); + if (n) + { + result.emplace_back(n); + } + } + return result; + } + /*! Initialize robot node. Here pointers to robot and children are created from names. Be sure all children are created and registered to robot before calling initialize.