Defines a line segment on a plane. More...
#include <geometry_utils.h>
Public Member Functions | |
DiscreteLine2D (const Point &start, const Point &end) | |
const std::vector< Point > & | points () const |
Returns the line's component points. | |
Private Member Functions | |
void | generatePointsWithBresenham (int x1, int y1, int x2, int y2) |
Private Attributes | |
std::vector< Point > | _points |
Defines a line segment on a plane.
Definition at line 97 of file geometry_utils.h.
DiscreteLine2D::DiscreteLine2D | ( | const Point & | start, |
const Point & | end | ||
) | [inline] |
Initializes a segment with end points.
start | Beginning of a segment. |
end | Ending of a segment. |
Definition at line 106 of file geometry_utils.h.
void DiscreteLine2D::generatePointsWithBresenham | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) | [inline, private] |
Creates a line segment on a grid with a Bresenham algorithm; if the World consists of cells, it is required to transform coordinates of segment in a view that is useful for this representation of the world; the result can be obtained by points() method.
x1,y1 | Coordinates of the beginning of a line segment. |
x2,y2 | Coordinates of the ending of a line segment. |
Definition at line 121 of file geometry_utils.h.
const std::vector<Point>& DiscreteLine2D::points | ( | ) | const [inline] |
Returns the line's component points.
Definition at line 110 of file geometry_utils.h.
std::vector<Point> DiscreteLine2D::_points [private] |
Definition at line 169 of file geometry_utils.h.