Beispiel #1
0
//---------------------------------------------------------
// Copy Constructor
//---------------------------------------------------------
OptimalHierarchyLayout::OptimalHierarchyLayout(const OptimalHierarchyLayout &ohl)
{
	m_nodeDistance       = ohl.nodeDistance();
	m_layerDistance      = ohl.layerDistance();
	m_fixedLayerDistance = ohl.fixedLayerDistance();
	m_weightSegments     = ohl.weightSegments();
	m_weightBalancing    = ohl.weightBalancing();
}
Beispiel #2
0
int main()
{
	Graph G;
	GraphAttributes GA(G,
	  GraphAttributes::nodeGraphics |
	  GraphAttributes::edgeGraphics |
	  GraphAttributes::nodeLabel |
	  GraphAttributes::edgeStyle |
	  GraphAttributes::nodeStyle |
	  GraphAttributes::nodeTemplate);
	if (!GraphIO::readGML(GA, G, "unix-history-time.gml") ) {
		cerr << "Could not load unix-history-time.gml" << endl;
		return 1;
	}

	NodeArray<int> rank(G);
	int i = 0;
	node v;
	forall_nodes(v,G)
		rank[v] = r[i++];

	SugiyamaLayout SL;
	SL.setCrossMin(new MedianHeuristic);
	SL.arrangeCCs(false);

	OptimalHierarchyLayout *ohl = new OptimalHierarchyLayout;
	ohl->layerDistance(30.0);
	ohl->nodeDistance(25.0);
	ohl->weightBalancing(0.7);
	SL.setLayout(ohl);

	SL.call(GA, rank);
	GraphIO::writeGML(GA, "unix-history-time-layout.gml");

	return 0;
}