Adaptagrams
|
A Rectangle, a simpler way to define the polygon for square or rectangular shapes. More...
#include <geomtypes.h>
Public Member Functions | |
Rectangle (const Point &topLeft, const Point &bottomRight) | |
Constructs a rectangular polygon given two opposing corner points. More... | |
Rectangle (const Point ¢re, const double width, const double height) | |
Constructs a rectangular polygon given the centre, width and height. More... | |
Public Member Functions inherited from Avoid::Polygon | |
Polygon () | |
Constructs an empty polygon (with zero points). | |
Polygon (const int n) | |
Constructs a new polygon with n points. More... | |
Polygon (const PolygonInterface &poly) | |
Constructs a new polygon from an existing Polygon. More... | |
void | clear (void) |
Resets this to the empty polygon. | |
bool | empty (void) const |
Returns true if this polygon is empty. | |
size_t | size (void) const |
Returns the number of points in this polygon. | |
int | id (void) const |
Returns the ID value associated with this polygon. | |
const Point & | at (size_t index) const |
Returns a specific point in the polygon. More... | |
void | setPoint (size_t index, const Point &point) |
Sets a position for a particular point in the polygon.. More... | |
Polygon | simplify (void) const |
Returns a simplified Polyline, where all collinear line segments have been collapsed down into single line segments. More... | |
Polygon | curvedPolyline (const double curve_amount, const bool closed=false) const |
Returns a curved approximation of this multi-segment PolyLine, with the corners replaced by smooth Bezier curves. More... | |
void | translate (const double xDist, const double yDist) |
Translates the polygon position by a relative amount. More... | |
Public Member Functions inherited from Avoid::PolygonInterface | |
PolygonInterface () | |
Constructor. | |
virtual | ~PolygonInterface () |
Destructor. | |
Polygon | boundingRectPolygon (void) const |
Returns the bounding rectangle for this polygon. More... | |
Box | offsetBoundingBox (double offset) const |
Returns the bounding rectangle that contains this polygon with optionally some buffer space around it for routing. More... | |
Additional Inherited Members | |
Public Attributes inherited from Avoid::Polygon | |
int | _id |
An ID for the polygon. | |
std::vector< Point > | ps |
A vector of the points that make up the Polygon. | |
std::vector< char > | ts |
If used, denotes whether the corresponding point in ps is a move-to operation or a Bezier curve-to. More... | |
A Rectangle, a simpler way to define the polygon for square or rectangular shapes.
Constructs a rectangular polygon given two opposing corner points.
[in] | topLeft | The first corner point of the rectangle. |
[in] | bottomRight | The opposing corner point of the rectangle. |
References Avoid::Polygon::ps, Avoid::Point::x, and Avoid::Point::y.
Avoid::Rectangle::Rectangle | ( | const Point & | centre, |
const double | width, | ||
const double | height | ||
) |
Constructs a rectangular polygon given the centre, width and height.
[in] | centre | The centre of the rectangle, specified as a point. |
[in] | width | The width of the rectangle. |
[in] | height | The height of the rectangle. |
References Avoid::Polygon::ps, Avoid::Point::x, and Avoid::Point::y.