[GRASS-SVN] r42757 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 10 17:20:06 EDT 2010


Author: martinl
Date: 2010-07-10 21:20:06 +0000 (Sat, 10 Jul 2010)
New Revision: 42757

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
Log:
wxGUI/nviz: various fixes (save to file)
(merge r42756 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-07-10 21:17:23 UTC (rev 42756)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-07-10 21:20:06 UTC (rev 42757)
@@ -38,11 +38,7 @@
 from preferences import globalSettings as UserSettings
 from workspace import Nviz as NvizDefault
 
-try:
-    sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-    import grass6_wxnviz as wxnviz
-except ImportError:
-    pass
+import wxnviz
 
 wxUpdateProperties, EVT_UPDATE_PROP = NewEvent()
 wxUpdateView,       EVT_UPDATE_VIEW = NewEvent()
@@ -194,7 +190,7 @@
             self.init = True
         
         self.UpdateMap()
-        
+                
     def OnMouseAction(self, event):
         # change perspective with mouse wheel
         wheel = event.GetWheelRotation()
@@ -316,7 +312,6 @@
         start = time.clock()
         
         self.resize = False
-        self.SwapBuffers()
         
         if self.render['quick'] is False:
             self.parent.statusbarWin['progress'].Show()
@@ -337,6 +332,8 @@
         else: # None -> reuse last rendered image
             pass # TODO
         
+        self.SwapBuffers()
+        
         stop = time.clock()
         
         if self.render['quick'] is False:
@@ -344,11 +341,6 @@
             # hide process bar
             self.parent.statusbarWin['progress'].Hide()
         
-        #
-        # update statusbar
-        #
-        # self.parent.StatusbarUpdate()
-        
         Debug.msg(3, "GLWindow.UpdateMap(): quick = %d, -> time = %g" % \
                       (self.render['quick'], (stop-start)))
         
@@ -1133,9 +1125,8 @@
         @param width image width
         @param height image height
         """
-        self.SetCurrent()
         self._display.SaveToFile(FileName, width, height)
-        
+                
         # pbuffer = wx.EmptyBitmap(max(1, self.Map.width), max(1, self.Map.height))
         # dc = wx.BufferedPaintDC(self, pbuffer)
         # dc.Clear()

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py	2010-07-10 21:17:23 UTC (rev 42756)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py	2010-07-10 21:20:06 UTC (rev 42757)
@@ -234,8 +234,8 @@
                       pos = (0, 0), flag = wx.ALIGN_CENTER_VERTICAL)
         
         color = csel.ColourSelect(panel, id = wx.ID_ANY,
-                                  colour = UserSettings.Get(group = 'nviz', key = 'settings',
-                                                            subkey = ['general', 'bgcolor']),
+                                  colour = UserSettings.Get(group = 'nviz', key = 'view',
+                                                            subkey = ['background', 'color']),
                                   size = globalvar.DIALOG_COLOR_SIZE)
         self.win['view']['bgcolor'] = color.GetId()
         color.Bind(csel.EVT_COLOURSELECT, self.OnBgColor)
@@ -258,7 +258,7 @@
                                                 agwStyle = globalvar.FNPageDStyle)
         else:
             self.notebookData = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
-                                                agwStyle = globalvar.FNPageDStyle)
+                                                style = globalvar.FNPageDStyle)
         
         # surface page
         self.notebookData.AddPage(page = self._createSurfacePage(),

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py	2010-07-10 21:17:23 UTC (rev 42756)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py	2010-07-10 21:20:06 UTC (rev 42757)
@@ -1100,7 +1100,7 @@
         heightOrig = self.height
         
         self.ResizeWindow(width, height)
-        GS_clear(self.data.bgcolor)
+        GS_clear(Nviz_get_bgcolor(self.data))
         self.Draw(False, -1)
         if itype == 'ppm':
             GS_write_ppm(filename)



More information about the grass-commit mailing list