From e6a6809d1e22a2d2bc9f9f76f58fd14f48e8d4ad Mon Sep 17 00:00:00 2001
From: hdallard <hdallard@laas.fr>
Date: Thu, 2 Jun 2016 10:30:09 +0200
Subject: [PATCH] Pass a list of rules in graph autoBuild

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

diff --git a/include/hpp/manipulation/graph/helper.hh b/include/hpp/manipulation/graph/helper.hh
index 6ad3c14..fef32a1 100644
--- a/include/hpp/manipulation/graph/helper.hh
+++ b/include/hpp/manipulation/graph/helper.hh
@@ -98,6 +98,18 @@ namespace hpp {
           WithPrePlace = 1 << 4
         };
 
+	struct Rule {
+	  std::string gripper_;
+	  std::string handle_;
+	  bool link_;
+	  Rule() : gripper_(""), handle_(""), link_(false) {}
+	  Rule(std::string gripper, std::string handle, bool link) {
+	    gripper_ = gripper;
+	    handle_ = handle;
+	    link_ = link;
+	  }
+	};
+
         /// Create edges according to the case.
         /// gCase is a logical OR combination of GraspingCase and PlacementCase
         ///
@@ -191,6 +203,7 @@ namespace hpp {
             const StringList_t& griNames,
             const std::list <ObjectDef_t>& objs,
             const StringList_t& envNames,
+	    const std::vector<Rule>& rules,
             const value_type& prePlaceWidth = 0.05);
         /// \}
       } // namespace helper
diff --git a/src/graph/helper.cc b/src/graph/helper.cc
index eb8a2ee..b705dd5 100644
--- a/src/graph/helper.cc
+++ b/src/graph/helper.cc
@@ -878,6 +878,7 @@ namespace hpp {
             const StringList_t& griNames,
             const std::list <ObjectDef_t>& objs,
             const StringList_t& envNames,
+	    const std::vector <Rule>& rules,
             const value_type& prePlaceWidth)
         {
           const Device& robot = *(ps->robot ());
-- 
GitLab