Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CompositionItem::formComposition()
- {
- fsmVector fsms;
- linkVector links;
- auto getFsmsAndLinks = [&fsms, &links](QList<QGraphicsItem*> allItems)
- {
- for( const auto& item : allItems )
- {
- if( globals::customTypes::fsm == item->type() )
- {
- // Автомат уже сформирован
- fsms.push_back( dynamic_cast<FsmItem*>(item)->getFsm() );
- }
- else if ( globals::customTypes::link == item->type() )
- {
- // Связь нужно сначала сформировать
- LinkItem* link = dynamic_cast<LinkItem*>(item);
- link->formLink();
- links.push_back( link->getLink() );
- }
- }
- };
- getFsmsAndLinks(collidingItems());
- composition_ = Composition(fsms, links);
- }
- ////////////////////////////////////////////////////////////////////
- Composition::Composition(fsmVector fsms, linkVector links)
- : fsms_(fsms), links_(links)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement