@@ -0,0 +1,3052 @@
+//------------------------------------------------------------------------------------------------//%0A//                                                                                                //%0A//                                  B e a m H e a d C l e a n e r                                 //%0A//                                                                                                //%0A//------------------------------------------------------------------------------------------------//%0A// %3Ceditor-fold defaultstate=%22collapsed%22 desc=%22hdr%22%3E%0A//%0A//  Copyright %C2%A9  Audiveris 2017. All rights reserved.%0A//%0A//  This program is free software: you can redistribute it and/or modify it under the terms of the%0A//  GNU Affero General Public License as published by the Free Software Foundation, either version%0A//  3 of the License, or (at your option) any later version.%0A//%0A//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;%0A//  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.%0A//  See the GNU Affero General Public License for more details.%0A//%0A//  You should have received a copy of the GNU Affero General Public License along with this%0A//  program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A//------------------------------------------------------------------------------------------------//%0A// %3C/editor-fold%3E%0Apackage org.audiveris.omr.sig;%0A%0Aimport org.audiveris.omr.sheet.Sheet;%0Aimport org.audiveris.omr.sheet.SystemInfo;%0Aimport org.audiveris.omr.sig.relation.BeamHeadRelation;%0Aimport org.audiveris.omr.sig.relation.Relation;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.Set;%0A%0A/**%0A * Class %7B@code BeamHeadCleaner%7D remove all BeamHeadRelation links when they are no%0A * longer needed.%0A *%0A * @author Herv%C3%A9 Bitteur%0A */%0Apublic class BeamHeadCleaner%0A%7B%0A    //~ Static fields/initializers -----------------------------------------------------------------%0A%0A    private static final Logger logger = LoggerFactory.getLogger(BeamHeadCleaner.class);%0A%0A    //~ Instance fields ----------------------------------------------------------------------------%0A    /** Related sheet. */%0A    private final Sheet sheet;%0A%0A    //~ Constructors -------------------------------------------------------------------------------%0A    /**%0A     * Creates a new %7B@code BeamHeadCleaner%7D object.%0A     *%0A     * @param sheet underlying sheet%0A     */%0A    public BeamHeadCleaner (Sheet sheet)%0A    %7B%0A        this.sheet = sheet;%0A    %7D%0A%0A    //~ Methods ------------------------------------------------------------------------------------%0A    //---------//%0A    // process //%0A    //---------//%0A    public void process ()%0A    %7B%0A        for (SystemInfo system : sheet.getSystems()) %7B%0A            SIGraph sig = system.getSig();%0A            Set%3CRelation%3E set = SIGraph.getRelations(sig.edgeSet(), BeamHeadRelation.class);%0A            logger.debug(%22System#%7B%7D BeamHeadRelation instances: %7B%7D%22, system.getId(), set.size());%0A            sig.removeAllEdges(set);%0A        %7D%0A    %7D%0A%7D%0A

Delete Beam-Head relations when no longer useful