Exemplo n.º 1
0
//---------------------------------------------------------
// Call for Graphs
//---------------------------------------------------------
void OptimalHierarchyLayout::doCall(const Hierarchy& H,GraphCopyAttributes &AGC)
{
	// trivial cases
	const GraphCopy &GC = H;
	const int n = GC.numberOfNodes();

	if(n == 0)
		return; // nothing to do

	if(n == 1) {
		node v = GC.firstNode();
		AGC.x(v) = 0;
		AGC.y(v) = 0;
		return;
	}

	// actual computation
	computeXCoordinates(H,AGC);
	computeYCoordinates(H,AGC);
}
//---------------------------------------------------------
// Call for Cluster Graphs
//---------------------------------------------------------
void OptimalHierarchyClusterLayout::doCall(
	const ExtendedNestingGraph &H,
	ClusterGraphCopyAttributes &ACGC)
{
	// trivial cases
	const int n = H.numberOfNodes();

	if(n == 0)
		return; // nothing to do

	if(n == 1) {
		node v = H.firstNode();
		ACGC.x(v) = 0;
		ACGC.y(v) = 0;
		return;
	}

	m_pH    = &H;
	m_pACGC = &ACGC;

	// actual computation
	computeXCoordinates(H,ACGC);
	computeYCoordinates(H,ACGC);
}