From c148c790e07d2ef980d5c759668f8ba1f1fff264 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Thu, 15 Jan 2015 17:11:35 +0100
Subject: [PATCH] Node::dotPrint also prints the NumericalConstraints_t for
 Path.

---
 include/hpp/manipulation/graph/node.hh |  2 ++
 src/graph/node.cc                      | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/hpp/manipulation/graph/node.hh b/include/hpp/manipulation/graph/node.hh
index 85ddb266..8973f302 100644
--- a/include/hpp/manipulation/graph/node.hh
+++ b/include/hpp/manipulation/graph/node.hh
@@ -126,6 +126,8 @@ namespace hpp {
           /// Print the object in a stream.
           std::ostream& print (std::ostream& os) const;
 
+          virtual void populateTooltip (dot::Tooltip& tp) const;
+
         private:
           /// List of possible motions from this state (i.e. the outgoing
           /// vertices).
diff --git a/src/graph/node.cc b/src/graph/node.cc
index 0d629206..24c929a8 100644
--- a/src/graph/node.cc
+++ b/src/graph/node.cc
@@ -16,6 +16,8 @@
 
 #include "hpp/manipulation/graph/node.hh"
 
+#include <hpp/constraints/differentiable-function.hh>
+
 #include "hpp/manipulation/robot.hh"
 #include "hpp/manipulation/graph/edge.hh"
 #include "hpp/manipulation/graph/graph.hh"
@@ -81,6 +83,17 @@ namespace hpp {
         return os;
       }
 
+      void Node::populateTooltip (dot::Tooltip& tp) const
+      {
+        GraphComponent::populateTooltip (tp);
+        tp.addLine ("");
+        tp.addLine ("Numerical constraints for paths are:");
+        for (NumericalConstraints_t::const_iterator it = numericalConstraintsForPath_.begin ();
+            it != numericalConstraintsForPath_.end (); ++it) {
+          tp.addLine ("- " + (*it)->function ().name ());
+        }
+      }
+
       std::ostream& Node::print (std::ostream& os) const
       {
         os << "|   |-- ";
-- 
GitLab