From 672720b5a6e02672420cdae13e99108b67b9fd35 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Wed, 26 Jul 2017 15:48:25 +0200
Subject: [PATCH] Remove deprecated methods and compilation warnings

---
 include/hpp/manipulation/graph/edge.hh | 34 --------------------------
 src/graph-optimizer.cc                 |  2 +-
 src/graph/edge.cc                      |  6 -----
 src/path-optimization/keypoints.cc     | 20 +++++++--------
 src/path-optimization/small-steps.cc   |  4 +--
 5 files changed, 13 insertions(+), 53 deletions(-)

diff --git a/include/hpp/manipulation/graph/edge.hh b/include/hpp/manipulation/graph/edge.hh
index 25b0b95a..bfe54800 100644
--- a/include/hpp/manipulation/graph/edge.hh
+++ b/include/hpp/manipulation/graph/edge.hh
@@ -138,33 +138,6 @@ namespace hpp {
             state_ = state;
           }
 
-          /// Get the state in which path is.
-	  /// \deprecated use StatePtr_t state () const instead
-          StatePtr_t node () const
-          {
-            return state_.lock();
-          }
-
-	  /// Set state
-	  /// \deprecated use void state (StatePtr_t state) instead
-          void node (StatePtr_t state)
-          {
-            state_ = state;
-          }
-
-          /// \deprecated use state(StatePtr_t) instead.
-          void isInNodeFrom (bool iinf) HPP_MANIPULATION_DEPRECATED
-          {
-            if (iinf) state_ = from_;
-            else      state_ = to_;
-          }
-
-          /// \deprecated see StatePtr_t state() const
-          bool isInNodeFrom () const HPP_MANIPULATION_DEPRECATED
-          {
-            return state_.lock() == from_.lock();
-          }
-
 	  /// Get steering method associated to the edge.
 	  const core::SteeringMethodPtr_t& steeringMethod () const
 	  {
@@ -320,13 +293,6 @@ namespace hpp {
           /// \param wTo is the destination state of wEdge
           void setWaypoint (const std::size_t index, const EdgePtr_t wEdge, const StatePtr_t wTo);
 
-          /// Get the state in which path after the waypoint is.
-	  /// \deprecated use StatePtr_t state () const instead
-          StatePtr_t node () const;
-
-          /// Get the state in which path after the waypoint is.
-          StatePtr_t state () const;
-
         protected:
 	  WaypointEdge (const std::string& name) :
 	    Edge (name)
diff --git a/src/graph-optimizer.cc b/src/graph-optimizer.cc
index af602077..fa31e7f8 100644
--- a/src/graph-optimizer.cc
+++ b/src/graph-optimizer.cc
@@ -59,7 +59,7 @@ namespace hpp {
             hppDout(info, "No manipulation::ConstraintSet");
             break;
           }
-          if (c && edge->node() != c->edge ()->node()) break;
+          if (c && edge->state() != c->edge ()->state()) break;
           if (isShort != c->edge()->isShort()) // We do not optimize edges marked as short
             break;
           toOpt->appendPath (current);
diff --git a/src/graph/edge.cc b/src/graph/edge.cc
index ee6453a3..9741be1a 100644
--- a/src/graph/edge.cc
+++ b/src/graph/edge.cc
@@ -436,12 +436,6 @@ namespace hpp {
         waypoints_[index] = Waypoint_t (wEdge, wTo);
       }
 
-      StatePtr_t WaypointEdge::state () const
-      {
-        if (isInNodeFrom ()) return waypoints_.back().second;
-        else return to ();
-      }
-
       template <>
       EdgePtr_t WaypointEdge::waypoint <Edge> (const std::size_t index) const
       {
diff --git a/src/path-optimization/keypoints.cc b/src/path-optimization/keypoints.cc
index f0b16713..384750c1 100644
--- a/src/path-optimization/keypoints.cc
+++ b/src/path-optimization/keypoints.cc
@@ -62,7 +62,7 @@ namespace hpp {
           PathVectorPtr_t output = PathVector::create (path->outputSize (),
               path->outputDerivativeSize ());
           for (std::size_t j = 0; j < paths.size(); ++j)
-            output->concatenate (*paths[j].path);
+            output->concatenate (paths[j].path);
         }
         return output;
       }
@@ -89,7 +89,7 @@ namespace hpp {
               hppDout(info, "No manipulation::ConstraintSet");
               break;
             }
-            if (c && ikpp.edge->node() != c->edge ()->node()) break;
+            if (c && ikpp.edge->state() != c->edge ()->state()) break;
             if (ikpp.isShort != c->edge()->isShort()) // We do not optimize edges marked as short
               break;
             ikpp.path->appendPath (current);
@@ -120,7 +120,7 @@ namespace hpp {
         graph::Edges_t edges;
         graph::Graph& graph = *problem_.constraintGraph ();
         try {
-          edges = graph.getEdges (ikpp1.edge->node(), ikpp2.edge->node());
+          edges = graph.getEdges (ikpp1.edge->state(), ikpp2.edge->state());
         } catch (const std::logic_error& e) {
           hppDout (error, e.what ());
           return PathVectorPtr_t ();
@@ -169,12 +169,12 @@ namespace hpp {
 
                   PathVectorPtr_t tmp = PathVector::create (ikpp1.path->outputSize (),
                       ikpp1.path->outputDerivativeSize ());
-                  tmp->concatenate (*(ikpp1.path->extract
-                        (make_pair (t0, t1))-> as <PathVector> ()));
+                  tmp->concatenate (ikpp1.path->extract
+                        (make_pair (t0, t1))-> as <PathVector> ());
                   tmp->appendPath (short1);
                   tmp->appendPath (short2);
-                  tmp->concatenate (*(ikpp2.path->extract
-                        (make_pair (t4, t5))-> as <PathVector> ()));
+                  tmp->concatenate (ikpp2.path->extract
+                        (make_pair (t4, t5))-> as <PathVector> ());
 
                   if (cur_length >= tmp->length()) {
                     cur_length = tmp->length();
@@ -199,10 +199,10 @@ namespace hpp {
         PathVectorPtr_t output = PathVector::create (shortcut->outputSize (),
             shortcut->outputDerivativeSize ());
         for (std::size_t j = 0; j < i1; ++j)
-          output->concatenate (*input[j].path);
-        output->concatenate (*flat);
+          output->concatenate (input[j].path);
+        output->concatenate (flat);
         for (std::size_t j = i2 + 1; j < input.size(); ++j)
-          output->concatenate (*input[j].path);
+          output->concatenate (input[j].path);
 
         return split (output);
       }
diff --git a/src/path-optimization/small-steps.cc b/src/path-optimization/small-steps.cc
index 1ebf1ff1..0ae7baef 100644
--- a/src/path-optimization/small-steps.cc
+++ b/src/path-optimization/small-steps.cc
@@ -61,12 +61,12 @@ namespace hpp {
             current = flat->pathAtRank (i_e);
             c = HPP_DYNAMIC_PTR_CAST (ConstraintSet, current->constraints ());
             if (!c && edge) break;
-            if (c && edge->node() != c->edge ()->node()) break;
+            if (c && edge->state() != c->edge ()->state()) break;
             toOpt->appendPath (current);
           }
           toConcat = step.optimize (toOpt);
           i_s = i_e;
-          opted->concatenate (*toConcat);
+          opted->concatenate (toConcat);
         }
 
         const_cast <core::Problem&>(this->problem ()).pathValidation (gpv);
-- 
GitLab