[GRASS-SVN] r44028 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 24 07:59:52 EDT 2010


Author: martinl
Date: 2010-10-24 04:59:52 -0700 (Sun, 24 Oct 2010)
New Revision: 44028

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp_window.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/render.py
Log:
wxGUI: fix zooming to RBG layers
(merge r44027 from devbr6)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py	2010-10-24 11:56:41 UTC (rev 44027)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py	2010-10-24 11:59:52 UTC (rev 44028)
@@ -443,7 +443,10 @@
                 vect.append(mapLayer.GetName())
             elif mltype == '3d-raster':
                 rast3d.append(mapLayer.GetName())
-
+            elif mltype == 'rgb':
+                for rname in mapLayer.GetName().splitlines():
+                    rast.append(rname)
+        
         cmd = ['g.region']
         if rast:
             cmd.append('rast=%s' % ','.join(rast))

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2010-10-24 11:56:41 UTC (rev 44027)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2010-10-24 11:59:52 UTC (rev 44028)
@@ -1870,9 +1870,8 @@
         self.propwin[type] = propwin
 
     def OnZoomToMap(self, event):
-        """!
-        Set display extents to match selected raster (including NULLs)
-        or vector map.
+        """!Set display extents to match selected raster (including
+        NULLs) or vector map.
         """
         self.MapWindow.ZoomToMap()
 

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp_window.py	2010-10-24 11:56:41 UTC (rev 44027)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp_window.py	2010-10-24 11:59:52 UTC (rev 44028)
@@ -914,8 +914,7 @@
         return True
 
     def DrawCompRegionExtent(self):
-        """!
-        Draw computational region extent in the display
+        """!Draw computational region extent in the display
         
         Display region is drawn as a blue box inside the computational region,
         computational region inside a display region as a red box).
@@ -2735,12 +2734,12 @@
         """!Set display extents to match selected raster
         or vector map(s).
 
-        @param layer list of layers to be zoom to
-        @param ignoreNulls True to ignore null-values
+        @param layers list of layers to be zoom to
+        @param ignoreNulls True to ignore null-values (valid only for rasters)
         @param render True to re-render display
         """
         zoomreg = {}
-
+        
         if not layers:
             layers = self.GetSelectedLayer(multi = True)
         
@@ -2763,7 +2762,10 @@
                     updated = True
                 else:
                     vect.append(l.name)
-        
+            elif l.type == 'rgb':
+                for rname in l.GetName().splitlines():
+                    rast.append(rname)
+            
         if not updated:
             self.Map.GetRegion(rast = rast,
                                vect = vect,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/render.py	2010-10-24 11:56:41 UTC (rev 44027)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/render.py	2010-10-24 11:59:52 UTC (rev 44028)
@@ -251,7 +251,7 @@
         
         return int (self.opacity * 100)
 
-    def GetName(self, fullyQualified=True):
+    def GetName(self, fullyQualified = True):
         """!Get map layer name
 
         @param fullyQualified if True return 'name at mapset' otherwise



More information about the grass-commit mailing list