[GRASS-SVN] r56552 - in grass/branches/releasebranch_6_4/gui/wxpython: lmgr nviz
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jun 2 02:46:26 PDT 2013
Author: annakrat
Date: 2013-06-02 02:46:26 -0700 (Sun, 02 Jun 2013)
New Revision: 56552
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/lmgr/layertree.py
grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py
Log:
wxNviz: fix error when reordering layers (merge from trunk, r56551)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/lmgr/layertree.py 2013-06-02 09:40:52 UTC (rev 56551)
+++ grass/branches/releasebranch_6_4/gui/wxpython/lmgr/layertree.py 2013-06-02 09:46:26 UTC (rev 56552)
@@ -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 SetOpacityDialog, EVT_APPLY_OPACITY
@@ -1160,10 +1161,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/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py 2013-06-02 09:40:52 UTC (rev 56551)
+++ grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py 2013-06-02 09:46:26 UTC (rev 56552)
@@ -4264,13 +4264,16 @@
if data:
if pageId == 'surface':
layer = self.mapWindow.GetLayerByName(name, mapType = 'raster')
- self.UpdateSurfacePage(layer, data['surface'])
+ if layer:
+ self.UpdateSurfacePage(layer, data['surface'])
elif pageId == 'vector':
layer = self.mapWindow.GetLayerByName(name, mapType = 'vector')
- self.UpdateVectorPage(layer, data['vector'])
+ if layer:
+ self.UpdateVectorPage(layer, data['vector'])
elif pageId == 'volume':
layer = self.mapWindow.GetLayerByName(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