 |
Cytopia
0.3
A city building simulation game
|
Go to the documentation of this file. 1 #ifndef POINTFUNCTIONS_HXX_
2 #define POINTFUNCTIONS_HXX_
5 #include "../../util/LOG.hxx"
6 #include "betterEnums.hxx"
9 BETTER_ENUM(NeighborNodesPosition,
unsigned char, BOTTOM_LEFT = 1U << 6, LEFT = 1U << 2, TOP_LEFT = 1U << 4, BOTTOM = 1U << 1,
10 CENTER = 0U, TOP = 1U, BOTTOM_RIGHT = 1U << 7, RIGHT = 1U << 3, TOP_RIGHT = 1U << 5);
20 static std::vector<Point>
getLine(
Point isoCoordinatesStart,
Point isoCoordinatesEnd);
34 static std::vector<Point>
getArea(
const Point &isoCoordinatesStart,
const Point &isoCoordinatesEnd);
41 static std::vector<Point>
getNeighbors(
const Point &isoCoordinates,
const bool includeCentralNode,
int distance = 1);
BETTER_ENUM(NeighborNodesPosition, unsigned char, BOTTOM_LEFT=1U<< 6, LEFT=1U<< 2, TOP_LEFT=1U<< 4, BOTTOM=1U<< 1, CENTER=0U, TOP=1U, BOTTOM_RIGHT=1U<< 7, RIGHT=1U<< 3, TOP_RIGHT=1U<< 5)
static std::vector< Point > getArea(const Point &isoCoordinatesStart, const Point &isoCoordinatesEnd)
Gets all nodes in a rectangular area between start and end point.
static std::vector< Point > getLine(Point isoCoordinatesStart, Point isoCoordinatesEnd)
Creates a line between two points using the Bresenham Line algorithm.
static std::vector< Point > getStraightLine(const Point &isoCoordinatesStart, const Point &isoCoordinatesEnd)
Gets all nodes in a straight line from start and end point.
static std::vector< Point > getNeighbors(const Point &isoCoordinates, const bool includeCentralNode, int distance=1)
Get all neighboring coordinates from provided map node isocoordinate.
static NeighborNodesPosition getNeighborPositionToOrigin(const Point &neighboringPoint, const Point &originPoint)
Get the position of the neighboring node to the originpoint (center of the neighborgroup).