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

The ClusterRef class represents a cluster object. More...

#include <viscluster.h>

Collaboration diagram for Avoid::ClusterRef:
Collaboration graph

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...
 
ReferencingPolygonpolygon (void)
 Returns a reference to the polygon boundary of this cluster. More...
 
PolygonrectangularPolygon (void)
 Returns a reference to the rectangular boundary of this cluster. More...
 
Routerrouter (void) const
 Returns a pointer to the router scene this cluster is in. More...
 

Detailed Description

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.

Note
While the functionality of this class works, it is currently experimental you will likely suffer a large performance hit when using it.

Constructor & Destructor Documentation

◆ ClusterRef()

Avoid::ClusterRef::ClusterRef ( Router router,
Polygon poly,
const unsigned int  id = 0 
)

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.

Note
Regarding IDs: You can let libavoid manually handle IDs by not specifying them. Alternatively, you can specify all IDs yourself, but you must be careful to makes sure that each object in the scene (shape, connector, cluster, etc) is given a unique, positive ID. This uniqueness is checked if assertions are enabled, but if not and there are clashes then strange things can happen.
Parameters
[in]routerThe router scene to place the cluster into.
[in]polyA Polygon representing the boundary of the cluster.
[in]idOptionally, a positive integer ID unique among all objects.

Member Function Documentation

◆ id()

unsigned int Avoid::ClusterRef::id ( void  ) const

Returns the ID of this cluster.

Returns
The ID of the cluster.

Referenced by Avoid::Router::outputInstanceToSVG().

Here is the caller graph for this function:

◆ polygon()

ReferencingPolygon & Avoid::ClusterRef::polygon ( void  )

Returns a reference to the polygon boundary of this cluster.

Returns
A reference to the polygon boundary of the cluster.

Referenced by Avoid::Router::outputInstanceToSVG().

Here is the caller graph for this function:

◆ rectangularPolygon()

Polygon & Avoid::ClusterRef::rectangularPolygon ( void  )

Returns a reference to the rectangular boundary of this cluster.

Returns
A reference to the rectangular boundary of the cluster.

Referenced by Avoid::Router::outputInstanceToSVG().

Here is the caller graph for this function:

◆ router()

Router * Avoid::ClusterRef::router ( void  ) const

Returns a pointer to the router scene this cluster is in.

Returns
A pointer to the router scene for this cluster.

◆ setNewPoly()

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.

Parameters
[in]polyA Polygon representing the boundary of the cluster.

References Avoid::PolygonInterface::boundingRectPolygon().

Here is the call graph for this function:

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