From 24dbd8f0ae5f3c68ee45c9c7255b4521dee5dbf8 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Fri, 8 Aug 2014 17:52:10 +0200
Subject: [PATCH] Update class Problem to use GraphPathValidation

---
 include/hpp/manipulation/problem.hh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/hpp/manipulation/problem.hh b/include/hpp/manipulation/problem.hh
index 3d13961..615b429 100644
--- a/include/hpp/manipulation/problem.hh
+++ b/include/hpp/manipulation/problem.hh
@@ -18,6 +18,7 @@
 
 #include "hpp/manipulation/robot.hh"
 #include "hpp/manipulation/graph/graph.hh"
+#include "hpp/manipulation/graph-path-validation.hh"
 #include "hpp/manipulation/fwd.hh"
 
 namespace hpp {
@@ -25,16 +26,22 @@ namespace hpp {
     class HPP_MANIPULATION_DLLAPI Problem : public core::Problem
     {
       public:
+        typedef core::Problem Parent;
+
         /// Constructor
         Problem (RobotPtr_t robot) : core::Problem (robot),
-        graph_()
+          graph_()
         {
+          Parent::pathValidation (GraphPathValidation::create (Parent::pathValidation(), graph_));
         }
 
         /// Set the graph of constraints
         void constraintGraph (const graph::GraphPtr_t& graph)
         {
           graph_ = graph;
+          GraphPathValidationPtr_t graphValidation = pathValidation();
+          if (graphValidation)
+            graphValidation->constraintGraph(graph);
         }
 
         /// Get the graph of constraints
@@ -51,6 +58,11 @@ namespace hpp {
             throw std::runtime_error ("No graph in the problem.");
         }
 
+        /// Get the path validation as a GraphPathValidation
+        GraphPathValidationPtr_t pathValidation ()
+        {
+          return HPP_DYNAMIC_PTR_CAST (GraphPathValidation, Parent::pathValidation());
+        }
       private:
         /// The graph of constraints
         graph::GraphPtr_t graph_;
-- 
GitLab