[GRASS-SVN] r46521 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 2 15:21:06 EDT 2011


Author: annakrat
Date: 2011-06-02 12:21:06 -0700 (Thu, 02 Jun 2011)
New Revision: 46521

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxNviz: disable using nviz in more than one map display window

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-06-02 16:47:28 UTC (rev 46520)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-06-02 19:21:06 UTC (rev 46521)
@@ -370,6 +370,11 @@
         
         # add Nviz toolbar and disable 2D display mode tools
         self.toolbars['nviz'] = toolbars.NvizToolbar(self, self.Map)
+        # disable 3D mode for other displays
+        for page in range(0, self._layerManager.gm_cb.GetPageCount()):
+            if self._layerManager.gm_cb.GetPage(page) != self._layerManager.curr_page:
+                if '3D' in self._layerManager.gm_cb.GetPage(page).maptree.mapdisplay.toolbars['map'].combo.GetString(1):
+                    self._layerManager.gm_cb.GetPage(page).maptree.mapdisplay.toolbars['map'].combo.Delete(1)
         self.toolbars['map'].Enable2D(False)
         
         # update status bar
@@ -548,6 +553,8 @@
                 pgnum = self.layerbook.GetPageIndex(self.page)
                 if pgnum > -1:
                     self.layerbook.SetSelection(pgnum)
+                    self._layerManager.curr_page = self.layerbook.GetCurrentPage()
+                    self.layerbook
         
         event.Skip()
         

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-06-02 16:47:28 UTC (rev 46520)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-06-02 19:21:06 UTC (rev 46521)
@@ -451,6 +451,10 @@
             type = self.tree.GetPyData(item)[0]['type']
             if item in self.layers:
                 continue
+            # "raster (double click to set properties)" - tries to load this 
+            # layer - no idea how to fix it
+            if ' ' in self.tree.GetPyData(item)[0]['maplayer'].name:
+                return
             try:
                 if type ==  'raster':
                     self.LoadRaster(item)

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-06-02 16:47:28 UTC (rev 46520)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-06-02 19:21:06 UTC (rev 46521)
@@ -204,8 +204,11 @@
             log = self.parent.GetLayerManager().GetLogWindow()
         
         if haveNviz:
-            choices.append(_('3D view'))
-            self.toolId['3d'] = 1
+            if not self.parent.GetLayerManager().existNviz:
+                choices.append(_('3D view'))
+                self.toolId['3d'] = 1
+            else:
+                self.toolId['3d'] = -1
         else:
             from nviz import errorMsg
             log.WriteCmdLog(_('3D view mode not available'))

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-06-02 16:47:28 UTC (rev 46520)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-06-02 19:21:06 UTC (rev 46521)
@@ -119,6 +119,7 @@
         self.workspaceChanged = False     # track changes in workspace
         self.georectifying = None         # reference to GCP class or None
         self.gcpmanagement = None         # reference to GCP class or None
+        self.existNviz = False
         # list of open dialogs
         self.dialogs        = dict()
         self.dialogs['preferences'] = None
@@ -269,6 +270,7 @@
         self.notebook.AddPage(self.nviz, text = _("3D view"))
         self.notebookPages['nviz'] = self.nviz
         self.SetNBPage('nviz')
+        self.existNviz = True
         
     def RemoveNviz(self):
         """!Remove nviz notebook page"""



More information about the grass-commit mailing list