Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Avoid::PolygonInterface Class Referenceabstract

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

#include <geomtypes.h>

Inheritance diagram for Avoid::PolygonInterface:
Avoid::Polygon Avoid::ReferencingPolygon Avoid::Rectangle

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.
 
Polygon boundingRectPolygon (void) const
 Returns the bounding rectangle for this polygon.
 
Box offsetBoundingBox (double offset) const
 Returns the bounding rectangle that contains this polygon with optionally some buffer space around it for routing.
 
Polygon offsetPolygon (double offset) const
 

Detailed Description

A common interface used by the Polygon classes.

Definition at line 150 of file geomtypes.h.

Constructor & Destructor Documentation

◆ PolygonInterface()

Avoid::PolygonInterface::PolygonInterface ( )
inline

Constructor.

Definition at line 154 of file geomtypes.h.

◆ ~PolygonInterface()

virtual Avoid::PolygonInterface::~PolygonInterface ( )
inlinevirtual

Destructor.

Definition at line 156 of file geomtypes.h.

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::Polygon, and Avoid::ReferencingPolygon.

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

◆ boundingRectPolygon()

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

Returns the bounding rectangle for this polygon.

Returns
A new Rectangle representing the bounding box.

Definition at line 282 of file geomtypes.cpp.

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

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

◆ clear()

virtual void Avoid::PolygonInterface::clear ( void  )
pure virtual

Resets this to the empty polygon.

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

◆ empty()

virtual bool Avoid::PolygonInterface::empty ( void  ) const
pure virtual

Returns true if this polygon is empty.

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

◆ id()

virtual int Avoid::PolygonInterface::id ( void  ) const
pure virtual

Returns the ID value associated with this polygon.

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

Referenced by offsetPolygon().

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

Definition at line 210 of file geomtypes.cpp.

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

Referenced by boundingRectPolygon(), Avoid::ShapeConnectionPin::commonInitForShapeConnection(), Avoid::Router::outputDiagramSVG(), Avoid::Router::outputDiagramText(), Avoid::HyperedgeImprover::outputHyperedgesToSVG(), Avoid::ShapeConnectionPin::position(), Avoid::Obstacle::routingBox(), and Avoid::ShapeRef::transformConnectionPinPositions().

◆ offsetPolygon()

Polygon Avoid::PolygonInterface::offsetPolygon ( double  offset) const

◆ size()

virtual size_t Avoid::PolygonInterface::size ( void  ) const
pure virtual

Returns the number of points in this polygon.

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

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


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