X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpure-from-neighbor-interface.cc;h=ce202bcf82a64b397e5f220b50986aab60ba103d;hb=2944a83e59f487894a214769392ce27289accb71;hp=8d5e724a7b0e2aa8ee89924670c5541cbe7e686c;hpb=4f49b000d6e257724e311b406e2346b8388c1f0e;p=lilypond.git diff --git a/lily/pure-from-neighbor-interface.cc b/lily/pure-from-neighbor-interface.cc index 8d5e724a7b..ce202bcf82 100644 --- a/lily/pure-from-neighbor-interface.cc +++ b/lily/pure-from-neighbor-interface.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2011 Mike Solomon + Copyright (C) 2011--2012 Mike Solomon LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,34 +17,39 @@ along with LilyPond. If not, see . */ +#include "axis-group-interface.hh" #include "grob.hh" #include "grob-array.hh" +#include "moment.hh" +#include "paper-column.hh" #include "pointer-group-interface.hh" #include "pure-from-neighbor-interface.hh" #include "spanner.hh" #include "system.hh" -MAKE_SCHEME_CALLBACK (Pure_from_neighbor_interface, filter_elements, 1); +MAKE_SCHEME_CALLBACK (Pure_from_neighbor_interface, calc_pure_relevant_grobs, 1); SCM -Pure_from_neighbor_interface::filter_elements (SCM smob) +Pure_from_neighbor_interface::calc_pure_relevant_grobs (SCM smob) { Grob *me = unsmob_grob (smob); - extract_grob_set (me, "elements", elts); + extract_grob_set ((me->original () && me->original ()->is_live () + ? me->original () + : me), + "neighbors", + elts); + vector new_elts; - Interval_t srl = me->get_system ()->spanned_rank_interval (); - for (vsize i = 0; i < elts.size (); i++) - if (srl.contains (elts[i]->spanned_rank_interval ()[LEFT])) - new_elts.push_back (elts[i]); + new_elts.insert (new_elts.end (), elts.begin (), elts.end ()); - SCM elements_scm = me->get_object ("elements"); - if (Grob_array::unsmob (elements_scm)) + SCM neighbors_scm = me->get_object ("neighbors"); + if (Grob_array::unsmob (neighbors_scm)) { vector &arr - = unsmob_grob_array (elements_scm)->array_reference (); + = unsmob_grob_array (neighbors_scm)->array_reference (); arr = new_elts; } - return SCM_BOOL_T; + return Axis_group_interface::internal_calc_pure_relevant_grobs (me, "neighbors"); } ADD_INTERFACE (Pure_from_neighbor_interface, @@ -53,5 +58,7 @@ ADD_INTERFACE (Pure_from_neighbor_interface, "heights of the objects' neighbors.", /* properties */ - "elements-filtered " + "neighbors " + "pure-relevant-grobs " + "pure-Y-common " );