Please review. There is already a Paper_column::get_rank for C++ use, so I created a Scheme ...
8 years, 4 months ago
(2015-12-15 22:05:16 UTC)
#1
Please review.
There is already a Paper_column::get_rank for C++ use, so I created a Scheme
version alongside it, but I'm not sure if this is the best approach. I named
the Scheme one "get_rank_number" to differentiate the two. Any suggestions are
welcome.
Background: I was working on a Scheme rewrite of ly:ledger-line-spanner::print,
to allow for some local customizations, but it uses the rank of paper columns
and currently there seems to be no way to access rank from scheme.
Not sure what you need it for. Would it be more generic to provide spanned_rank_interval ...
8 years, 4 months ago
(2015-12-15 22:26:01 UTC)
#2
Not sure what you need it for. Would it be more generic to provide
spanned_rank_interval ()? That should be defined for every grob. Probably also
for paper columns?
On 2015/12/15 22:26:01, dak wrote: > Not sure what you need it for. I was ...
8 years, 4 months ago
(2015-12-15 23:04:55 UTC)
#3
On 2015/12/15 22:26:01, dak wrote:
> Not sure what you need it for.
I was working on a Scheme rewrite of ly:ledger-line-spanner::print,
to allow for some local customizations. It uses the rank of paper columns,
namely, around line 210 in ledger-line-spanner.cc
Direction vdir = Direction (sign (pos));
int rank = h->get_column ()->get_rank ();
reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
reqs[rank][vdir].head_extent_.unite (head_extent);
reqs[rank][vdir].position_
= vdir * max (vdir * reqs[rank][vdir].position_, vdir * pos);
For each note head the code gets the rank of the note head's paper
column as a way to effectively associate the note heads that belong
to the same column... and thus calculate, for each column, the furthest
note head position, how wide the ledger lines need to be, etc.
> Would it be more generic to provide
> spanned_rank_interval ()? That should be defined for every grob. Probably
also
> for paper columns?
I don't know enough about spanned_rank_interval to say for sure. (I looked
it up in grob.cc) If it could be used to group note heads by paper column
(as with paper column rank) then it should work and be more generic.
Some digging turned up: Grob::spanned_rank_interval in grob.cc Spanner::spanned_rank_interval in spanner.cc Item::spanned_rank_interval in item.cc with the ...
8 years, 4 months ago
(2015-12-16 00:18:47 UTC)
#4
Some digging turned up:
Grob::spanned_rank_interval in grob.cc
Spanner::spanned_rank_interval in spanner.cc
Item::spanned_rank_interval in item.cc
with the latter two being more illuminating. So this would indeed work and be
much more generic. Now to figure out how and where to implement a Scheme
version (or versions?)...
Issue 281020043: Add scheme procedure that gets paper column rank
(Closed)
Created 8 years, 4 months ago by pwm
Modified 8 years, 3 months ago
Reviewers: dak
Base URL:
Comments: 0