示例#1
0
CHMHMapArcPtr CHMHMapArc::Create(
	CHMHMapNodePtr		&from,
	CHMHMapNodePtr		&to,
	const THypothesisIDSet		&hyps,
	CHierarchicalMHMap			*parent)
{
	CHMHMapArcPtr obj = CHMHMapArcPtr(new CHMHMapArc(from,to,hyps,parent));
	if (parent) 
	{
		// To the graph:
		parent->onArcAddition(obj);
		// To the nodes:
		if (from)	from->onArcAddition(obj);
		if (to)		to->onArcAddition(obj);
	}
	return obj;
}
示例#2
0
CHMHMapArcPtr CHMHMapArc::Create(
	const CHMHMapNode::TNodeID		&from,
	const CHMHMapNode::TNodeID		&to,
	const THypothesisIDSet			&hyps,
	CHierarchicalMHMap		*parent) 
{
	CHMHMapArcPtr obj = CHMHMapArcPtr(new CHMHMapArc(from,to,hyps,parent));
	if (parent) 
	{
		parent->onArcAddition(obj);
		CHMHMapNodePtr node;
		if ( (node = parent->getNodeByID(from)).present() )
			node->onArcAddition(obj);
		if ( (node = parent->getNodeByID(to)).present() )
			node->onArcAddition(obj);
	}
	return obj;
}