[GRASS-SVN] r49369 - in grass/trunk/gui/wxpython: lmgr nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 26 17:35:04 EST 2011


Author: annakrat
Date: 2011-11-26 14:35:04 -0800 (Sat, 26 Nov 2011)
New Revision: 49369

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/nviz/mapwindow.py
   grass/trunk/gui/wxpython/nviz/tools.py
Log:
wxNviz: miscellaneous bug fixes

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2011-11-26 19:14:53 UTC (rev 49368)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2011-11-26 22:35:04 UTC (rev 49369)
@@ -222,7 +222,7 @@
             else:
                 vector = False
             if self.mapdisplay.IsAutoRendered():
-                self.mapdisplay.MapWindow.UpdateMap(render = True, renderVector = vector)
+                self.mapdisplay.MapWindow2D.UpdateMap(render = True, renderVector = vector)
                 if self.lmgr.IsPaneShown('toolbarNviz'): # nviz
                     self.mapdisplay.MapWindow3D.UpdateMap(render = True)
             self.rerender = False
@@ -1480,7 +1480,7 @@
                     mapWin.LoadVector(layer)
 
                 # reset view when first layer loaded
-                nlayers = len(mapWin.Map.GetListOfLayers(l_type = ('raster', 'vector'),
+                nlayers = len(mapWin.Map.GetListOfLayers(l_type = ('raster', '3d-raster', 'vector'),
                                                          l_active = True))
                 if nlayers < 2:
                     mapWin.ResetView()

Modified: grass/trunk/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/mapwindow.py	2011-11-26 19:14:53 UTC (rev 49368)
+++ grass/trunk/gui/wxpython/nviz/mapwindow.py	2011-11-26 22:35:04 UTC (rev 49369)
@@ -1292,7 +1292,6 @@
             except GException, e:
                 GError(parent = self,
                        message = e.value)
-            self.init = False
         
         stop = time.time()
         
@@ -1470,7 +1469,7 @@
         @param layer item
         """
         return self._loadRaster(item)
-    
+        
     def _loadRaster(self, item):
         """!Load 2d/3d raster map and set its attributes
         
@@ -1980,7 +1979,7 @@
             sliceId += 1
                 
         # position
-        if 'update' in data['position']:
+        if 'update' in data['position'] and 'x' in data['position']:
             x = data['position']['x']
             y = data['position']['y']
             z = data['position']['z']

Modified: grass/trunk/gui/wxpython/nviz/tools.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/tools.py	2011-11-26 19:14:53 UTC (rev 49368)
+++ grass/trunk/gui/wxpython/nviz/tools.py	2011-11-26 22:35:04 UTC (rev 49369)
@@ -4753,7 +4753,8 @@
                 level = iso['topo']['value']
                 isosurfaces.append("%s %s" % (_("Level"), level))
             box.Set(isosurfaces)
-            box.SetChecked(range(len(isosurfaces)))
+            for i in range(len(isosurfaces)):
+                box.Check(i)
             if data['isosurface']:
                 box.SetSelection(0)
                 self.UpdateVolumeIsosurfPage(data['isosurface'][0])
@@ -4765,7 +4766,8 @@
                 axis = ("X", "Y", "Z")[slice['position']['axis']]
                 slices.append("%s %s" % (_("Slice parallel to"), axis))
             box.Set(slices)
-            box.SetChecked(range(len(slices)))
+            for i in range(len(slices)):
+                box.Check(i)
             if data['slice']:
                 box.SetSelection(0)
                 self.UpdateVolumeSlicePage(data['slice'][0])



More information about the grass-commit mailing list