Adaptagrams
|
Holds the cluster hierarchy specification for a diagram. More...
#include <cluster.h>
Public Member Functions | |
bool | allowsMultipleParents (void) const |
void | setAllowsMultipleParents (const bool value) |
Public Member Functions inherited from cola::Cluster | |
virtual void | addChildNode (unsigned index) |
Mark a rectangle as being a child of this cluster. More... | |
void | addChildCluster (Cluster *cluster) |
Mark a cluster as being a sub-cluster of this cluster. More... | |
Holds the cluster hierarchy specification for a diagram.
This is not considered a cluster itself, but it records all the nodes in the diagram not contained within any clusters, as well as optionally a hierarchy of clusters.
You can add clusters via addChildCluster() and nodes via addChildNode().
You can specify just the shapes contained in clusters, but not the nodes at this top level—the library will add any remaining nodes not appearing in the cluster hierarchy as children of the root cluster.
It is possible to add a node as the child of two parent clusters. In this case, the clusters will overlap to contain this (and possibly other nodes). The library will warn you if you do this unless you have called the method setAllowsMultipleParents() to mark this intention.
Be careful not to create cycles in the cluster hierarchy (i.e., to mark two clusters as children of each other. The library does not check for this and strange things may occur.
bool cola::RootCluster::allowsMultipleParents | ( | void | ) | const |
Returns true if this cluster hierarchy allows multiple parents, otherwise returns false.
Defaults to false. If this is false, the library will display warnings if you add a single node to multiple clusters.
void cola::RootCluster::setAllowsMultipleParents | ( | const bool | value | ) |
Set whether the cluster hierarchy should allow multiple parents.
value | New value for this setting. |