From e12d94361fa1e9cef8ef5dfdde492b747d79b74e Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 5 Apr 2013 01:48:51 +0200 Subject: digital/io-hub/src/apbirthday: refine Path interface --- digital/io-hub/src/common-cc/path.hh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'digital/io-hub/src') diff --git a/digital/io-hub/src/common-cc/path.hh b/digital/io-hub/src/common-cc/path.hh index 3c3cce9c..3c281e46 100644 --- a/digital/io-hub/src/common-cc/path.hh +++ b/digital/io-hub/src/common-cc/path.hh @@ -30,11 +30,23 @@ class Path { public: + /// Reset path computation, remove every obstacles. void reset () { } - void obstacle (int index, vect_t c, int r, int factor = 0) { } + /// Set an obstacle position, radius and factor. + void obstacle (int index, const vect_t &c, int r, int factor = 0) { } + /// Set path source and destination. void endpoints (const vect_t &src, const vect_t &dst) { dst_ = dst; } + /// Compute path with the given escape factor. void compute (int factor = 0) { } + /// Get next point in computed path, return false if none (no path found + /// or last point given yet). bool get_next (vect_t &p) { p = dst_; return true; } + /// Prepare score compuration for the given source, with given escape + /// factor. + void prepare_score (const vect_t &src, int factor = 0); + /// Return score for a given destination, using a previous preparation + /// (also reuse previously given escape factor). + int get_score (const vect_t &dst); private: vect_t dst_; }; -- cgit v1.2.3