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

Update class Problem to use GraphPathValidation

parent 9a939cbb
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "hpp/manipulation/robot.hh" #include "hpp/manipulation/robot.hh"
#include "hpp/manipulation/graph/graph.hh" #include "hpp/manipulation/graph/graph.hh"
#include "hpp/manipulation/graph-path-validation.hh"
#include "hpp/manipulation/fwd.hh" #include "hpp/manipulation/fwd.hh"
namespace hpp { namespace hpp {
...@@ -25,16 +26,22 @@ namespace hpp { ...@@ -25,16 +26,22 @@ namespace hpp {
class HPP_MANIPULATION_DLLAPI Problem : public core::Problem class HPP_MANIPULATION_DLLAPI Problem : public core::Problem
{ {
public: public:
typedef core::Problem Parent;
/// Constructor /// Constructor
Problem (RobotPtr_t robot) : core::Problem (robot), Problem (RobotPtr_t robot) : core::Problem (robot),
graph_() graph_()
{ {
Parent::pathValidation (GraphPathValidation::create (Parent::pathValidation(), graph_));
} }
/// Set the graph of constraints /// Set the graph of constraints
void constraintGraph (const graph::GraphPtr_t& graph) void constraintGraph (const graph::GraphPtr_t& graph)
{ {
graph_ = graph; graph_ = graph;
GraphPathValidationPtr_t graphValidation = pathValidation();
if (graphValidation)
graphValidation->constraintGraph(graph);
} }
/// Get the graph of constraints /// Get the graph of constraints
...@@ -51,6 +58,11 @@ namespace hpp { ...@@ -51,6 +58,11 @@ namespace hpp {
throw std::runtime_error ("No graph in the problem."); throw std::runtime_error ("No graph in the problem.");
} }
/// Get the path validation as a GraphPathValidation
GraphPathValidationPtr_t pathValidation ()
{
return HPP_DYNAMIC_PTR_CAST (GraphPathValidation, Parent::pathValidation());
}
private: private:
/// The graph of constraints /// The graph of constraints
graph::GraphPtr_t graph_; graph::GraphPtr_t graph_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment