BlockGraph::BlockGraph(Project *project) { // First look for all input blocks QPtrList<BlockNode> inputBlocks; for (QPtrListIterator<AbstractModel> it(*project->blocks()); it != 0; ++it) { BlockModel* block = dynamic_cast<BlockModel*>(*it); if (block != 0) { if (!block->hasInputPins() && !block->hasEpisodicPins()) { addInputBlock(block); } } } // iterate through all pins QValueList<PinNode*> pins = nodeByPin_.values(); for (QValueList<PinNode*>::Iterator it2 = pins.begin(); it2 != pins.end(); ++it2) { QPtrList<PinNode> neighbours = (*it2)->neighbours(); for (QPtrListIterator<PinNode> it3(neighbours); it3 != 0; ++it3) { if ((*it2)->parent() != (*it3)->parent()) { QPtrList<PinNode> seen; addBlockNeighbour(*it2, *it3, seen); } } } }