Browse Source

wxNviz: enable opening new map window with 3D view after the previous one was closed

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47403 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 years ago
parent
commit
01f46bc57b

+ 2 - 6
gui/wxpython/gui_modules/toolbars.py

@@ -208,12 +208,8 @@ class MapToolbar(AbstractToolbar):
             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'))

+ 1 - 1
gui/wxpython/gui_modules/workspace.py

@@ -1226,7 +1226,7 @@ class WriteWorkspaceFile(object):
         # 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))

+ 2 - 10
gui/wxpython/wxgui.py

@@ -114,7 +114,7 @@ class GMFrame(wx.Frame):
         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,8 +278,7 @@ class GMFrame(wx.Frame):
         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"""
@@ -875,13 +874,6 @@ class GMFrame(wx.Frame):
             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'],