Adaptagrams
|
The ClusterRef class represents a cluster object. More...
#include <viscluster.h>
Public Member Functions | |
ClusterRef (Router *router, Polygon &poly, const unsigned int id=0) | |
Cluster reference constructor. More... | |
~ClusterRef () | |
Cluster reference destructor. | |
void | setNewPoly (Polygon &poly) |
Update the polygon boundary for this cluster. More... | |
unsigned int | id (void) const |
Returns the ID of this cluster. More... | |
ReferencingPolygon & | polygon (void) |
Returns a reference to the polygon boundary of this cluster. More... | |
Polygon & | rectangularPolygon (void) |
Returns a reference to the rectangular boundary of this cluster. More... | |
Router * | router (void) const |
Returns a pointer to the router scene this cluster is in. More... | |
The ClusterRef class represents a cluster object.
Cluster are boundaries around groups of shape objects. Ideally, only connectors with one endpoint inside the cluster and one endpoint outside the cluster will cross the cluster boundary. Connectors that begin and end inside a cluster will not route outside it, and connectors that begin and end outside the cluster will not enter the cluster.
Cluster reference constructor.
Creates a cluster object reference, but does not yet place it into the Router scene. You can add or remove the cluster to/from the scene with Router::addCluster() and Router::delCluster(). The cluster can effectively be moved with ClusterRef::setNewPoly() method.
The poly argument should be used to specify a polygon boundary. The rectangular boundary will be automatically generated from this. The polygon boundary could be a convex hull consisting of points from the boundaries of shapes.
[in] | router | The router scene to place the cluster into. |
[in] | poly | A Polygon representing the boundary of the cluster. |
[in] | id | Optionally, a positive integer ID unique among all objects. |
unsigned int Avoid::ClusterRef::id | ( | void | ) | const |
Returns the ID of this cluster.
Referenced by Avoid::Router::outputInstanceToSVG().
ReferencingPolygon & Avoid::ClusterRef::polygon | ( | void | ) |
Returns a reference to the polygon boundary of this cluster.
Referenced by Avoid::Router::outputInstanceToSVG().
Polygon & Avoid::ClusterRef::rectangularPolygon | ( | void | ) |
Returns a reference to the rectangular boundary of this cluster.
Referenced by Avoid::Router::outputInstanceToSVG().
Router * Avoid::ClusterRef::router | ( | void | ) | const |
Returns a pointer to the router scene this cluster is in.
void Avoid::ClusterRef::setNewPoly | ( | Polygon & | poly | ) |
Update the polygon boundary for this cluster.
You should specify a polygon boundary. The rectangular one will be generated automatically from this.
[in] | poly | A Polygon representing the boundary of the cluster. |
References Avoid::PolygonInterface::boundingRectPolygon().