Inkscape
Vector Graphics Editor
|
A common interface used by the Polygon classes. More...
#include <geomtypes.h>
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 Point & | at (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 |
A common interface used by the Polygon classes.
Definition at line 150 of file geomtypes.h.
|
inline |
Constructor.
Definition at line 154 of file geomtypes.h.
|
inlinevirtual |
Destructor.
Definition at line 156 of file geomtypes.h.
|
pure virtual |
Returns a specific point in the polygon.
[in] | index | The array index of the point to be returned. |
Implemented in Avoid::Polygon, and Avoid::ReferencingPolygon.
Referenced by offsetBoundingBox(), offsetPolygon(), and Avoid::Polygon::Polygon().
Polygon Avoid::PolygonInterface::boundingRectPolygon | ( | void | ) | const |
Returns the bounding rectangle for this polygon.
Definition at line 282 of file geomtypes.cpp.
References Avoid::Box::max, Avoid::Box::min, and offsetBoundingBox().
Referenced by Avoid::ClusterRef::setNewPoly().
|
pure virtual |
Resets this to the empty polygon.
Implemented in Avoid::Polygon, and Avoid::ReferencingPolygon.
|
pure virtual |
Returns true if this polygon is empty.
Implemented in Avoid::Polygon, and Avoid::ReferencingPolygon.
|
pure virtual |
Returns the ID value associated with this polygon.
Implemented in Avoid::Polygon, and Avoid::ReferencingPolygon.
Referenced by offsetPolygon().
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.
offset | Extra distance to pad each side of the rect. |
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().
Polygon Avoid::PolygonInterface::offsetPolygon | ( | double | offset | ) | const |
Definition at line 303 of file geomtypes.cpp.
References Avoid::Polygon::_id, at(), Avoid::Point::id, id(), offset, Avoid::Polygon::ps, R, Avoid::Polygon::size(), size(), Avoid::unitNormalForEdge(), and Avoid::Point::vn.
Referenced by Avoid::Obstacle::routingPolygon().
|
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().