diff --git a/include/hpp/manipulation/graph/graph.hh b/include/hpp/manipulation/graph/graph.hh index 06dc7f71d1e4a0ccd4492ffa25587445ad635753..b4aa022471fa6ef70cc38ce11a9ade9734444c68 100644 --- a/include/hpp/manipulation/graph/graph.hh +++ b/include/hpp/manipulation/graph/graph.hh @@ -74,6 +74,35 @@ namespace hpp { return os; } + /// Add core::DifferentiableFunction to the component. + virtual void addNumericalConstraint (const DifferentiableFunctionPtr_t& function) + { + numericalConstraints_.push_back(function); + } + + /// Add core::LockedDof constraint to the component. + virtual void addLockedDofConstraint (const LockedDofPtr_t& constraint) + { + lockedDofConstraints_.push_back (constraint); + } + + /// Get a reference to the DifferentiableFunctions_t + const DifferentiableFunctions_t& numericalConstraints() const + { + return numericalConstraints_; + } + + /// Get a reference to the LockedDofs_t + const LockedDofs_t& lockedDofConstraints () const + { + return lockedDofConstraints_; + } + + /// Set the parent graph. + void parentGraph(const GraphWkPtr_t& parent) + { + graph_ = parent; + } protected: /// Initialize the component @@ -87,6 +116,13 @@ namespace hpp { GraphComponent() : id_(-1) {} + /// Stores the numerical constraints. + DifferentiableFunctions_t numericalConstraints_; + /// List of LockedDof constraints + LockedDofs_t lockedDofConstraints_; + /// A weak pointer to the parent graph. + GraphWkPtr_t graph_; + private: /// Keep track of the created components in order to retrieve them /// easily.