Commit b5c2124a authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Refactoring] Update Roadmap API to previous change.

parent 5fae1110
......@@ -48,43 +48,75 @@ namespace hpp {
/// connected component with this node.
NodePtr_t addNode (const ConfigurationPtr_t& config);
NodePtr_t addNode (const Configuration_t& config)
{
return addNode (ConfigurationPtr_t (new Configuration_t(config)));
}
/// Get nearest node to a configuration in the roadmap.
/// \param configuration configuration
/// \param reverse if true, compute distance from given configuration to nodes in roadmap,
/// if false from nodes in roadmap to given configuration
/// \retval distance to the nearest node.
NodePtr_t nearestNode (const ConfigurationPtr_t& configuration,
NodePtr_t nearestNode (const Configuration_t& configuration,
value_type& minDistance, bool reverse = false);
NodePtr_t nearestNode (const ConfigurationPtr_t& configuration,
value_type& minDistance, bool reverse = false)
{
return nearestNode (*configuration, minDistance, reverse);
}
/// Get nearest node to a configuration in a connected component.
/// \param configuration configuration
/// \param connectedComponent the connected component
/// \param reverse if true, compute distance from given configuration to nodes in roadmap,
/// if false from nodes in roadmap to given configuration
/// \retval distance to the nearest node.
NodePtr_t nearestNode (const ConfigurationPtr_t& configuration,
NodePtr_t nearestNode (const Configuration_t& configuration,
const ConnectedComponentPtr_t& connectedComponent,
value_type& minDistance, bool reverse = false);
NodePtr_t nearestNode (const ConfigurationPtr_t& configuration,
const ConnectedComponentPtr_t& connectedComponent,
value_type& minDistance, bool reverse = false)
{
return nearestNode (*configuration, connectedComponent, minDistance, reverse);
}
/// Get nearest node to a configuration in the roadmap.
/// \param configuration configuration
/// \param k number of nearest nodes to return
/// if false from nodes in roadmap to given configuration
/// \return k nearest nodes
Nodes_t nearestNodes (const ConfigurationPtr_t& configuration,
Nodes_t nearestNodes (const Configuration_t& configuration,
size_type k);
Nodes_t nearestNodes (const ConfigurationPtr_t& configuration,
size_type k)
{
return nearestNodes (*configuration, k);
}
/// Get nearest node to a configuration in a connected component.
/// \param configuration configuration
/// \param connectedComponent the connected component
/// \param k number of nearest nodes to return
/// if false from nodes in roadmap to given configuration
/// \return k nearest nodes in the connected component
Nodes_t nearestNodes (const ConfigurationPtr_t& configuration,
Nodes_t nearestNodes (const Configuration_t& configuration,
const ConnectedComponentPtr_t&
connectedComponent,
size_type k);
Nodes_t nearestNodes (const ConfigurationPtr_t& configuration,
const ConnectedComponentPtr_t&
connectedComponent,
size_type k)
{
return nearestNodes (*configuration, connectedComponent, k);
}
/// Add a node and two edges
/// \param from node from which the edge starts,
/// \param to configuration to which the edge stops
......
......@@ -180,7 +180,7 @@ namespace hpp {
}
NodePtr_t
Roadmap::nearestNode (const ConfigurationPtr_t& configuration,
Roadmap::nearestNode (const Configuration_t& configuration,
value_type& minDistance, bool reverse)
{
NodePtr_t closest = 0x0;
......@@ -200,7 +200,7 @@ namespace hpp {
}
NodePtr_t
Roadmap::nearestNode (const ConfigurationPtr_t& configuration,
Roadmap::nearestNode (const Configuration_t& configuration,
const ConnectedComponentPtr_t& connectedComponent,
value_type& minDistance, bool reverse)
{
......@@ -211,7 +211,7 @@ namespace hpp {
return closest;
}
Nodes_t Roadmap::nearestNodes (const ConfigurationPtr_t& configuration,
Nodes_t Roadmap::nearestNodes (const Configuration_t& configuration,
size_type k)
{
value_type d;
......@@ -219,7 +219,7 @@ namespace hpp {
d);
}
Nodes_t Roadmap::nearestNodes (const ConfigurationPtr_t& configuration,
Nodes_t Roadmap::nearestNodes (const Configuration_t& configuration,
const ConnectedComponentPtr_t&
connectedComponent,
size_type k)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment