From 23c9566d3d82ecde67d0449db1903ef0d6d3de0e Mon Sep 17 00:00:00 2001
From: Raphael <ufdrv@student.kit.edu>
Date: Sun, 11 Jun 2017 14:05:56 +0200
Subject: [PATCH] add a function to get the names of all robot node sets to
 VirtualRobot::Robot

---
 VirtualRobot/Robot.cpp | 11 +++++++++++
 VirtualRobot/Robot.h   |  1 +
 2 files changed, 12 insertions(+)

diff --git a/VirtualRobot/Robot.cpp b/VirtualRobot/Robot.cpp
index 67b8b73c9..82213a9cd 100644
--- a/VirtualRobot/Robot.cpp
+++ b/VirtualRobot/Robot.cpp
@@ -535,6 +535,17 @@ namespace VirtualRobot
         return res;
     }
 
+    std::vector<std::string> VirtualRobot::Robot::Robot::getRobotNodeSetNames() const
+    {
+        std::vector<std::string> res;
+        const auto sets = getRobotNodeSets();
+        res.reserve(sets.size());
+        for(const auto& set:sets)
+        {
+            res.emplace_back(set->getName());
+        }
+        return res;
+    }
 
     void Robot::highlight(VisualizationPtr visualization, bool enable)
     {
diff --git a/VirtualRobot/Robot.h b/VirtualRobot/Robot.h
index f1abba9c3..e0372986e 100644
--- a/VirtualRobot/Robot.h
+++ b/VirtualRobot/Robot.h
@@ -166,6 +166,7 @@ namespace VirtualRobot
         virtual bool hasRobotNodeSet(const std::string& name) = 0;
         virtual RobotNodeSetPtr getRobotNodeSet(const std::string& nodeSetName) const = 0;
         virtual std::vector<RobotNodeSetPtr> getRobotNodeSets() const;
+        virtual std::vector<std::string> getRobotNodeSetNames() const;
         virtual void getRobotNodeSets(std::vector<RobotNodeSetPtr>& storeNodeSet) const = 0;
 
         /**
-- 
GitLab