[GRASS-SVN] r43018 - in grass/trunk/gui/wxpython: . gui_modules
icons
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 9 06:44:41 EDT 2010
Author: martinl
Date: 2010-08-09 10:44:41 +0000 (Mon, 09 Aug 2010)
New Revision: 43018
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/wxnviz.py
grass/trunk/gui/wxpython/icons/icon.py
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI/nviz: 3d raster visualization works again
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-08-09 10:16:42 UTC (rev 43017)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-08-09 10:44:41 UTC (rev 43018)
@@ -460,6 +460,7 @@
#
try:
layertype = {'d.rast' : 'raster',
+ 'd.rast3d' : 'raster3d',
'd.rgb' : 'rgb',
'd.his' : 'his',
'd.shaded' : 'shaded',
@@ -474,11 +475,11 @@
'd.rhumbline' : 'rhumb',
'd.labels' : 'labels'}[cmdlist[0]]
except KeyError:
- wx.MessageBox(caption = _("Message"),
- message=_("Command '%s' not yet implemented in the GUI. "
- "Try adding it as a command layer instead.") % cmdlist[0])
+ gcmd.GMessage(parent = self.parent,
+ message = _("Command '%s' not yet implemented in the WxGUI. "
+ "Try adding it as a command layer instead.") % cmdlist[0])
return None
-
+
# add layer into layer tree
if cmdlist[0] == 'd.rast':
lname = utils.GetLayerNameFromCmd(cmdlist, fullyQualified = True,
Modified: grass/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py 2010-08-09 10:16:42 UTC (rev 43017)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py 2010-08-09 10:44:41 UTC (rev 43018)
@@ -24,6 +24,7 @@
from ctypes import *
try:
from grass.lib.grass import *
+ from grass.lib.g3d import *
from grass.lib.ogsf import *
from grass.lib.nviz import *
errorMsg = ''
Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py 2010-08-09 10:16:42 UTC (rev 43017)
+++ grass/trunk/gui/wxpython/icons/icon.py 2010-08-09 10:44:41 UTC (rev 43018)
@@ -228,7 +228,7 @@
"addtext" : MetaIcon (img=Icons["addtext"],
label=_("Add text layer")),
"addrast3d" : MetaIcon (img=Icons["addrast3d"],
- label=_("Add 3D raster map")),
+ label=_("Add 3D raster map layer")),
"settings" : MetaIcon (img=Icons["settings"],
label=_("Show GUI settings")),
# digit
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2010-08-09 10:16:42 UTC (rev 43017)
+++ grass/trunk/gui/wxpython/wxgui.py 2010-08-09 10:44:41 UTC (rev 43018)
@@ -1152,42 +1152,41 @@
# start new map display if no display is available
if not self.curr_page:
self.NewDisplay(show=False)
-
+
point = wx.GetMousePosition()
rastmenu = wx.Menu()
-
+
# add items to the menu
- if self.curr_page.maptree.mapdisplay.toolbars['nviz']:
- addrast3d = wx.MenuItem(rastmenu, -1, Icons ["addrast3d"].GetLabel())
- addrast3d.SetBitmap(Icons["addrast3d"].GetBitmap (self.iconsize))
- rastmenu.AppendItem(addrast3d)
- self.Bind(wx.EVT_MENU, self.AddRaster3d, addrast3d)
-
+ addrast3d = wx.MenuItem(rastmenu, -1, Icons ["addrast3d"].GetLabel())
+ addrast3d.SetBitmap(Icons["addrast3d"].GetBitmap (self.iconsize))
+ rastmenu.AppendItem(addrast3d)
+ self.Bind(wx.EVT_MENU, self.AddRaster3d, addrast3d)
+
addshaded = wx.MenuItem(rastmenu, -1, Icons ["addshaded"].GetLabel())
addshaded.SetBitmap(Icons["addshaded"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addshaded)
self.Bind(wx.EVT_MENU, self.AddShaded, addshaded)
-
+
addrgb = wx.MenuItem(rastmenu, -1, Icons["addrgb"].GetLabel())
addrgb.SetBitmap(Icons["addrgb"].GetBitmap(self.iconsize))
rastmenu.AppendItem(addrgb)
self.Bind(wx.EVT_MENU, self.AddRGB, addrgb)
-
+
addhis = wx.MenuItem(rastmenu, -1, Icons ["addhis"].GetLabel())
addhis.SetBitmap(Icons["addhis"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addhis)
self.Bind(wx.EVT_MENU, self.AddHIS, addhis)
-
+
addrastarrow = wx.MenuItem(rastmenu, -1, Icons ["addrarrow"].GetLabel())
addrastarrow.SetBitmap(Icons["addrarrow"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addrastarrow)
self.Bind(wx.EVT_MENU, self.AddRastarrow, addrastarrow)
-
+
addrastnums = wx.MenuItem(rastmenu, -1, Icons ["addrnum"].GetLabel())
addrastnums.SetBitmap(Icons["addrnum"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addrastnums)
self.Bind(wx.EVT_MENU, self.AddRastnum, addrastnums)
-
+
# Popup the menu. If an item is selected then its handler
# will be called before PopupMenu returns.
self.PopupMenu(rastmenu)
More information about the grass-commit
mailing list