MultilevelGraph::MultilevelGraph(GraphAttributes &GA, Graph &G) :m_createdGraph(false) { m_G = &G; m_nodeAssociations.init(*m_G, 0); m_edgeAssociations.init(*m_G, 0); m_x.init(*m_G); m_y.init(*m_G); m_radius.init(*m_G); m_weight.init(*m_G); prepareGraphAttributes(GA); importAttributes(GA); initReverseIndizes(); }
MultilevelGraph::MultilevelGraph(GraphAttributes &GA) :m_createdGraph(false) { m_G = new Graph(); if(m_G == 0) { OGDF_THROW(InsufficientMemoryException); } else { m_createdGraph = true; } m_nodeAssociations.init(*m_G); m_edgeAssociations.init(*m_G); m_x.init(*m_G); m_y.init(*m_G); m_radius.init(*m_G); m_weight.init(*m_G); copyFromGraph(GA.constGraph(), m_nodeAssociations, m_edgeAssociations); prepareGraphAttributes(GA); importAttributes(GA); initReverseIndizes(); }
MultilevelGraph::MultilevelGraph(GraphAttributes &GA) :m_createdGraph(true) { m_G = new Graph(); if(m_G == 0) { OGDF_THROW(InsufficientMemoryException); } //replaces layout info stuff below initInternal(); m_nodeAssociations.init(*m_G); m_edgeAssociations.init(*m_G); m_radius.init(*m_G); m_weight.init(*m_G); copyFromGraph(GA.constGraph(), m_nodeAssociations, m_edgeAssociations); prepareGraphAttributes(GA); importAttributes(GA); initReverseIndizes(); }