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

Add Edge::canConnect

parent 2065178a
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,8 @@ namespace hpp {
virtual bool applyConstraints (ConfigurationIn_t qoffset, ConfigurationOut_t q) const;
virtual bool canConnect (ConfigurationIn_t q1, ConfigurationIn_t q2) const;
virtual bool build (core::PathPtr_t& path, ConfigurationIn_t q1,
ConfigurationIn_t q2) const;
......@@ -204,6 +206,8 @@ namespace hpp {
virtual bool direction (const core::PathPtr_t& path) const;
virtual bool canConnect (ConfigurationIn_t q1, ConfigurationIn_t q2) const;
virtual bool build (core::PathPtr_t& path, ConfigurationIn_t q1, ConfigurationIn_t q2) const;
virtual bool applyConstraints (ConfigurationIn_t qoffset, ConfigurationOut_t q) const;
......
......@@ -256,6 +256,17 @@ namespace hpp {
return constraint;
}
bool Edge::canConnect (ConfigurationIn_t q1, ConfigurationIn_t q2)
const
{
ConstraintSetPtr_t constraints = pathConstraint ();
constraints->configProjector ()->rightHandSideFromConfig(q1);
if (!constraints->isSatisfied (q1) || !constraints->isSatisfied (q2)) {
return false;
}
return true;
}
bool Edge::build (core::PathPtr_t& path, ConfigurationIn_t q1,
ConfigurationIn_t q2)
const
......@@ -311,6 +322,11 @@ namespace hpp {
wkPtr_ = weak;
}
bool WaypointEdge::canConnect (ConfigurationIn_t q1, ConfigurationIn_t q2) const
{
return waypoint_.first->canConnect (q1, q2) && Edge::canConnect (q1, q2);
}
bool WaypointEdge::build (core::PathPtr_t& path, ConfigurationIn_t q1,
ConfigurationIn_t q2) 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