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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 2 02:40:52 PDT 2013


Author: annakrat
Date: 2013-06-02 02:40:52 -0700 (Sun, 02 Jun 2013)
New Revision: 56551

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/nviz/tools.py
Log:
wxNviz: fix error when reordering layers

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2013-06-02 09:16:51 UTC (rev 56550)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2013-06-02 09:40:52 UTC (rev 56551)
@@ -29,6 +29,7 @@
     from wx.lib.mixins import treemixin
 
 from grass.script import core as grass
+from grass.script import vector as gvector
 
 from core                 import globalvar
 from gui_core.dialogs     import SqlQueryFrame, SetOpacityDialog
@@ -1199,10 +1200,10 @@
                 elif mapLayer.type == '3d-raster':
                     self.mapdisplay.MapWindow.LoadRaster3d(item)
                 elif mapLayer.type == 'vector':
-                    npoints, nlines, nfeatures, mapIs3D = self.lmgr.nviz.VectorInfo(mapLayer)
-                    if npoints > 0:
+                    vInfo = gvector.vector_info_topo(mapLayer.GetName())
+                    if (vInfo['points'] + vInfo['centroids']) > 0:
                         self.mapdisplay.MapWindow.LoadVector(item, points = True)
-                    if nlines > 0:
+                    if (vInfo['lines'] + vInfo['boundaries']) > 0:
                         self.mapdisplay.MapWindow.LoadVector(item, points = False)
 
             else: # disable

Modified: grass/trunk/gui/wxpython/nviz/tools.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/tools.py	2013-06-02 09:16:51 UTC (rev 56550)
+++ grass/trunk/gui/wxpython/nviz/tools.py	2013-06-02 09:40:52 UTC (rev 56551)
@@ -4514,13 +4514,16 @@
             if data:
                 if pageId == 'surface':
                     layer = self._getMapLayerByName(name, mapType = 'raster')
-                    self.UpdateSurfacePage(layer, data['surface'])
+                    if layer:
+                        self.UpdateSurfacePage(layer, data['surface'])
                 elif pageId == 'vector':
                     layer = self._getMapLayerByName(name, mapType = 'vector')
-                    self.UpdateVectorPage(layer, data['vector'])
+                    if layer:
+                        self.UpdateVectorPage(layer, data['vector'])
                 elif pageId == 'volume':
                     layer = self._getMapLayerByName(name, mapType = '3d-raster')
-                    self.UpdateVolumePage(layer, data['volume'])
+                    if layer:
+                        self.UpdateVolumePage(layer, data['volume'])
         elif pageId == 'light':
             zval = self.mapWindow.light['position']['z']
             bval = self.mapWindow.light['bright']



More information about the grass-commit mailing list