Canvas Map API: Difference between revisions

Jump to navigation Jump to search
1,394 bytes removed ,  26 June 2014
m
→‎Optimization: killed/implemented by MapStructure
m (→‎Optimization: killed/implemented by MapStructure)
Line 83: Line 83:
* come up with a framework for MFDs
* come up with a framework for MFDs
* use the MFD framework for creating a stylable ND class
* use the MFD framework for creating a stylable ND class
== Optimization ==
Overall, we can work with the assumption that the aircraft is usually moving, so permanently updating its center/origin coordinates to selectively prune entries that are no longer in range should be more efficient than doing the whole thing in scripting space.
So there are probably some features that can be used to identify missing/useful extensions, not necessarily as dedicated canvas::elements, but rather as extensions to existing elements - once we have a more final version, we can do some profiling to find the low-hanging fruits.
Regarding spatial queries, on the nav-cache side, delta queries would be complex to support. What the C++ NavDisplay does is keep a persistent list which is updated infrequently - only when a setting changes (range, view options config), or when the aircraft moves > 1nm. In C++, computing the delta of two arrays is fast, and that's what I would suggest to avoid the 'remove all children' logic, which is obviously unfriendly to the Canvas. What I'm not sure about, is if Nasal currently has a nice API to compute the difference (added / removed items) between two arrays, but if it's missing I am sure it can be added.
On the canvas side, it would obviously be useful to address elements/groups by ID rather than index, because we could then selectively remove entries that are no longer valid. But maybe Tom has a better idea ?


== Full Example: Creating dialogs with embedded Canvas Maps ==
== Full Example: Creating dialogs with embedded Canvas Maps ==

Navigation menu