[GRASS5] Improvements to gis.m map canvas

Cedric Shock cedricgrass at shockfamily.net
Wed May 3 00:11:48 EDT 2006


Hi,

I made a couple fairly big improvements to gis.m. The redrawing of mapcanvases 
is now regulated by a little server that waits for requests and redraws 
whenever there's a request. This keeps the redraws down to one at a time. 
This makes resizing the canvas and zooming work more smoothly.

A procedure that wants the canvas redrawn should now do
MapCanvas::request_redraw $mon 1
if the procedure changed the canvas or the view and
MapCanvas::request_redraw $mon 0
if the view and canvas are unchanged.

I removed a few unnecessary "source"s and "after"s. gis.m starts 4-5 seconds 
faster on my computer now. That's about half the time spent between when 
gm.tcl starts running and when it reaches the end. The biggest chunks of 
startup time now are wish starting, disk access to source the files, and 
running the procedures and parts of sourced files that actually do something 
on startup. Sourcing all the code that does nothing seems to have virtually 
zero cost beyond disk access. This shouldn't be surprising since the procs 
aren't compiled until their first use.

There is still one "after" in MapCanvas::mapsettings after running "d.mon 
stop=gism" to "wait to make sure that the driver is shut down". This is 
probably extraneous, but I'm not sure since the R_ commands seem to just push 
messages off to another process. If it's not needed we can shave a nice 
big .5 seconds off many redraws.

--Cedric




More information about the grass-dev mailing list