lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: visualizing grob ancestry


From: Patrick McCarty
Subject: Re: visualizing grob ancestry
Date: Thu, 23 Jul 2009 18:57:47 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Mark,

On Thu, Jul 23, 2009 at 02:11:47PM -0700, Mark Polesky wrote:
> 
> Does a grob-type always have the same set of parent-types?

No, I don't think so. [see below]

> For example, does an Accidental grob always have X-parent
> AccidentalPlacement and Y-parent NoteHead?

Yes, this appears to be true.

> If so, could this
> information be incororated into the IR? It took me a while
> before I was able to figure this sort of thing out:
> 
>         ________________System__________________
>        |    |  |                   |            |
>        |    |  |                   |            |
>        |    |  NonMusicalPaperColumn            |
>        |    |       \          \                |
>        |    |        \          VerticalAlignment
>         \    \        \                 /
>          PaperColumn   VerticalAxisGroup
>         /           \ /            /
>        /             X            /
>       /             / \          /
>      /             /   NoteColumn
>      \            /    /        \
> AccidentalPlacement   |          |
>               \        \        /
>                \        NoteHead
>                 \          /
>                  Accidental
> 
> 
> And that's the ancestry for just one grob!

This is *very* cool.  Thanks for posting it.

> I assume that a comprehensive visual "parent-web" demonstrating
> all such relationships would be too convoluted to have any
> practical value, and too difficult to generate to even justify
> trying such a thing (although I've seen some impressive examples,
> like http://www.visualthesaurus.com/). But, I imagine it should be
> (at the very least) possible to have something like this near the
> top of each node within IR 3.1 All layout objects:
> 
>    X and Y parents: AccidentalPlacement and NoteHead.
> 
> But I don't know if the parents can change in different contexts.

Depending on the situation, grobs may change parents.

For example, consider Script_interface::calc_positioning_done.

This function first checks to see if the grob (me) has an X parent.
If so, then the grob may change parents if the other two conditional
tests pass.

Instead of documenting this in the IR, maybe it would be better to
write a section in the CG about how to find a grob's parent, the
parent's parent, etc. with GDB?  Plus, I can't think of a good way of
automatically documenting the parents (or the different possibilities
for parents) of grobs.

-Patrick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]