Exemplo n.º 1
0
ConnectorList FPNode::outputConnectorList() const 
{  
	ConnectorList out;
	if( m_outputConnector)
		out.append( (Connector *) m_outputConnector);	// un upcast between downcasts :o
	return out;
}
Exemplo n.º 2
0
ConnectorList FPNode::getAllConnectors() const
{
	ConnectorList all = (ConnectorList)(FlowConnectorList)m_inFlowConnList;
	if ( m_outputConnector )
		all.append ( (Connector *) m_outputConnector );
	return all;
}
Exemplo n.º 3
0
/**
* @param componentList 带参数构造函数.
*
* 通过一个组件列表来构造模型.
* 此时所有组件都是由外部创建,
* 所以置m_SelfOwn为false.
*/
Model::Model(ComponentList &componentList, ConnectorList &connectorList)
{
    for (UINT32 i = 0; i < componentList.size(); ++i)
    {
        IComponent *component = componentList[i]->Clone();
        m_ComponentList.push_back(component);
    }
    for (UINT32 i = 0; i < connectorList.size(); ++i)
    {
        Connector connector = connectorList[i], connectorClone;
        for (UINT32 i = 0; i < componentList.size(); ++i)
        {
            if (connector.Source == componentList[i])
            {
                connectorClone.Source = m_ComponentList[i];
            }
            if (connector.Target == componentList[i])
            {
                connectorClone.Target = m_ComponentList[i];
            }
        }
        if (connectorClone.Source != NULL && connectorClone.Target != NULL)
        {
            m_ConnectorList.push_back(connectorClone);
        }
    }
}
Exemplo n.º 4
0
CircuitICNDocument::~CircuitICNDocument()
{
	// Go to hell, KtlQCanvas. I'm in charge of what gets deleted.
	KtlQCanvasItemList all = m_canvas->allItems();
	const KtlQCanvasItemList::Iterator end = all.end();
	for ( KtlQCanvasItemList::Iterator it= all.begin(); it != end; ++it )
		(*it)->setCanvas(0l);
	
	// Remove all items from the canvas
	selectAll();
	deleteSelection();
	
	// Delete anything that got through the above couple of lines
	ConnectorList connectorsToDelete = m_connectorList;
	connectorsToDelete.clear();
	const ConnectorList::iterator connectorListEnd = connectorsToDelete.end();
	for ( ConnectorList::iterator it = connectorsToDelete.begin(); it != connectorListEnd; ++it )
		delete *it;
		
	deleteAllNodes();
}
Exemplo n.º 5
0
ConnectorList CNItem::connectorList()
{
	ConnectorList list;

	const NodeInfoMap::iterator nodeMapEnd = m_nodeMap.end();
	for ( NodeInfoMap::iterator it = m_nodeMap.begin(); it != nodeMapEnd; ++it )
	{
		Node *node = p_icnDocument->nodeWithID(it.data().id);
		if (node)
		{
			ConnectorList nodeList = node->getAllConnectors();
			ConnectorList::iterator end = nodeList.end();
			for ( ConnectorList::iterator it = nodeList.begin(); it != end; ++it )
			{
				if ( *it && !list.contains(*it) )
				{
					list.append(*it);
				}
			}

		}
	}
	
	return list;
}