예제 #1
0
face CombinatorialEmbedding::joinFacesPure(edge e)
{
	OGDF_ASSERT(e->graphOf() == m_pGraph);

	// get the two faces adjacent to e
	face f1 = m_rightFace[e->adjSource()];
	face f2 = m_rightFace[e->adjTarget()];

	OGDF_ASSERT(f1 != f2);

	// we will reuse the largest face and delete the other one
	if (f2->m_size > f1->m_size)
		swap(f1,f2);

	// the size of the joined face is the sum of the sizes of the two faces
	// f1 and f2 minus the two adjacency entries of e
	f1->m_size += f2->m_size - 2;

	// If the stored (first) adjacency entry of f1 belongs to e, we must set
	// it to the next entry in the face, because we will remove it by deleting
	// edge e
	if (f1->entries.m_adjFirst->theEdge() == e)
		f1->entries.m_adjFirst = f1->entries.m_adjFirst->faceCycleSucc();

	// each adjacency entry in f2 belongs now to f1
	adjEntry adj1 = f2->firstAdj(), adj = adj1;
	do {
		m_rightFace[adj] = f1;
	} while((adj = adj->faceCycleSucc()) != adj1);

	faces.del(f2);

	return f1;
}
예제 #2
0
파일: PlanRep.cpp 프로젝트: lncosie/ogdf
//inserts copy for original edge eOrig preserving the embedding
edge PlanRep::newCopy(node v, adjEntry adAfter, edge eOrig, CombinatorialEmbedding &E)
{
	OGDF_ASSERT(eOrig->graphOf() == &(original()))
	OGDF_ASSERT(m_eCopy[eOrig].size() == 0)

	edge e;
	//GraphCopy checks direction for us
	e = GraphCopy::newEdge(v, adAfter, eOrig, E);
	//set type of copy
	if (m_pGraphAttributes != nullptr)
		setCopyType(e, eOrig);

	return e;
}
예제 #3
0
파일: PlanRep.cpp 프로젝트: lncosie/ogdf
//inserts copy for original edge eOrig after adAfter
edge PlanRep::newCopy(node v, adjEntry adAfter, edge eOrig)
{
	OGDF_ASSERT(eOrig->graphOf() == &(original()))
	OGDF_ASSERT(m_eCopy[eOrig].size() == 0)
	edge e;
	if (adAfter != nullptr)
		e = Graph::newEdge(v, adAfter);
	else
	{
		node w = copy(eOrig->opposite(original(v)));
		OGDF_ASSERT(w)
		e = Graph::newEdge(v, w);
	}//else
	m_eOrig[e] = eOrig;
	m_eIterator[e] = m_eCopy[eOrig].pushBack(e);
	//set type of copy
	if (m_pGraphAttributes != nullptr)
		setCopyType(e, eOrig);

	return e;
}