Board index FlightGear Development Canvas

by-id canvas lookup

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

by-id canvas lookup

Postby Hooray » Mon Sep 24, 2012 10:52 am

Hooray wrote:The canvas system is prepared for multiple addressing modes, currently "by-index" is the default. But like you say, without a proper data model, by-index addressing is pretty poor.
Personally, I'd suggest to use "by-name (by-id)" - and then just look up "/by-name/map/ksfo/28R" or something like that - we previously talked about that, and I don't that it would be complicated to support this, Tom?

I started incorporating Stuart's latest changes with my version of the code, and now that Stuart has added a "within 100 miles" button to load other airports, and with my support for showing multiple airports at once, it would obviously make sense to combine these two features.

I have completed that, but here's another great optimization opportunity: the way this works currently is that airports get fully refreshed - so that we reload and redraw all airports, even though they may already be loaded.
In other words, I would need to add a caching mechanism in Nasal space to handle this more efficiently, i.e. look at all loaded airports, if new airport is found, re-center map and then load remaining airports in new 100 nm range.
However, that would be much better to address at the C++ level by providing a "by-id" lookup method, so that the Nasal code could just do a lookup in the form of "by-id/airport-layer/ksfo/" "by-id/airport-layer/koak".
Also, "removeAllChildren()" is eating up time here when a canvas group is reset/cleared - while we could expose a faster C++ version, I would just make this also lazy and support a "remove" flag, so that it is 1) marked non-visible and then lazily removed by the canvas (not necessarily in the same frame).
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Posts: 11977
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest