[GRASS-SVN] r43006 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 4 16:33:40 EDT 2010


Author: martinl
Date: 2010-08-04 20:33:40 +0000 (Wed, 04 Aug 2010)
New Revision: 43006

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
Log:
wxGUI/nviz: fix unloading vector points/lines


Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-08-04 20:09:27 UTC (rev 43005)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-08-04 20:33:40 UTC (rev 43006)
@@ -423,7 +423,7 @@
                     #         if data['vector'][v]:
                     #             vecType.append(v)
                     layer = self.tree.GetPyData(item)[0]['maplayer']
-                    npoints, nlines, nfeatures = self.lmgr.nviz.VectorInfo(layer)
+                    npoints, nlines, nfeatures, mapIs3D = self.lmgr.nviz.VectorInfo(layer)
                     if npoints > 0:
                         self.LoadVector(item, points = True)
                     if nlines > 0:
@@ -463,7 +463,8 @@
                             for v in ('lines', 'points'):
                                 if data['vector'][v]:
                                     vecType.append(v)
-                        self.UnloadVector(layer, vecType)
+                        self.UnloadVector(layer, True)
+                        self.UnloadVector(layer, False)
                     
                     self.UpdateView(None)
                 except gcmd.GException, e:
@@ -744,7 +745,7 @@
             if not data[vecType].has_key('object'):
                 continue
             
-            id = data[vtype]['object']['id']
+            id = data[vecType]['object']['id']
             
             if vecType ==  'lines':
                 ret = self._display.UnloadVector(id, False)
@@ -752,10 +753,10 @@
                 ret = self._display.UnloadVector(id, True)
             if ret ==  0:
                 print >> sys.stderr, "Nviz:" + _("Unable to unload vector map <%(name)s> (%(type)s)") % \
-                    { 'name': layer.name, 'type' : vtype }
+                    { 'name': layer.name, 'type' : vecType }
             else:
                 print "Nviz:" + _("Vector map <%(name)s> (%(type)s) unloaded successfully") % \
-                    { 'name' : layer.name, 'type' : vtype }
+                    { 'name' : layer.name, 'type' : vecType }
             
             data[vecType].pop('object')
             

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-08-04 20:09:27 UTC (rev 43005)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-08-04 20:33:40 UTC (rev 43006)
@@ -1971,11 +1971,9 @@
         winId = event.GetId()
         if winId == self.win['vector']['lines']['show']:
             vecType = 'lines'
-            lines = True
             points = False
         else: # points
             vecType = 'points' 
-            lines = False
             points = True
        
         checked = event.IsChecked()
@@ -1984,9 +1982,9 @@
         data = self.GetLayerData('vector')['vector']
         
         if checked:
-            self.mapWindow.LoadVector(item, lines = lines, points = points)
+            self.mapWindow.LoadVector(item, points = points)
         else:
-            self.mapWindow.UnloadVector(item, lines = lines, points = points)
+            self.mapWindow.UnloadVector(item, points = points)
         
         self.UpdateVectorShow(vecType, checked)
         
@@ -2610,11 +2608,11 @@
                 nlines = int(value)
                 nprimitives += int(value)
         
-        return (npoints, nlines, nprimitives)
+        return (npoints, nlines, nprimitives, mapIs3D)
         
     def UpdateVectorPage(self, layer, data, updateName = True):
         """!Update vector page"""
-        npoints, nlines, nfeatures = self.VectorInfo(layer)
+        npoints, nlines, nfeatures, mapIs3D = self.VectorInfo(layer)
         if mapIs3D:
             desc = _("Vector map is 3D")
             enable = False



More information about the grass-commit mailing list