From c57f4609f8c2597c855629a39996fb81c921061a Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Thu, 25 Jul 2024 12:56:57 -0500 Subject: [PATCH] Make dotgraph label nojustify --- .../core/src/task_composer_data_storage.cpp | 8 ++++---- tesseract_task_composer/core/src/task_composer_graph.cpp | 6 ++++-- tesseract_task_composer/core/src/task_composer_node.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tesseract_task_composer/core/src/task_composer_data_storage.cpp b/tesseract_task_composer/core/src/task_composer_data_storage.cpp index 10b1f0262a..e4c420f39c 100644 --- a/tesseract_task_composer/core/src/task_composer_data_storage.cpp +++ b/tesseract_task_composer/core/src/task_composer_data_storage.cpp @@ -46,7 +46,7 @@ TaskComposerDataStorage::TaskComposerDataStorage(const TaskComposerDataStorage& std::shared_lock rhs_lock(other.mutex_, std::defer_lock); std::scoped_lock lock{ lhs_lock, rhs_lock }; - name_ = other.name_; + name_ = other.name_; // NOLINT(cppcoreguidelines-prefer-member-initializer) data_ = other.data_; // NOLINT(cppcoreguidelines-prefer-member-initializer) } @@ -57,7 +57,7 @@ TaskComposerDataStorage& TaskComposerDataStorage::operator=(const TaskComposerDa std::shared_lock rhs_lock(other.mutex_, std::defer_lock); std::scoped_lock lock{ lhs_lock, rhs_lock }; - name_ = other.name_; + name_ = other.name_; // NOLINT(cppcoreguidelines-prefer-member-initializer) data_ = other.data_; // NOLINT(cppcoreguidelines-prefer-member-initializer) return *this; } @@ -69,7 +69,7 @@ TaskComposerDataStorage::TaskComposerDataStorage(TaskComposerDataStorage&& other std::unique_lock rhs_lock(other.mutex_, std::defer_lock); std::scoped_lock lock{ lhs_lock, rhs_lock }; - name_ = std::move(other.name_); + name_ = std::move(other.name_); // NOLINT(cppcoreguidelines-prefer-member-initializer) data_ = std::move(other.data_); // NOLINT(cppcoreguidelines-prefer-member-initializer) } @@ -80,7 +80,7 @@ TaskComposerDataStorage& TaskComposerDataStorage::operator=(TaskComposerDataStor std::unique_lock rhs_lock(other.mutex_, std::defer_lock); std::scoped_lock lock{ lhs_lock, rhs_lock }; - name_ = std::move(other.name_); + name_ = std::move(other.name_); // NOLINT(cppcoreguidelines-prefer-member-initializer) data_ = std::move(other.data_); // NOLINT(cppcoreguidelines-prefer-member-initializer) return *this; } diff --git a/tesseract_task_composer/core/src/task_composer_graph.cpp b/tesseract_task_composer/core/src/task_composer_graph.cpp index 9bc4e282ca..3010a4c7d8 100644 --- a/tesseract_task_composer/core/src/task_composer_graph.cpp +++ b/tesseract_task_composer/core/src/task_composer_graph.cpp @@ -352,7 +352,8 @@ TaskComposerGraph::dump(std::ostream& os, std::ostringstream sub_graphs; const std::string tmp = toString(uuid_); - os << "subgraph cluster_" << tmp << " {\n color=black;\n label = \"" << name_ << "\\nUUID: " << uuid_str_ << "\\n"; + os << "subgraph cluster_" << tmp << " {\n color=black;\n nojustify=true label = \"" << name_ + << "\\nUUID: " << uuid_str_ << "\\l"; os << "Inputs:\\l" << input_keys_; os << "Outputs:\\l" << output_keys_; os << "Conditional: " << ((conditional_) ? "True" : "False") << "\\l"; @@ -378,7 +379,8 @@ TaskComposerGraph::dump(std::ostream& os, const TaskComposerKeys& input_keys = node->getInputKeys(); const TaskComposerKeys& output_keys = node->getOutputKeys(); os << std::endl - << tmp << " [shape=box3d, label=\"Subgraph: " << node->name_ << "\\nUUID: " << node->uuid_str_ << "\\n"; + << tmp << " [shape=box3d, nojustify=true label=\"Subgraph: " << node->name_ << "\\nUUID: " << node->uuid_str_ + << "\\l"; os << "Inputs:\\l" << input_keys; os << "Outputs:\\l" << output_keys; os << "Conditional: " << ((node->isConditional()) ? "True" : "False") << "\\l"; diff --git a/tesseract_task_composer/core/src/task_composer_node.cpp b/tesseract_task_composer/core/src/task_composer_node.cpp index 48032bb09a..7352f376bf 100644 --- a/tesseract_task_composer/core/src/task_composer_node.cpp +++ b/tesseract_task_composer/core/src/task_composer_node.cpp @@ -362,8 +362,8 @@ TaskComposerNode::dump(std::ostream& os, if (conditional_) { - os << std::endl << tmp << " [shape=diamond, label=\"" << name_ << "\\n"; - os << "UUID: " << uuid_str_ << "\\n"; + os << std::endl << tmp << " [shape=diamond, nojustify=true label=\"" << name_ << "\\n"; + os << "UUID: " << uuid_str_ << "\\l"; os << "Namespace: " << ns_ << "\\l"; os << "Inputs:\\l" << input_keys_; os << "Outputs:\\l" << output_keys_; @@ -386,8 +386,8 @@ TaskComposerNode::dump(std::ostream& os, } else { - os << std::endl << tmp << " [label=\"" << name_ << "\\n"; - os << "UUID: " << uuid_str_ << "\\n"; + os << std::endl << tmp << " [nojustify=true label=\"" << name_ << "\\n"; + os << "UUID: " << uuid_str_ << "\\l"; os << "Namespace: " << ns_ << "\\l"; os << "Inputs:\\l" << input_keys_; os << "Outputs:\\l" << output_keys_;