Ejemplo n.º 1
0
MultilevelGraph::MultilevelGraph(const String &filename)
:m_createdGraph(true)
{
	m_G = new Graph();
	if(m_G == 0) {
		OGDF_THROW(InsufficientMemoryException);
	} 
	m_nodeAssociations.init(*m_G);
	m_edgeAssociations.init(*m_G);
	m_radius.init(*m_G);
	m_weight.init(*m_G);

	initInternal();
	//GraphAttributes tempGA(*m_G);
	m_GA->readGML(*m_G, filename);
	prepareGraphAttributes(*m_GA);
	importAttributesSimple(*m_GA);

	initReverseIndizes();
}
Ejemplo n.º 2
0
MultilevelGraph::MultilevelGraph(const char *filename) : m_createdGraph(true)
{
	m_G = new Graph();
	if(m_G == nullptr) {
		OGDF_THROW(InsufficientMemoryException);
	}
	m_nodeAssociations.init(*m_G);
	m_edgeAssociations.init(*m_G);
	m_radius.init(*m_G);
	m_weight.init(*m_G);

	initInternal();
#if 0
	GraphAttributes tempGA(*m_G);
#endif
	GraphIO::read(*m_GA, *m_G, filename, GraphIO::readGML);
	prepareGraphAttributes(*m_GA);
	importAttributesSimple(*m_GA);

	initReverseIndizes();
}
Ejemplo n.º 3
0
MultilevelGraph::MultilevelGraph(istream &is)
: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);
	GraphAttributes tempGA(*m_G);
	tempGA.readGML(*m_G, is);
	prepareGraphAttributes(tempGA);
	importAttributesSimple(tempGA);

	initReverseIndizes();
}