From 95a7f84cc6b82476f88ea780d1238ce37a7ccc69 Mon Sep 17 00:00:00 2001
From: hdallard <hdallard@laas.fr>
Date: Mon, 13 Jun 2016 17:52:28 +0200
Subject: [PATCH] Add function to reset constraints

---
 include/hpp/manipulation/graph/graph-component.hh |  6 ++++++
 src/graph/graph-component.cc                      | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/hpp/manipulation/graph/graph-component.hh b/include/hpp/manipulation/graph/graph-component.hh
index 409286ba..502c8093 100644
--- a/include/hpp/manipulation/graph/graph-component.hh
+++ b/include/hpp/manipulation/graph/graph-component.hh
@@ -73,10 +73,16 @@ namespace hpp {
             (const DifferentiableFunctionPtr_t& function, const ComparisonTypePtr_t& ineq)
             HPP_MANIPULATION_DEPRECATED;
 
+	  /// Reset the numerical constraints stored in the component.
+	  virtual void resetNumericalConstraints ();
+
           /// Add core::LockedJoint constraint to the component.
           virtual void addLockedJointConstraint
 	    (const LockedJointPtr_t& constraint);
 
+	  /// Reset the locked joint in the component.
+	  virtual void resetLockedJoints ();
+
           /// Insert the numerical constraints in a ConfigProjector
           /// \return true is at least one NumericalConstraintPtr_t was inserted.
           bool insertNumericalConstraints (ConfigProjectorPtr_t& proj) const;
diff --git a/src/graph/graph-component.cc b/src/graph/graph-component.cc
index cadd9058..79a5c29d 100644
--- a/src/graph/graph-component.cc
+++ b/src/graph/graph-component.cc
@@ -75,12 +75,22 @@ namespace hpp {
         addNumericalConstraint (NumericalConstraint::create (function,ineq));
       }
 
+      void GraphComponent::resetNumericalConstraints ()
+      {
+	numericalConstraints_.clear();
+      }
+
       void GraphComponent::addLockedJointConstraint
       (const LockedJointPtr_t& constraint)
       {
         lockedJoints_.push_back (constraint);
       }
 
+      void GraphComponent::resetLockedJoints ()
+      {
+	lockedJoints_.clear();
+      }
+
       bool GraphComponent::insertNumericalConstraints (ConfigProjectorPtr_t& proj) const
       {
         IntervalsContainer_t::const_iterator itpdof = passiveDofs_.begin ();
-- 
GitLab