Finding correct bbox values for a staff that is not yet laid out

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding correct bbox values for a staff that is not yet laid out

Ruchit Agrawal
Hello,
As part of my project, I'm trying to add annotations for range selections, and these can possible span multiple staves. For this reason, I need to obtain the correct position values, which includes the y value of the top and bottom staff of the selection. I have been trying to use system->staff(staffIdX)->y() for the same and after much trying, I realized that this won't work because this needs the staff distances to be computed, which currently happens *after* the spanners are laid out. I currently found a workaround by laying out the range annotation spanners *after* the staff distances are computed, and the approach I mentioned above works fine on doing this. However, I wonder if there's another way to get the correct bbox values for the staff being considered. Please let me know if you have any inputs.

Thanks in advance
--
Ruchit Agrawal.
IIIT Hyderabad.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Finding correct bbox values for a staff that is not yet laid out

Marc Sabatella
It seems the sysStaff is partially laid out in System::layoutSystem - we at least calculate x offsets and heights for each staff.  But the rest of the layout doesn't happen until layout2() - in particular, the y offsets don't get calculated until then.  I can see why: the layout of spanners can affect staff spacing, since staves automatically respace as needed to accomodate spanners.  So indeed, it would not be possible to get y positions for the staves until after most spanners are laid out.  But the annotations we are trying to add would not need to affect layout - they are just highlighting applied to the staves.  So it should be safe to put off laying these out until after layout2().  But if anyone has any other thoughts, we'd be curious to hear.  Werner, were you planning on making other changes to the basic structure of how this works?

Marc

On Fri, Aug 12, 2016 at 3:09 AM Ruchit Agrawal <[hidden email]> wrote:
Hello,
As part of my project, I'm trying to add annotations for range selections, and these can possible span multiple staves. For this reason, I need to obtain the correct position values, which includes the y value of the top and bottom staff of the selection. I have been trying to use system->staff(staffIdX)->y() for the same and after much trying, I realized that this won't work because this needs the staff distances to be computed, which currently happens *after* the spanners are laid out. I currently found a workaround by laying out the range annotation spanners *after* the staff distances are computed, and the approach I mentioned above works fine on doing this. However, I wonder if there's another way to get the correct bbox values for the staff being considered. Please let me know if you have any inputs.

Thanks in advance
--
Ruchit Agrawal.
IIIT Hyderabad.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: Finding correct bbox values for a staff that is not yet laid out

lasconic
Administrator
Sounds good to me. Range annotations are different enough from actual spanners so that they can be dealt separately.

lasconic

2016-08-12 17:37 GMT+02:00 Marc Sabatella <[hidden email]>:
It seems the sysStaff is partially laid out in System::layoutSystem - we at least calculate x offsets and heights for each staff.  But the rest of the layout doesn't happen until layout2() - in particular, the y offsets don't get calculated until then.  I can see why: the layout of spanners can affect staff spacing, since staves automatically respace as needed to accomodate spanners.  So indeed, it would not be possible to get y positions for the staves until after most spanners are laid out.  But the annotations we are trying to add would not need to affect layout - they are just highlighting applied to the staves.  So it should be safe to put off laying these out until after layout2().  But if anyone has any other thoughts, we'd be curious to hear.  Werner, were you planning on making other changes to the basic structure of how this works?

Marc

On Fri, Aug 12, 2016 at 3:09 AM Ruchit Agrawal <[hidden email]> wrote:
Hello,
As part of my project, I'm trying to add annotations for range selections, and these can possible span multiple staves. For this reason, I need to obtain the correct position values, which includes the y value of the top and bottom staff of the selection. I have been trying to use system->staff(staffIdX)->y() for the same and after much trying, I realized that this won't work because this needs the staff distances to be computed, which currently happens *after* the spanners are laid out. I currently found a workaround by laying out the range annotation spanners *after* the staff distances are computed, and the approach I mentioned above works fine on doing this. However, I wonder if there's another way to get the correct bbox values for the staff being considered. Please let me know if you have any inputs.

Thanks in advance
--
Ruchit Agrawal.
IIIT Hyderabad.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer