Board index FlightGear Development Canvas

supporting clipping events (optimization/panning)

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.

supporting clipping events (optimization/panning)

Postby Hooray » Mon Sep 24, 2012 11:32 am

It would be good to expose some clipping-related events/info - such that the canvas communicates to the property tree if a child group is clipped from the current view (partially/fully) or if it's fully visible.

The idea is this: panning (or a moving map) will usually involve changing the center of the map, so that certain objects become visible and others invisible (partially).
Without having a good concept/data model, that would normaly require that we write tons of data to the tree, - and refresh things regularly. Pretty inefficient.

Now, it would be trivial in Nasal to register a listener to an "clipped" (true, false) property to update groups dynamically, and then adding data on demand in a lazy fashion. So that groups would be made aware of being clipped or not.

Sort of, that's the approach I currently use in my patched version: I add "empty" groups to each layer for airports and navaids, and only add data if the layer is visible - so that loading "KNUQ" without the "taxiways" checkbox selected, will not write any data to the canvas tree - only after checking the box, will the data be loaded - and from then on, the group will just be made in/visible when toggling the checkbox.
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,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11430
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest