[GRASS-SVN] r64474 - in grass/branches/releasebranch_7_0/gui/wxpython: mapdisp nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 5 08:14:30 PST 2015


Author: annakrat
Date: 2015-02-05 08:14:29 -0800 (Thu, 05 Feb 2015)
New Revision: 64474

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py
Log:
wxGUI/nviz: attempt to fix error on Windows when switching to 3D for the second time due to different order of initialization steps (merge from trunk, r64473)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py	2015-02-05 16:10:04 UTC (rev 64473)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py	2015-02-05 16:14:29 UTC (rev 64474)
@@ -102,6 +102,7 @@
         # Emitted when starting (switching to) 3D mode.
         # Parameter firstTime specifies if 3D was already actived.
         self.starting3dMode = Signal("MapFrame.starting3dMode")
+        self.starting3dModeSetInitialMaps = Signal("MapFrame.starting3dMode")
 
         # Emitted when ending (switching from) 3D mode.
         self.ending3dMode = Signal("MapFrame.ending3dMode")
@@ -382,6 +383,7 @@
             self.MapWindow3D.overlayActivated.connect(self._activateOverlay)
             self.MapWindow3D.overlayHidden.connect(self._hideOverlay)
             self.legend.overlayChanged.connect(self.MapWindow3D.UpdateOverlays)
+            self.starting3dModeSetInitialMaps.emit()
         else:
             self._switchMapWindow(self.MapWindow3D)
             os.environ['GRASS_REGION'] = self.Map.SetRegion(windres = True, windres3 = True)
@@ -396,6 +398,9 @@
             self.starting3dMode.emit(firstTime=False)
 
             self.MapWindow3D.ResetViewHistory()
+            # explicitly load layers so that we can call SetInitialMaps after that
+            self.MapWindow3D.LoadDataLayers()
+            self.starting3dModeSetInitialMaps.emit()
 
         self._giface.updateMap.disconnect(self.MapWindow2D.UpdateMap)
         self._giface.updateMap.connect(self.MapWindow3D.UpdateMap)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py	2015-02-05 16:10:04 UTC (rev 64473)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py	2015-02-05 16:14:29 UTC (rev 64474)
@@ -114,6 +114,7 @@
         # bindings
         self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
         self.Bind(wx.EVT_SIZE, self.OnSize)
+        self.mapDisplay.starting3dModeSetInitialMaps.connect(self.SetInitialMaps)
         
         self.mapWindow.GetAnimation().animationFinished.connect(self.OnAnimationFinished)
         self.mapWindow.GetAnimation().animationUpdateIndex.connect(self.OnAnimationUpdateIndex)
@@ -124,7 +125,6 @@
         wx.CallAfter(self.SetPage, 'view')
         wx.CallAfter(self.UpdateScrolling, (self.foldpanelData, self.foldpanelAppear,
                                             self.foldpanelAnalysis))       
-        wx.CallAfter(self.SetInitialMaps)
         
     def SetInitialMaps(self):
         """Set initial raster and vector map"""



More information about the grass-commit mailing list