[GRASS-SVN] r32148 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 17 06:27:04 EDT 2008
Author: martinl
Date: 2008-07-17 06:27:03 -0400 (Thu, 17 Jul 2008)
New Revision: 32148
Modified:
grass/trunk/gui/wxpython/gui_modules/nviz.py
grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
nviz2/wxGUI: loading data layers fixed (empty session)
Modified: grass/trunk/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz.py 2008-07-17 10:01:10 UTC (rev 32147)
+++ grass/trunk/gui/wxpython/gui_modules/nviz.py 2008-07-17 10:27:03 UTC (rev 32148)
@@ -330,6 +330,7 @@
def SetLayerData(self, item, id):
"""Set map object properties"""
+ type = self.tree.GetPyData(item)[0]['maplayer'].type
data = self.tree.GetPyData(item)[0]['nviz']
# init layer data properties
@@ -2033,6 +2034,7 @@
self.mapWindow.update.append('vector:lines:height')
data = self.mapWindow.GetSelectedLayer(nviz=True)
+
data['vector']['lines']['height'] = value
self.mapWindow.UpdateLayerProperties()
@@ -2052,19 +2054,15 @@
self.FindWindowById(self.win['view']['z-exag'][control]).SetRange(0,
max)
elif pageId == 'surface':
- if data and data.has_key('surface'):
- self.UpdateSurfacePage(layer, data['surface'])
- else:
- self.UpdateSurfacePage(layer, None)
+ self.UpdateSurfacePage(layer, data['surface'])
+
# disable vector and enable surface page
self.notebook.GetPage(self.page['surface']).Enable(True)
self.notebook.GetPage(self.page['vector']).Enable(False)
elif pageId == 'vector':
- if data and data.has_key('vector'):
- self.UpdateVectorPage(layer, data['vector'])
- else:
- self.UpdateVectorPage(layer, None)
+ self.UpdateVectorPage(layer, data['vector'])
+
# disable surface and enable current
self.notebook.GetPage(self.page['surface']).Enable(False)
self.notebook.GetPage(self.page['vector']).Enable(True)
Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-07-17 10:01:10 UTC (rev 32147)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-07-17 10:27:03 UTC (rev 32148)
@@ -1141,17 +1141,27 @@
mapLayer = self.GetPyData(layer)[0]['maplayer']
mapWin = self.mapdisplay.MapWindow
if len(mapLayer.GetCmd()) > 0:
+ id = -1
if mapLayer.type == 'raster':
- self.mapdisplay.nvizToolWin.UpdatePage('surface')
- self.mapdisplay.nvizToolWin.SetPage('surface')
if not mapWin.IsLoaded(layer):
- mapWin.LoadRaster(mapLayer)
+ id = mapWin.LoadRaster(mapLayer)
+ if id > 0:
+ self.mapdisplay.MapWindow.SetLayerData(layer, id)
+ self.mapdisplay.MapWindow.UpdateLayerProperties(layer)
+
+ self.mapdisplay.nvizToolWin.UpdatePage('surface')
+ self.mapdisplay.nvizToolWin.SetPage('surface')
+
elif mapLayer.type == 'vector':
- self.mapdisplay.nvizToolWin.UpdatePage('vector')
- self.mapdisplay.nvizToolWin.SetPage('vector')
if not mapWin.IsLoaded(layer):
- mapWin.LoadVector(mapLayer)
-
+ 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')
+
# reset view when first layer loaded
nlayers = len(mapWin.Map.GetListOfLayers(l_type=('raster', 'vector'),
l_active=True))
More information about the grass-commit
mailing list