Browse Source

wxGUI/Nviz: fix vector lines

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43140 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
d79009ff1c

+ 2 - 9
gui/wxpython/gui_modules/nviz_mapdisp.py

@@ -503,7 +503,8 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
         type = self.tree.GetPyData(item)[0]['maplayer'].type
         # reference to original layer properties (can be None)
         data = self.tree.GetPyData(item)[0]['nviz']
-        if data is None:
+        
+        if not data:
             # init data structure
             self.tree.GetPyData(item)[0]['nviz'] = {}
             data = self.tree.GetPyData(item)[0]['nviz']
@@ -682,14 +683,6 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
         if layer.type !=  'vector':
             return
         
-        # if vecType is None:
-        #     # load data type by default
-        #     vecType = []
-        #     for v in ('lines', 'points'):
-        #         if UserSettings.Get(group = 'nviz', key = 'vector',
-        #                             subkey = [v, 'show']):
-        #             vecType.append(v)
-        
         # set default properties
         if points is None:
             self.SetMapObjProperties(item, -1, 'lines')

+ 5 - 4
gui/wxpython/gui_modules/nviz_tools.py

@@ -2600,13 +2600,14 @@ class NvizToolWindow(FN.FlatNotebook):
                 mapIs3D = int(value)
             elif key == 'points':
                 npoints = int(value)
-                nprimitives = npoints
-            elif key in ('lines',
-                         'boundaries',
+                nprimitives += npoints
+            elif key == 'lines':
+                nlines = int(value)
+                nprimitives += nlines
+            elif key in ('boundaries',
                          'centroids',
                          'faces',
                          'kernels'):
-                nlines = int(value)
                 nprimitives += int(value)
         
         return (npoints, nlines, nprimitives, mapIs3D)

+ 1 - 0
gui/wxpython/gui_modules/toolbars.py

@@ -1584,6 +1584,7 @@ class NvizToolbar(AbstractToolbar):
             event.Skip()
             return
         
+        self.lmgr.notebook.SetSelection(3)
         eId = event.GetId()
         if eId == self.view:
             self.lmgr.nviz.SetPage('view')