diff --git a/include/hpp/manipulation/graph/fwd.hh b/include/hpp/manipulation/graph/fwd.hh index 5902917e0fa8d22eac57ddca619768f97b1ad7dd..22cb327cc81181cd0e70faf75c129da4fd9b933c 100644 --- a/include/hpp/manipulation/graph/fwd.hh +++ b/include/hpp/manipulation/graph/fwd.hh @@ -18,15 +18,22 @@ # define HPP_MANIPULATION_GRAPH_FWD_HH #include <hpp/util/pointer.hh> +#include <vector> namespace hpp { namespace manipulation { namespace graph { + HPP_PREDEF_CLASS (Graph); HPP_PREDEF_CLASS (Node); HPP_PREDEF_CLASS (Edge); HPP_PREDEF_CLASS (NodeSelector); + typedef boost::shared_ptr < Graph > GraphPtr_t; + typedef boost::shared_ptr < Node > NodePtr_t; typedef boost::shared_ptr < Edge > EdgePtr_t; typedef boost::shared_ptr < NodeSelector > NodeSelectorPtr_t; + typedef std::vector < NodePtr_t > Nodes_t; + typedef std::vector < EdgePtr_t > Edges_t; + typedef std::vector < NodeSelectorPtr_t > NodeSelectors_t; typedef hpp::core::ConstraintSet ConstraintSet_t; typedef hpp::core::ConstraintSetPtr_t ConstraintSetPtr_t; diff --git a/include/hpp/manipulation/graph/graph.hh b/include/hpp/manipulation/graph/graph.hh index 5ff9e4a12ed44ba0a87b0b7ba8937e7d6548dd35..22a005159c6ae23473cc8c1097e7f5049966d329 100644 --- a/include/hpp/manipulation/graph/graph.hh +++ b/include/hpp/manipulation/graph/graph.hh @@ -14,7 +14,6 @@ // received a copy of the GNU Lesser General Public License along with // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. - #ifndef HPP_MANIPULATION_GRAPHGRAPH_HH # define HPP_MANIPULATION_GRAPHGRAPH_HH @@ -30,6 +29,11 @@ namespace hpp { class HPP_MANIPULATION_DLLAPI Graph { public: + /// Returns the states of a configuration. + virtual Nodes_t getNode(const Configuration_t config) const; + + /// Select randomly outgoing edges of the given nodes. + virtual Edges_t chooseEdge(const Nodes_t& node) const; private: /// This list contains a node selector for each end-effector. @@ -38,7 +42,7 @@ namespace hpp { /// A set of constraints that will always be used, for example /// stability constraints. ConstraintSetPtr_t constraints_; - } + }; // Class Graph } // namespace graph } // namespace manipulation } // namespace hpp diff --git a/include/hpp/manipulation/graph/node-selector.hh b/include/hpp/manipulation/graph/node-selector.hh index b507cfcdf368c0a3a837547f5de214667c884533..e8a2757073ec1204e77a69850ee04436b77f3e5c 100644 --- a/include/hpp/manipulation/graph/node-selector.hh +++ b/include/hpp/manipulation/graph/node-selector.hh @@ -29,12 +29,15 @@ namespace hpp { { public: /// Returns the state of a configuration. - virtual Node getState(const Configuration_t config) const; + virtual NodePtr_t getNode(const Configuration_t config) const; + + /// Select randomly an outgoing edge of the given node. + virtual EdgePtr_t chooseEdge(const NodePtr_t& node) const; private: /// List of the states of one end-effector, ordered by priority. std::vector< NodeWkPtr_t > orderedStates_; - }; // + }; // Class NodeSelector } // namespace graph } // namespace manipulation } // namespace hpp