void View::trigger( const Canvas* canvas, const bool active ) { const Mode mode = getMode(); Config* config = getConfig(); // (De)activate destination compounds for canvas/eye(s) for( Channels::const_iterator i = _channels.begin(); i != _channels.end(); ++i ) { Channel* channel = *i; const Canvas* channelCanvas = channel->getCanvas(); const Layout* canvasLayout = channelCanvas->getActiveLayout(); if(( canvas && channelCanvas != canvas ) || ( !canvas && canvasLayout != getLayout( ))) { continue; } const Segment* segment = channel->getSegment(); const uint32_t segmentEyes = segment->getEyes(); const uint32_t eyes = ( mode == MODE_MONO ) ? EYE_CYCLOP & segmentEyes : EYES_STEREO & segmentEyes; if( eyes == 0 ) continue; ConfigDestCompoundVisitor visitor( channel, true /*activeOnly*/ ); config->accept( visitor ); const Compounds& compounds = visitor.getResult(); for( Compounds::const_iterator j = compounds.begin(); j != compounds.end(); ++j ) { Compound* compound = *j; if( active ) { compound->activate( eyes ); LBLOG( LOG_VIEW ) << "Activate " << compound->getName() << std::endl; } else { compound->deactivate( eyes ); LBLOG( LOG_VIEW ) << "Deactivate " << compound->getName() << std::endl; } } } }