Переглянути джерело

wxGUI/nviz: 3d raster visualization works again

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43018 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 роки тому
батько
коміт
434b7b2751

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

@@ -460,6 +460,7 @@ class GMConsole(wx.SplitterWindow):
                 #
                 try:
                     layertype = {'d.rast'         : 'raster',
+                                 'd.rast3d'       : 'raster3d',
                                  'd.rgb'          : 'rgb',
                                  'd.his'          : 'his',
                                  'd.shaded'       : 'shaded',
@@ -474,11 +475,11 @@ class GMConsole(wx.SplitterWindow):
                                  '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,

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

@@ -24,6 +24,7 @@ from threading import Thread
 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 = ''

+ 1 - 1
gui/wxpython/icons/icon.py

@@ -228,7 +228,7 @@ Icons = {
     "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

+ 12 - 13
gui/wxpython/wxgui.py

@@ -1152,42 +1152,41 @@ class GMFrame(wx.Frame):
         # 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)