[GRASS-SVN] r45781 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 27 02:55:30 EDT 2011
Author: martinl
Date: 2011-03-26 23:55:30 -0700 (Sat, 26 Mar 2011)
New Revision: 45781
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
Log:
#1126: 3D view crashing when started with vector data (was: 3D view
crashing)
(merge r45779 from trunk)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py 2011-03-27 06:52:49 UTC (rev 45780)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py 2011-03-27 06:55:30 UTC (rev 45781)
@@ -32,6 +32,8 @@
except ImportError:
import wx.lib.flatnotebook as FN
+import grass.script as grass
+
import globalvar
import gselect
import gcmd
@@ -2603,34 +2605,23 @@
@return num of points/features (expect of points)
@return None
"""
- vInfo = gcmd.RunCommand('v.info',
- parent = self,
- read = True,
- flags = 't',
- map = layer.GetName())
+ vInfo = grass.vector_info_topo(layer.GetName())
if not vInfo:
return None
-
- npoints = nlines = nprimitives = 0
- for line in vInfo.splitlines():
- key, value = line.split('=')
- if key == 'map3d':
- mapIs3D = int(value)
- elif key == 'points':
- npoints = int(value)
- nprimitives += npoints
- elif key == 'lines':
- nlines = int(value)
- nprimitives += nlines
- elif key in ('boundaries',
- 'centroids',
- 'faces',
- 'kernels'):
- nprimitives += int(value)
- return (npoints, nlines, nprimitives, mapIs3D)
+ nprimitives = 0
+ for key, value in vInfo.iteritems():
+ if key in ('points',
+ 'lines',
+ 'boundaries',
+ 'centroids',
+ 'faces',
+ 'kernels'):
+ nprimitives += value
+ return (vInfo['points'], vInfo['lines'], nprimitives, vInfo['map3d'])
+
def UpdateVectorPage(self, layer, data, updateName = True):
"""!Update vector page"""
npoints, nlines, nfeatures, mapIs3D = self.VectorInfo(layer)
More information about the grass-commit
mailing list