From f21885c36ebe03cf0daff8a6db1304ee4911a107 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Wed, 7 Oct 2015 10:36:01 +0200
Subject: [PATCH] Make Egdge::configConstraint public and add
 GraphComponent::parentGraph

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

diff --git a/include/hpp/manipulation/graph/edge.hh b/include/hpp/manipulation/graph/edge.hh
index ad53938..06b1855 100644
--- a/include/hpp/manipulation/graph/edge.hh
+++ b/include/hpp/manipulation/graph/edge.hh
@@ -102,6 +102,10 @@ namespace hpp {
           /// Print the object in a stream.
           virtual std::ostream& dotPrint (std::ostream& os, dot::DrawingAttributes da = dot::DrawingAttributes ()) const;
 
+          /// Constraint to project onto the same leaf as config.
+          /// \return The initialized projector.
+          ConstraintSetPtr_t configConstraint() const;
+
         protected:
           /// Initialization of the object.
           void init (const EdgeWkPtr_t& weak, const GraphWkPtr_t& graph, const NodeWkPtr_t& from,
@@ -111,10 +115,6 @@ namespace hpp {
           Edge (const std::string& name,
 		const core::SteeringMethodPtr_t& steeringMethod);
 
-          /// Constraint to project onto the same leaf as config.
-          /// \return The initialized projector.
-          ConstraintSetPtr_t configConstraint() const;
-
           /// Constraint to project a path.
           /// \return The initialized constraint.
           ConstraintSetPtr_t pathConstraint() const;
diff --git a/include/hpp/manipulation/graph/graph-component.hh b/include/hpp/manipulation/graph/graph-component.hh
index 4e6d907..9a5a373 100644
--- a/include/hpp/manipulation/graph/graph-component.hh
+++ b/include/hpp/manipulation/graph/graph-component.hh
@@ -91,6 +91,9 @@ namespace hpp {
           /// Set the parent graph.
           void parentGraph(const GraphWkPtr_t& parent);
 
+          /// Set the parent graph.
+          GraphPtr_t parentGraph() const;
+
           /// Print the component in DOT language.
           virtual std::ostream& dotPrint (std::ostream& os, dot::DrawingAttributes da = dot::DrawingAttributes ()) const;
 
diff --git a/src/graph/graph-component.cc b/src/graph/graph-component.cc
index 405462f..b7b92cd 100644
--- a/src/graph/graph-component.cc
+++ b/src/graph/graph-component.cc
@@ -117,6 +117,11 @@ namespace hpp {
         return lockedJoints_;
       }
 
+      GraphPtr_t GraphComponent::parentGraph() const
+      {
+        return graph_.lock ();
+      }
+
       void GraphComponent::parentGraph(const GraphWkPtr_t& parent)
       {
         graph_ = parent;
-- 
GitLab