TwiceAsNice
2019-02-18
|
This class represents a polygon, a sequence of connected lines. More...
#include <NicePolygon.h>
Public Member Functions | |
NicePolygon () | |
Default ctor. More... | |
NicePolygon (const SeqLine &linetrain) | |
construct the polyogn from a sequence of consecutive lines. More... | |
void | append (const Nice::Point &pt) |
extend the polygon by adding a point at the end. More... | |
void | close () |
Close the polygon by adding a line from the last to the first point. More... | |
Nice::Line | lineSeg (int idx) const |
retrieve the idx-th line segment. More... | |
Nice::Line::IntersectType | intersect (const Nice::NicePolygon &oth) const |
Check whether any of the line segments intersects with another polygon. More... | |
NicePolygon () | |
NicePolygon (const SeqLine &linetrain) | |
void | append (const Nice::Point &pt) |
void | close () |
Nice::Line | lineSeg (int idx) const |
Nice::Line::IntersectType | intersect (const Nice::NicePolygon &oth) const |
Public Attributes | |
std::vector< Nice::Point > | pts |
The sequence of points that define the polygon. More... | |
This class represents a polygon, a sequence of connected lines.
Nice::NicePolygon::NicePolygon | ( | ) |
Default ctor.
This defines a polygon without points.
construct the polyogn from a sequence of consecutive lines.
linetrain | The line segments that define the polygon. The ctor assumes that the end point of each segment is equal to the start point of the next segment, without checking this assumption. |
Nice::NicePolygon::NicePolygon | ( | ) |
void Nice::NicePolygon::append | ( | const Nice::Point & | pt | ) |
extend the polygon by adding a point at the end.
pt | The additional point to be appended. |
void Nice::NicePolygon::append | ( | const Nice::Point & | pt | ) |
void Nice::NicePolygon::close | ( | void | ) |
Close the polygon by adding a line from the last to the first point.
void Nice::NicePolygon::close | ( | ) |
Nice::Line::IntersectType Nice::NicePolygon::intersect | ( | const Nice::NicePolygon & | oth | ) | const |
Nice::Line::IntersectType Nice::NicePolygon::intersect | ( | const Nice::NicePolygon & | oth | ) | const |
Check whether any of the line segments intersects with another polygon.
All line segments of this are checked for intersection with the line segments of the other polygon.
oth | The other polygon. |
Nice::Line Nice::NicePolygon::lineSeg | ( | int | idx | ) | const |
retrieve the idx-th line segment.
idx | The 0-based line segment |
Nice::Line Nice::NicePolygon::lineSeg | ( | int | idx | ) | const |
std::vector< Nice::Point > Nice::NicePolygon::pts |
The sequence of points that define the polygon.