[GRASS-SVN] r32520 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 4 12:42:15 EDT 2008
Author: martinl
Date: 2008-08-04 12:42:15 -0400 (Mon, 04 Aug 2008)
New Revision: 32520
Modified:
grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI/nviz: cosmetics in loading/unloading data layers
Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-08-04 16:41:14 UTC (rev 32519)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-08-04 16:42:15 UTC (rev 32520)
@@ -701,7 +701,6 @@
else:
self.GetPyData(layer)[0]['propwin'].Show()
- self.GetPyData(layer)[0]['propwin'].CentreOnParent()
return
completed = ''
@@ -772,8 +771,6 @@
elif ltype == 'group':
pass
- self.GetPyData(layer)[0]['propwin'].CentreOnParent()
-
def OnActivateLayer(self, event):
"""Double click on the layer item.
Launch property dialog, or expand/collapse group of items, etc."""
@@ -1108,26 +1105,23 @@
# change parameters for item in layers list in render.Map
self.ChangeLayer(layer)
-
- if self.mapdisplay.toolbars['nviz']:
+
+ if self.mapdisplay.toolbars['nviz'] and dcmd:
# update nviz session
mapLayer = self.GetPyData(layer)[0]['maplayer']
mapWin = self.mapdisplay.MapWindow
if len(mapLayer.GetCmd()) > 0:
id = -1
if mapLayer.type == 'raster':
- if not mapWin.IsLoaded(layer):
- mapWin.LoadRaster(layer)
-
+ if mapWin.IsLoaded(layer):
+ mapWin.UnloadRaster(layer)
+
+ mapWin.LoadRaster(layer)
elif mapLayer.type == 'vector':
- if not mapWin.IsLoaded(layer):
- id = mapWin.LoadVector(mapLayer)
- if id > 0:
- self.mapdisplay.MapWindow.SetLayerData(layer, id)
- self.mapdisplay.MapWindow.UpdateLayerProperties(layer)
-
- self.mapdisplay.nvizToolWin.UpdatePage('vector')
- self.mapdisplay.nvizToolWin.SetPage('vector')
+ if mapWin.IsLoaded(layer):
+ mapWin.UnloadVector(layer)
+
+ mapWin.LoadVector(mapLayer)
# reset view when first layer loaded
nlayers = len(mapWin.Map.GetListOfLayers(l_type=('raster', 'vector'),
More information about the grass-commit
mailing list