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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 31 06:42:38 EDT 2010


Author: martinl
Date: 2010-05-31 06:42:38 -0400 (Mon, 31 May 2010)
New Revision: 42406

Modified:
   grass/trunk/gui/wxpython/gui_modules/layertree.py
Log:
wxGUI/nviz: fix layer properties popup menu item


Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py	2010-05-31 10:36:40 UTC (rev 42405)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py	2010-05-31 10:42:38 UTC (rev 42406)
@@ -266,6 +266,11 @@
             self.Bind(wx.EVT_MENU, self.OnPopupOpacityLevel, id=self.popupID8)
             self.popupMenu.Append(self.popupID3, text=_("Properties"))
             self.Bind(wx.EVT_MENU, self.OnPopupProperties, id=self.popupID3)
+            
+            if ltype in ('raster', 'vector', 'raster3d') and self.mapdisplay.toolbars['nviz']:
+                self.popupMenu.Append(self.popupID11, _("3D view properties"))
+                self.Bind (wx.EVT_MENU, self.OnNvizProperties, id=self.popupID11)
+            
             if ltype in ('raster', 'vector', 'rgb'):
                 self.popupMenu.Append(self.popupID9, text=_("Zoom to selected map(s)"))
                 self.Bind(wx.EVT_MENU, self.mapdisplay.MapWindow.OnZoomToMap, id=self.popupID9)
@@ -358,7 +363,7 @@
             self.popupMenu.Append(self.popupID6, _("Metadata"))
             self.Bind (wx.EVT_MENU, self.OnMetadata, id=self.popupID6)
             if self.mapdisplay.toolbars['nviz']:
-                self.popupMenu.Append(self.popupID11, _("Nviz properties"))
+                self.popupMenu.Append(self.popupID11, _("3D view properties"))
                 self.Bind (wx.EVT_MENU, self.OnNvizProperties, id=self.popupID11)
 
             if numSelected > 1:
@@ -595,8 +600,14 @@
         @todo vector/volume
         """
         self.lmgr.notebook.SetSelection(3)
-        self.lmgr.nviz.SetPage('surface')
-
+        ltype = self.GetPyData(self.layer_selected)[0]['type']
+        if ltype == 'raster':
+            self.lmgr.nviz.SetPage('surface')
+        elif ltype == 'vector':
+            self.lmgr.nviz.SetPage('vector')
+        elif ltype == 'raster3d':
+            self.lmgr.nviz.SetPage('volume')
+        
     def RenameLayer (self, event):
         """!Rename layer"""
         self.EditLabel(self.layer_selected)



More information about the grass-commit mailing list