Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DiscreteLine2D Class Reference

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. More...
 

Private Types

using Point = DiscretePoint2D
 

Private Member Functions

void generatePointsWithBresenham (int x1, int y1, int x2, int y2)
 

Private Attributes

std::vector< Point_points
 

Detailed Description

Defines a line segment on a plane.

Definition at line 97 of file geometry_utils.h.

Member Typedef Documentation

Definition at line 98 of file geometry_utils.h.

Constructor & Destructor Documentation

DiscreteLine2D::DiscreteLine2D ( const Point start,
const Point end 
)
inline

Initializes a segment with end points.

Parameters
startBeginning of a segment.
endEnding of a segment.

Definition at line 106 of file geometry_utils.h.

Member Function Documentation

void DiscreteLine2D::generatePointsWithBresenham ( int  x1,
int  y1,
int  x2,
int  y2 
)
inlineprivate

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.

Parameters
x1,y1Coordinates of the beginning of a line segment.
x2,y2Coordinates 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.

Member Data Documentation

std::vector<Point> DiscreteLine2D::_points
private

Definition at line 169 of file geometry_utils.h.


The documentation for this class was generated from the following file:


tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57