Skip to content
Snippets Groups Projects
Commit 3c0cf959 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Node containing edges can be sepcified by the user.

parent 74d91cda
No related branches found
No related tags found
No related merge requests found
...@@ -85,17 +85,29 @@ namespace hpp { ...@@ -85,17 +85,29 @@ namespace hpp {
NodePtr_t from () const; NodePtr_t from () const;
/// Get the node in which path is. /// Get the node in which path is.
virtual NodePtr_t node () const; NodePtr_t node () const
{
return node_.lock();
}
void node (NodePtr_t node)
{
node_ = node;
}
void isInNodeFrom (bool iinf) /// \deprecated use node(NodePtr_t) instead.
void isInNodeFrom (bool iinf) HPP_MANIPULATION_DEPRECATED
{ {
isInNodeFrom_ = iinf; if (iinf) node_ = from_;
else node_ = to_;
} }
bool isInNodeFrom () const /// \deprecated see NodePtr_t node() const
bool isInNodeFrom () const HPP_MANIPULATION_DEPRECATED
{ {
return isInNodeFrom_; return node_.lock() == from_.lock();
} }
/// Get steering method associated to the edge. /// Get steering method associated to the edge.
const core::SteeringMethodPtr_t& steeringMethod () const const core::SteeringMethodPtr_t& steeringMethod () const
{ {
...@@ -158,7 +170,7 @@ namespace hpp { ...@@ -158,7 +170,7 @@ namespace hpp {
NodeWkPtr_t from_, to_; NodeWkPtr_t from_, to_;
/// True if this path is in node from, False if in node to /// True if this path is in node from, False if in node to
bool isInNodeFrom_; NodeWkPtr_t node_;
/// Steering method used to create paths associated to the edge /// Steering method used to create paths associated to the edge
SteeringMethod_t* steeringMethod_; SteeringMethod_t* steeringMethod_;
......
...@@ -57,12 +57,6 @@ namespace hpp { ...@@ -57,12 +57,6 @@ namespace hpp {
return from_.lock(); return from_.lock();
} }
NodePtr_t Edge::node () const
{
if (isInNodeFrom_) return from ();
else return to ();
}
bool Edge::direction (const core::PathPtr_t& path) const bool Edge::direction (const core::PathPtr_t& path) const
{ {
Configuration_t q0 = path->initial (), Configuration_t q0 = path->initial (),
...@@ -169,7 +163,7 @@ namespace hpp { ...@@ -169,7 +163,7 @@ namespace hpp {
wkPtr_ = weak; wkPtr_ = weak;
from_ = from; from_ = from;
to_ = to; to_ = to;
isInNodeFrom_ = false; node_ = to;
} }
std::ostream& Edge::print (std::ostream& os) const std::ostream& Edge::print (std::ostream& os) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment