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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 15:08:05 EDT 2011


Author: annakrat
Date: 2011-08-03 12:08:04 -0700 (Wed, 03 Aug 2011)
New Revision: 47403

Modified:
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/gui_modules/workspace.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxNviz: enable opening new map window with 3D view after the previous one was closed

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-08-03 19:04:18 UTC (rev 47402)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-08-03 19:08:04 UTC (rev 47403)
@@ -208,12 +208,8 @@
             log = self.parent.GetLayerManager().GetLogWindow()
         
         if haveNviz:
-            if self.parent.GetLayerManager() and \
-                    not self.parent.GetLayerManager().existNviz:
-                choices.append(_('3D view'))
-                self.toolId['3d'] = 1
-            else:
-                self.toolId['3d'] = -1
+            choices.append(_('3D view'))
+            self.toolId['3d'] = 1
         else:
             from nviz import errorMsg
             log.WriteCmdLog(_('3D view mode not available'))

Modified: grass/trunk/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/workspace.py	2011-08-03 19:04:18 UTC (rev 47402)
+++ grass/trunk/gui/wxpython/gui_modules/workspace.py	2011-08-03 19:08:04 UTC (rev 47403)
@@ -1226,7 +1226,7 @@
         # ambient
         self.__writeTagWithValue('ambient', light['ambient'])
         # color
-        self.__writeTagWithValue('color', light['color'], format = 'd:%d:%d')
+        self.__writeTagWithValue('color', light['color'][:3], format = 'd:%d:%d')
         
         self.indent -= 4
         self.file.write('%s</light>\n' % (' ' * self.indent))

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-08-03 19:04:18 UTC (rev 47402)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-08-03 19:08:04 UTC (rev 47403)
@@ -114,7 +114,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
@@ -278,9 +278,8 @@
         idx = self.notebook.GetPageIndexByName('layers')
         self.notebook.InsertPage(indx = idx + 1, page = self.nviz, text = _("3D view"), name = 'nviz')
         self.notebook.SetSelectionByName('nviz')
-        self.existNviz = True
-        Debug.msg(5, "GMFrame.AddNviz(): end")
         
+        
     def RemoveNviz(self):
         """!Remove nviz notebook page"""
         # print self.notebook.GetPage(1)
@@ -875,13 +874,6 @@
             mdisp.MapWindow2D.UpdateMap()
             #nviz
             if gxwXml.displays[idx]['viewMode'] == '3d':
-                # check if nviz exist, if so, don't open workspace in 3D mode
-                # sofar only one nviz can exist
-                if self.existNviz:
-                    gcmd.GMessage(parent = self,
-                          message = _("3D view is not available. Please do not switch to 3D view "
-                                      "before opening workspace in 3D view mode."))
-                    continue
                 mdisp.AddToolbar(name = 'nviz')
                 self.nviz.UpdateState(view = gxwXml.nviz_state['view'],
                                               iview = gxwXml.nviz_state['iview'],



More information about the grass-commit mailing list