Adaptagrams
Public Member Functions | List of all members
Avoid::Rectangle Class Reference

A Rectangle, a simpler way to define the polygon for square or rectangular shapes. More...

#include <geomtypes.h>

Inheritance diagram for Avoid::Rectangle:
Inheritance graph
Collaboration diagram for Avoid::Rectangle:
Collaboration graph

Public Member Functions

 Rectangle (const Point &topLeft, const Point &bottomRight)
 Constructs a rectangular polygon given two opposing corner points. More...
 
 Rectangle (const Point &centre, 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 Pointat (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< Pointps
 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...
 

Detailed Description

A Rectangle, a simpler way to define the polygon for square or rectangular shapes.

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

Avoid::Rectangle::Rectangle ( const Point topLeft,
const Point bottomRight 
)

Constructs a rectangular polygon given two opposing corner points.

Parameters
[in]topLeftThe first corner point of the rectangle.
[in]bottomRightThe opposing corner point of the rectangle.

References Avoid::Polygon::ps, Avoid::Point::x, and Avoid::Point::y.

◆ Rectangle() [2/2]

Avoid::Rectangle::Rectangle ( const Point centre,
const double  width,
const double  height 
)

Constructs a rectangular polygon given the centre, width and height.

Parameters
[in]centreThe centre of the rectangle, specified as a point.
[in]widthThe width of the rectangle.
[in]heightThe height of the rectangle.

References Avoid::Polygon::ps, Avoid::Point::x, and Avoid::Point::y.


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