From 43372f633243d711dcca53d4d846851fb3e552d8 Mon Sep 17 00:00:00 2001
From: Fabian Paus <fabian.paus@kit.edu>
Date: Tue, 11 Sep 2018 15:23:47 +0200
Subject: [PATCH] DebugDrawer: Remove circle visus when layer is cleared

---
 .../components/DebugDrawer/DebugDrawerComponent.cpp       | 5 +++++
 .../components/DebugDrawer/DebugDrawerComponent.h         | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
index 503c8589e..4784feb56 100644
--- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
+++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
@@ -2317,6 +2317,11 @@ namespace armarx
             removeCylinderVisu(layerName, i.first);
         }
 
+        for (const auto& i : layer.addedCircleVisualizations)
+        {
+            removeCircleVisu(layerName, i.first);
+        }
+
         for (const auto& i : layer.addedPointCloudVisualizations)
         {
             removePointCloudVisu(layerName, i.first);
diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
index cd2d8579c..d3ac754fc 100644
--- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
+++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h
@@ -214,10 +214,10 @@ namespace armarx
         void removeArrowVisu(const std::string& layerName, const std::string& arrowName, const ::Ice::Current& = ::Ice::Current()) override;
         void removeArrowDebugLayerVisu(const std::string& arrowName, const ::Ice::Current& = ::Ice::Current()) override;
 
-        void setCircleArrowVisu(const std::string& layerName, const std::string& circleName, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current&) override;
-        void setCircleDebugLayerVisu(const std::string& circleName, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current&) override;
-        void removeCircleVisu(const std::string& layerName, const std::string& circleName, const Ice::Current&) override;
-        void removeCircleDebugLayerVisu(const std::string& circleName, const Ice::Current&) override;
+        void setCircleArrowVisu(const std::string& layerName, const std::string& circleName, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current&  = ::Ice::Current()) override;
+        void setCircleDebugLayerVisu(const std::string& circleName, const Vector3BasePtr& globalPosition, const Vector3BasePtr& directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor& color, const Ice::Current& = ::Ice::Current()) override;
+        void removeCircleVisu(const std::string& layerName, const std::string& circleName, const Ice::Current& = ::Ice::Current()) override;
+        void removeCircleDebugLayerVisu(const std::string& circleName, const Ice::Current& = ::Ice::Current()) override;
 
 
         /*!
-- 
GitLab