Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(17)

Issue 7185044: Caches the interior skylines of vertical axis groups and systems.

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by MikeSol
Modified:
11 years, 3 months ago
Reviewers:
Keith, dak, mike7, Trevor Daniels, t.daniels
CC:
lilypond-devel_gnu.org
Base URL:
http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Visibility:
Public.

Description

Caches the interior skylines of vertical axis groups and systems. This will allow for a more modular approach to outside-staff-spacing, eventually eliminating the call to translate_axis in axis-group-interface.cc.

Patch Set 1 #

Patch Set 2 : Renames property, better documentation. #

Patch Set 3 : Passes make #

Total comments: 2

Patch Set 4 : Eliminates translate_axis call from outside-staff-positioning. #

Patch Set 5 : Compiles with current master #

Total comments: 14

Patch Set 6 : Incorporates David's suggestions #

Patch Set 7 : Incorporates David's comments #

Total comments: 23

Patch Set 8 : Responses to David's review. #

Patch Set 9 : Fixes bug in slurs #

Total comments: 10

Patch Set 10 : Uses Keith #

Patch Set 11 : Adds side-position-interface to certain grobs #

Patch Set 12 : Removes Side_position_interface::calc_outside_staff_y_offset #

Patch Set 13 : Ignores staff-padding for cross-staff grobs #

Patch Set 14 : rebase off current master #

Patch Set 15 : Creates outside-staff-interface #

Patch Set 16 : Rebase against current master #

Patch Set 17 : Rebase against current master #

Patch Set 18 : Rebase off current master #

Patch Set 19 : Rebase off of current master. #

Patch Set 20 : Gives Hairpin outside-staff-interface #

Total comments: 23
Unified diffs Side-by-side diffs Delta from patch set Stats (+873 lines, -379 lines) Patch
M Documentation/changes.tely View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +23 lines, -0 lines 0 comments Download
M input/regression/scheme-text-spanner.ly View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -0 lines 0 comments Download
M input/regression/tuplet-bracket-outside-staff-priority.ly View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M input/regression/tuplet-number-outside-staff-positioning.ly View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M input/regression/tuplet-number-outside-staff-priority.ly View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M lily/axis-group-interface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +296 lines, -260 lines 23 comments Download
M lily/directional-element-interface.cc View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M lily/fingering-engraver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M lily/grob.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -3 lines 0 comments Download
M lily/grob-property.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M lily/include/axis-group-interface.hh View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M lily/include/directional-element-interface.hh View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A + lily/include/outside-staff-interface.hh View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -6 lines 0 comments Download
M lily/include/side-position-interface.hh View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M lily/include/tuplet-bracket.hh View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M lily/new-fingering-engraver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
A lily/outside-staff-interface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +225 lines, -0 lines 0 comments Download
M lily/script-interface.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M lily/side-position-interface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 12 chunks +40 lines, -32 lines 0 comments Download
M lily/slur.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -3 lines 0 comments Download
M lily/slur-scoring.cc View 1 2 3 4 5 6 7 8 1 chunk +17 lines, -3 lines 0 comments Download
M lily/system.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M lily/text-spanner-engraver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M lily/trill-spanner-engraver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M lily/tuplet-bracket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +69 lines, -28 lines 0 comments Download
M lily/tuplet-number.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -0 lines 0 comments Download
M ly/music-functions-init.ly View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +16 lines, -0 lines 0 comments Download
M scm/define-grob-interfaces.scm View 1 1 chunk +5 lines, -0 lines 0 comments Download
M scm/define-grob-properties.scm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +8 lines, -3 lines 0 comments Download
M scm/define-grobs.scm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 41 chunks +87 lines, -34 lines 0 comments Download
M scm/output-lib.scm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 53
Keith
This would take me a couple more hours to figure out. Do I want to ...
12 years, 1 month ago (2013-01-26 22:21:55 UTC) #1
mike7
On 26 janv. 2013, at 23:21, k-ohara5a5a@oco.net wrote: > This would take me a couple ...
12 years, 1 month ago (2013-01-27 09:45:28 UTC) #2
dak
"mike@mikesolomon.org" <mike@mikesolomon.org> writes: > Maybe it's not worth it to do all this intermediate stuff...you're ...
12 years, 1 month ago (2013-01-27 10:51:48 UTC) #3
mike7
On 27 janv. 2013, at 11:51, dak@gnu.org wrote: > "mike@mikesolomon.org" <mike@mikesolomon.org> writes: > >> Maybe ...
12 years, 1 month ago (2013-01-27 11:56:26 UTC) #4
Keith
On Sun, 27 Jan 2013 01:45:16 -0800, mike@mikesolomon.org <mike@mikesolomon.org> wrote: > On 26 janv. 2013, ...
12 years, 1 month ago (2013-01-28 05:34:06 UTC) #5
MikeSol
Eliminates translate_axis call from outside-staff-positioning.
12 years, 1 month ago (2013-01-28 12:27:47 UTC) #6
MikeSol
People can review this if they have time...it is a lot of code, but it ...
12 years, 1 month ago (2013-01-28 12:33:38 UTC) #7
mike7
On 28 janv. 2013, at 06:33, Keith OHara <k-ohara5a5a@oco.net> wrote: > On Sun, 27 Jan ...
12 years, 1 month ago (2013-01-28 12:43:54 UTC) #8
MikeSol
Compiles with current master
12 years, 1 month ago (2013-01-28 19:06:06 UTC) #9
MikeSol
Hey all, After letting this newest round sit for a few days, I'm pretty confident ...
12 years, 1 month ago (2013-01-31 23:32:41 UTC) #10
dak
As previously, there are no comments whatsoever putting the code into perspective. This is an ...
12 years, 1 month ago (2013-02-01 15:04:37 UTC) #11
MikeSol
Incorporates David's suggestions
12 years, 1 month ago (2013-02-03 08:44:18 UTC) #12
mike7
On 1 févr. 2013, at 16:04, dak@gnu.org wrote: > As previously, there are no comments ...
12 years, 1 month ago (2013-02-03 08:45:13 UTC) #13
dak
On 2013/02/03 08:45:13, mike7 wrote: > On 1 févr. 2013, at 16:04, mailto:dak@gnu.org wrote: > ...
12 years, 1 month ago (2013-02-03 20:33:11 UTC) #14
mike7
On 3 févr. 2013, at 21:33, dak@gnu.org wrote: > On 2013/02/03 08:45:13, mike7 wrote: >> ...
12 years, 1 month ago (2013-02-03 22:29:04 UTC) #15
MikeSol
Incorporates David's comments
12 years, 1 month ago (2013-02-03 22:34:03 UTC) #16
dak
I've not really reviewed everything here, just highlights. Regarding the commenting problems: it is important ...
12 years, 1 month ago (2013-02-14 19:20:20 UTC) #17
mike7
Thank you for the _excellent_ review. This is _exactly_ the type of stuff I need. ...
12 years, 1 month ago (2013-02-15 06:37:20 UTC) #18
MikeSol
Responses to David's review.
12 years, 1 month ago (2013-02-15 06:37:34 UTC) #19
Keith
The reorganization looks reasonable. { g4\> g'_"pico" g' g\! } Assuming for simplicity that this ...
12 years ago (2013-02-16 21:33:55 UTC) #20
dak
On 2013/02/15 06:37:20, mike7 wrote: > https://codereview.appspot.com/7185044/diff/32003/input/regression/tuplet-number-outside-staff-positioning.ly#newcode15 > > input/regression/tuplet-number-outside-staff-positioning.ly:15: > > \override TupletBracket.Y-offset = ...
12 years ago (2013-02-18 18:07:38 UTC) #21
mike7
On 18 févr. 2013, at 20:07, dak@gnu.org wrote: > On 2013/02/15 06:37:20, mike7 wrote: > ...
12 years ago (2013-02-19 12:37:57 UTC) #22
mike7
On 18 févr. 2013, at 20:07, dak@gnu.org wrote: > > >> A music function could ...
12 years ago (2013-02-19 12:37:58 UTC) #23
t.daniels_treda.co.uk
From: <mike@mikesolomon.org> Sent: Monday, February 18, 2013 8:32 PM > On 18 févr. 2013, at ...
12 years ago (2013-02-19 14:11:48 UTC) #24
mike7
On 19 févr. 2013, at 16:11, Trevor Daniels <t.daniels@treda.co.uk> wrote: > > From: <mike@mikesolomon.org> > ...
12 years ago (2013-02-19 14:57:48 UTC) #25
t.daniels_treda.co.uk
From: <mike@mikesolomon.org> Sent: Tuesday, February 19, 2013 2:22 PM > >On 19 févr. 2013, at ...
12 years ago (2013-02-19 16:25:54 UTC) #26
dak
On 2013/02/19 14:57:48, mike7 wrote: > The current documentation on outside-staff grobs reads: > "Intuitively, ...
12 years ago (2013-02-19 17:27:31 UTC) #27
MikeSol
Fixes bug in slurs
12 years ago (2013-02-19 17:46:07 UTC) #28
mike7
On 19 févr. 2013, at 19:27, dak@gnu.org wrote: > You don't document what it takes ...
12 years ago (2013-02-19 17:46:21 UTC) #29
dak
https://codereview.appspot.com/7185044/diff/45018/Documentation/changes.tely File Documentation/changes.tely (right): https://codereview.appspot.com/7185044/diff/45018/Documentation/changes.tely#newcode68 Documentation/changes.tely:68: @code{ly:side-position-interface::calc-outside-staff-y-offse} Probably a missing t at the end. https://codereview.appspot.com/7185044/diff/45018/Documentation/changes.tely#newcode69 ...
12 years ago (2013-02-23 18:00:19 UTC) #30
dak
https://codereview.appspot.com/7185044/diff/45018/input/regression/tuplet-bracket-outside-staff-priority.ly File input/regression/tuplet-bracket-outside-staff-priority.ly (right): https://codereview.appspot.com/7185044/diff/45018/input/regression/tuplet-bracket-outside-staff-priority.ly#newcode17 input/regression/tuplet-bracket-outside-staff-priority.ly:17: \tupletOutsideStaffPriority #1 Why a changed regtest when purportedly, according ...
12 years ago (2013-02-23 18:07:54 UTC) #31
Trevor Daniels
https://codereview.appspot.com/7185044/diff/45018/Documentation/changes.tely File Documentation/changes.tely (right): https://codereview.appspot.com/7185044/diff/45018/Documentation/changes.tely#newcode73 Documentation/changes.tely:73: @code{Slur}, for example, are all grobs are traditionally not ...
12 years ago (2013-02-23 22:24:21 UTC) #32
Keith
This still needs some cleanup, at least to remove the now-redundant \tupletOutsideStaffPriority The goal was ...
12 years ago (2013-02-24 09:45:54 UTC) #33
dak
Stupid question: could you not just check whether outside-staff-priority has been set, and if it ...
12 years ago (2013-02-24 10:40:48 UTC) #34
mike7
On 24 févr. 2013, at 12:40, dak@gnu.org wrote: > Stupid question: could you not just ...
12 years ago (2013-02-24 13:27:39 UTC) #35
dak
On 2013/02/24 13:27:39, mike7 wrote: > On 24 févr. 2013, at 12:40, mailto:dak@gnu.org wrote: > ...
12 years ago (2013-02-24 14:37:14 UTC) #36
MikeSol
Uses Keith
12 years ago (2013-02-24 14:56:06 UTC) #37
mike7
On 24 févr. 2013, at 16:37, dak@gnu.org wrote: > On 2013/02/24 13:27:39, mike7 wrote: >> ...
12 years ago (2013-02-24 14:57:37 UTC) #38
dak
"mike@mikesolomon.org" <mike@mikesolomon.org> writes: > On 24 févr. 2013, at 16:37, dak@gnu.org wrote: > >> On ...
12 years ago (2013-02-24 15:18:15 UTC) #39
mike7
On 24 févr. 2013, at 17:18, David Kastrup <dak@gnu.org> wrote: > "mike@mikesolomon.org" <mike@mikesolomon.org> writes: > ...
12 years ago (2013-02-24 16:20:53 UTC) #40
mike7
On 24 févr. 2013, at 11:45, k-ohara5a5a@oco.net wrote: > This still needs some cleanup, at ...
12 years ago (2013-02-24 17:20:23 UTC) #41
MikeSol
Adds side-position-interface to certain grobs
12 years ago (2013-02-24 21:03:54 UTC) #42
dak
On 2013/02/24 16:20:53, mike7 wrote: > On 24 févr. 2013, at 17:18, David Kastrup <mailto:dak@gnu.org> ...
12 years ago (2013-02-25 15:29:22 UTC) #43
mike7
On 25 févr. 2013, at 16:29, dak@gnu.org wrote: > On 2013/02/24 16:20:53, mike7 wrote: >> ...
12 years ago (2013-02-25 22:34:53 UTC) #44
mike7
On 25 févr. 2013, at 23:34, mike@mikesolomon.org wrote: > > On 25 févr. 2013, at ...
12 years ago (2013-02-25 23:11:22 UTC) #45
MikeSol
Removes Side_position_interface::calc_outside_staff_y_offset
12 years ago (2013-02-26 18:49:42 UTC) #46
MikeSol
Ignores staff-padding for cross-staff grobs
12 years ago (2013-02-27 10:30:51 UTC) #47
MikeSol
rebase off current master
12 years ago (2013-03-05 04:48:03 UTC) #48
MikeSol
Creates outside-staff-interface
12 years ago (2013-03-13 17:05:46 UTC) #49
MikeSol
Hey all, Following up to my comment on the tracker, I'd like to not push ...
11 years, 12 months ago (2013-03-20 21:23:02 UTC) #50
MikeSol
Rebase off of current master.
11 years, 11 months ago (2013-03-28 19:09:41 UTC) #51
MikeSol
Gives Hairpin outside-staff-interface
11 years, 11 months ago (2013-04-16 06:29:29 UTC) #52
dak
11 years, 3 months ago (2013-12-11 13:44:23 UTC) #53
I have a headache after the first file of 30, so this is just this one file and
does not imply that the others are fine.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface.cc
File lily/axis-group-interface.cc (left):

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:1032: "outside-staff-placement-directive "
There is probably a reason that this

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:1041: "vertical-skyline-elements "
and this property have been removed from the Axis_group_interface even though
they are still being used.  What's the reason?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface.cc
File lily/axis-group-interface.cc (right):

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:45: staff_priority_less (Grob *const &g1, Grob
*const &g2)
There is no point in passing references to pointers when the pointers are not
actually being changed.

Do you mean to pass references to the grobs instead?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:59: return g1 < g2;
Making decisions based on memory address is a bad idea since it leads to
irreproducible behavior.  Since the order does not need changing, one can just
return true here.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:77: static void
There is no comment that indicates what add_interior_skylines can be used for,
what its input and output are, where and when it should be used.

This is write-only code.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:99: SCM
There is no comment what valid_outside_staff_placement_directive is called for
and what its results are.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:104: if ((directive == ly_symbol2scm
("left-to-right-greedy"))
If there is only a limited set of valid values, this should be checked by an
appropriate type definition of outside-staff-placement-directive at assigment
time rather than blowing up at run time.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:691: MAKE_SCHEME_CALLBACK (Axis_group_interface,
calc_inside_staff_skylines, 1);
There is no comment what calc_inside_staff_skylines is supposed to calculate,
what marks an "inside_staff_skyline", and how it differs from other skylines.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:701: assert (y_common == me);
If skylines are disabled, why would this assertion be true?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:724:
sane_outside_staff_priority_parental_relationship (Grob *me)
What has this to do with sanity?  Are childs only allowed larger staff
priorities?  Why?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:739: ancestor_priority_plus_a_bit (Grob *me)
Why do we need this?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:749: return scm_from_double (scm_to_double
(ancestor->get_property ("outside-staff-priority")) + 0.0001);
This does not distinguish between various ancestors, so both a child as well as
a grandchild will get assigned the same priority based on their common ancestor.
 If the degree of ancestry does not count into the result, it would appear that
this function only serves for disambiguation at a single level.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:767: in two movings.
Huh?  Above we called a staff priority relation "sane" when the parent had a
smaller outside staff priority.  Now it must not have any outside staff
priority?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:771: elements[i]->warning ("An elements' Y parent
must have a lower outside staff priority than the element.");
Looks like the above comment got things wrong.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:778: are triggered beforehand.
But we do not _do_ any sorting here.  Why would we not call the extents before
we do the actual sorting rather than in an unrelated function?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:785: MAKE_SCHEME_CALLBACK (Axis_group_interface,
vertical_skyline_elements, 1);
There is no comment what this function returns, and it obviously does not merely
return the elements as its name would suggest.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:841: elt->programming_error ("Sorting function
should have made sure that I have an outside-staff-priority although my parent
does. Setting to parent's...");
The error message does not make sense. "Sorting function should have made sure
that I have an outside-staff-priority although my parent does."?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:851: bool l2r = ((directive == ly_symbol2scm
("left-to-right-greedy"))
Actually, this strongly suggests that the "directive" should be split into two
properties, one being a Direction property, the other being a boolean.  It makes
no sense to conflate orthogonal properties into a single property just to pick
them apart afterwards.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:887: && scm_is_eq (elements[i + 1]->get_property
("outside-staff-priority"), priority))
Priorities are generally numeric and cannot reliably be compared with scm_is_eq.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:899: for (vsize j = l2r ? 0 : current_elts.size ();
This is rather inscrutable, and it is worth noting that this does not work
symmetrically since the sort order, as it has been established here, is _always_
according to the _left_ edge of a grob.  So for l->r placement, we are sorted
according to trailing edge, for r->l placement, according to the leading edge.

It also seems utterly pointless to go through the loop when polite == false. 
One can just return the array, potentially reversed.

Since r->l order is simulated by going reverse anyway, one can just do the
conditional reverse independent of polite, return on !polite and then do the
loop in forward direction either way.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:917: if (x_extent[LEFT] <= last_end[dir] && polite)
Shouldn't that be < here?

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:927: skipped_elements.clear ();
If we have r->l order here, the loop was run backwards, pushing in this
backwards order into skipped_elements.  However, the next loop will again be run
backwards, meaning that in the case of r->l ordering, skipped_elements will be
ordered the wrong way round.

https://codereview.appspot.com/7185044/diff/164001/lily/axis-group-interface....
lily/axis-group-interface.cc:970: if (!ancestor && !scm_is_number
(elt->get_property ("outside-staff-priority")))
There is no point in calculating the outside_staff_ancestor when this element
has an outside-staff-priority.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b