diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp index 535731a1e2a7fcc553e92089eaf043491c701ca8..9103deeb6b45a556c248a69ac5089efe791ea4e9 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp @@ -50,14 +50,14 @@ namespace armarx return topic; } - void DebugDrawerTopic::offeringTopic(ManagedIceObject& component) const + void DebugDrawerTopic::offeringTopic(ManagedIceObject& component, const std::string& topicNameOverride) const { - component.offeringTopic(TOPIC_NAME); + component.offeringTopic(topicNameOverride.empty() ? TOPIC_NAME : topicNameOverride); } - void DebugDrawerTopic::getTopic(ManagedIceObject& component) + void DebugDrawerTopic::getTopic(ManagedIceObject& component, const std::string& topicNameOverride) { - setTopic(component.getTopic<DebugDrawerInterfacePrx>(TOPIC_NAME)); + setTopic(component.getTopic<DebugDrawerInterfacePrx>(topicNameOverride.empty() ? TOPIC_NAME : topicNameOverride)); } const std::string& DebugDrawerTopic::getLayer() const diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h index 80ffd768642c6bdec7338fb8b6a4ebd8ebb8d761..0397cf28b9685890ece35efebd28091a5b47ad58 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h @@ -218,10 +218,20 @@ namespace armarx /// Get the topic. DebugDrawerInterfacePrx getTopic() const; - /// Call offeringTopic([topicName]) on the given component. - void offeringTopic(ManagedIceObject& component) const; - /// Get the topic by calling getTopic([topicName]) on the given component. - void getTopic(ManagedIceObject& component); + /** + * @brief Call offeringTopic([topicName]) on the given component. + * @param component The component (`*this` when called from a component). + * @param topicNameOverride Optional override for the topic name. If left empty (default), + * uses the standard topic name (see `TOPIC_NAME`). + */ + void offeringTopic(ManagedIceObject& component, const std::string& topicNameOverride = "") const; + /** + * @brief Get the topic by calling getTopic([topicName]) on the given component. + * @param component The component (`*this` when called from a component). + * @param topicNameOverride Optional override for the topic name. If left empty (default), + * uses the standard topic name (see `TOPIC_NAME`). + */ + void getTopic(ManagedIceObject& component, const std::string& topicNameOverride = ""); /// Get the default layer (used if no layer is passed to a method). const std::string& getLayer() const;