From 6cd5bcb73a975c05024d89b3a7b7e3b6c13ebc0d Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Thu, 12 Sep 2019 17:23:49 +0200
Subject: [PATCH] [Graph] Create default StateSelector at construction.

---
 include/hpp/manipulation/graph/graph-component.hh | 1 +
 include/hpp/manipulation/graph/graph.hh           | 4 +---
 src/graph/graph.cc                                | 6 ++++++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/hpp/manipulation/graph/graph-component.hh b/include/hpp/manipulation/graph/graph-component.hh
index f5ea14d..b4da298 100644
--- a/include/hpp/manipulation/graph/graph-component.hh
+++ b/include/hpp/manipulation/graph/graph-component.hh
@@ -21,6 +21,7 @@
 # include <ostream>
 
 # include "hpp/manipulation/config.hh"
+# include "hpp/manipulation/deprecated.hh"
 # include "hpp/manipulation/fwd.hh"
 # include "hpp/manipulation/graph/fwd.hh"
 # include "hpp/manipulation/graph/dot.hh"
diff --git a/include/hpp/manipulation/graph/graph.hh b/include/hpp/manipulation/graph/graph.hh
index c3c597f..ff07201 100644
--- a/include/hpp/manipulation/graph/graph.hh
+++ b/include/hpp/manipulation/graph/graph.hh
@@ -238,9 +238,7 @@ namespace hpp {
 
           /// Constructor
 	  /// \param sm a steering method to create paths from edges
-          Graph (const std::string& name, const ProblemPtr_t& problem) :
-	    GraphComponent (name), problem_ (problem)
-          {}
+          Graph (const std::string& name, const ProblemPtr_t& problem);
 
           /// Print the object in a stream.
           std::ostream& print (std::ostream& os) const;
diff --git a/src/graph/graph.cc b/src/graph/graph.cc
index 84d6f9a..3d5ba3b 100644
--- a/src/graph/graph.cc
+++ b/src/graph/graph.cc
@@ -35,6 +35,7 @@ namespace hpp {
         Graph* ptr = new Graph (name, problem);
         GraphPtr_t shPtr (ptr);
         ptr->init (shPtr, robot);
+        shPtr->createStateSelector (name);
         return shPtr;
       }
 
@@ -242,6 +243,11 @@ namespace hpp {
         return components_;
       }
 
+      Graph::Graph (const std::string& name, const ProblemPtr_t& problem) :
+        GraphComponent (name), problem_ (problem)
+      {
+      }
+
       std::ostream& Graph::dotPrint (std::ostream& os, dot::DrawingAttributes da) const
       {
         da.separator = "; ";
-- 
GitLab