diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp index ad714afa3ba800ac9980e041cd186f0ac13af4cc..24db3fe0fabbb12aaa14723a9148e7f423852830 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.cpp @@ -23,6 +23,11 @@ namespace armarx layer(layer), name(name) {} + DebugDrawerTopic::VisuID DebugDrawerTopic::VisuID::withName(const std::string& newName) const + { + return VisuID(this->layer, newName); + } + std::ostream& operator<<(std::ostream& os, const DebugDrawerTopic::VisuID& rhs) { os << "Visu '" << rhs.name << "' on layer '" << rhs.layer << "'"; diff --git a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h index eba4ec519fd01a31e0e31717e5398227dee5d14c..2dd3b8f3751c47cce2c099753844befb5dd2d9ad 100644 --- a/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h +++ b/source/RobotAPI/libraries/core/visualization/DebugDrawerTopic.h @@ -162,6 +162,8 @@ namespace armarx */ struct VisuID { + public: + /// Empty constructor. VisuID(); @@ -175,11 +177,17 @@ namespace armarx VisuID(const Source& name) : VisuID(std::string(name)) {} - std::string layer = ""; ///< The layer name (empty by default). - std::string name = ""; ///< The visu name (empty by default). + + /// Get a `VisuID` with the given name and same layer as `*this. + VisuID withName(const std::string& name) const; /// Streams a short human-readable description of `rhs` to `os`. friend std::ostream& operator<<(std::ostream& os, const VisuID& rhs); + + public: + + std::string layer = ""; ///< The layer name (empty by default). + std::string name = ""; ///< The visu name (empty by default). };