Adaptagrams
Public Member Functions | List of all members
Avoid::PolygonInterface Class Referenceabstract

A common interface used by the Polygon classes. More...

#include <geomtypes.h>

Inheritance diagram for Avoid::PolygonInterface:
Inheritance graph
Collaboration diagram for Avoid::PolygonInterface:
Collaboration graph

Public Member Functions

 PolygonInterface ()
 Constructor.
 
virtual ~PolygonInterface ()
 Destructor.
 
virtual void clear (void)=0
 Resets this to the empty polygon.
 
virtual bool empty (void) const =0
 Returns true if this polygon is empty.
 
virtual size_t size (void) const =0
 Returns the number of points in this polygon.
 
virtual int id (void) const =0
 Returns the ID value associated with this polygon.
 
virtual const Pointat (size_t index) const =0
 Returns a specific point in the polygon. More...
 
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...
 

Detailed Description

A common interface used by the Polygon classes.

Member Function Documentation

◆ at()

virtual const Point& Avoid::PolygonInterface::at ( size_t  index) const
pure virtual

Returns a specific point in the polygon.

Parameters
[in]indexThe array index of the point to be returned.

Implemented in Avoid::ReferencingPolygon, and Avoid::Polygon.

Referenced by offsetBoundingBox(), and Avoid::Polygon::Polygon().

Here is the caller graph for this function:

◆ boundingRectPolygon()

Polygon Avoid::PolygonInterface::boundingRectPolygon ( void  ) const

Returns the bounding rectangle for this polygon.

Returns
A new Rectangle representing the bounding box.

References Avoid::Box::max, Avoid::Box::min, and offsetBoundingBox().

Referenced by Avoid::ClusterRef::setNewPoly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ offsetBoundingBox()

Box Avoid::PolygonInterface::offsetBoundingBox ( double  offset) const

Returns the bounding rectangle that contains this polygon with optionally some buffer space around it for routing.

If a buffer distance of zero is given, then this method returns the bounding rectangle for the shape's polygon.

Parameters
offsetExtra distance to pad each side of the rect.
Returns
The bounding box for the polygon.

References at(), Avoid::Box::max, Avoid::Box::min, size(), Avoid::Point::x, and Avoid::Point::y.

Referenced by boundingRectPolygon(), Avoid::ShapeConnectionPin::position(), and Avoid::ShapeRef::transformConnectionPinPositions().

Here is the call graph for this function:
Here is the caller graph for this function:

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