added several grid-walks
added new helper methods/classes (e.g. for heading) new test cases optimize the dijkstra cleanups/refactoring added timed-benchmarks to the log many more...
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <cmath>
|
||||
#include "../geo/Point3.h"
|
||||
|
||||
#include <KLib/Assertions.h>
|
||||
|
||||
struct GridPoint {
|
||||
|
||||
/** x-position (in centimeter) */
|
||||
@@ -42,6 +44,13 @@ struct GridPoint {
|
||||
/** cast to string */
|
||||
operator std::string() const {return "(" + std::to_string(x_cm) + "," + std::to_string(y_cm) + "," + std::to_string(z_cm) + ")";}
|
||||
|
||||
/** read-only array access */
|
||||
float operator [] (const int idx) const {
|
||||
_assertBetween(idx, 0, 2, "index out of bounds");
|
||||
if (0 == idx) {return x_cm;}
|
||||
if (1 == idx) {return y_cm;}
|
||||
{return z_cm;}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user