[GRASS-dev] [GRASS GIS] #2174: Tcl NVIZ: load state loads then forgets the "look here" focus position

GRASS GIS trac at osgeo.org
Sun Jan 26 23:22:31 PST 2014


#2174: Tcl NVIZ: load state loads then forgets the "look here" focus position
-------------------------------+--------------------------------------------
 Reporter:  hamish             |       Owner:  grass-dev@…              
     Type:  defect             |      Status:  new                      
 Priority:  normal             |   Milestone:  6.4.4                    
Component:  Tcl/Tk NVIZ        |     Version:  svn-develbranch6         
 Keywords:  load state, focus  |    Platform:  Linux                    
      Cpu:  x86-64             |  
-------------------------------+--------------------------------------------
 Hi,

 In Tcl/Tk NVIZ if you change the map's location on the canvas with the
 "Look Here" button or change from the puck to the "center" view-adjust
 method, then 'File -> Save State', the resulting position is successfully
 saved to the session-state file by Nget_focus(), and is loaded back in ok
 as part of panel_main.tcl's Nviz_main_load()'s Nset_focus(). But then the
 focus position gets clobbered (twice) by panel_surf.tcl and panel_vol.c
 calling "look_center", which resets the view. On a less important note
 those extra two look_center mean that the screen gets redrawn a couple
 extra times too; minor performance hit.

 Commenting out the two look_center() at the ends of the Nviz_surf_load()
 and Nviz_vol_load() tcl functions lets it reload the correct original view
 upon File -> Load State.


 I hesitate to commit any change without some sort of check that the focus
 has already been loaded/set, maybe those two look_center() are there for
 the first layer to be loaded when starting from a blank canvas? Note that
 AFAIK the canvas center focus is based on g.region not the bounds of the
 newly loaded surface/volume, so the view should not have to be recentered
 because a change of layer.


 thanks,
 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2174>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list