[GRASS-SVN] r65450 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 12 13:23:29 PDT 2015


Author: martinl
Date: 2015-06-12 13:23:29 -0700 (Fri, 12 Jun 2015)
New Revision: 65450

Modified:
   grass/trunk/gui/wxpython/core/render.py
Log:
adding 3d raster layer broken (#2694)


Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2015-06-12 19:51:52 UTC (rev 65449)
+++ grass/trunk/gui/wxpython/core/render.py	2015-06-12 20:23:29 UTC (rev 65450)
@@ -464,7 +464,9 @@
         """
         self.layers = self.Map.GetListOfLayers(ltype='overlay', active=True)
         if not overlaysOnly:
-            self.layers += self.Map.GetListOfLayers(active=True)
+            self.layers += self.Map.GetListOfLayers(active=True,
+                                                    ltype='3d-raster',
+                                                    except_ltype=True)
         
         # reset progress
         self.ReportProgress()
@@ -1033,7 +1035,7 @@
             return None
 
     def GetListOfLayers(self, ltype = None, mapset = None, name = None,
-                        active = None, hidden = None):
+                        active = None, hidden = None, except_ltype=False):
         """Returns list of layers of selected properties or list of
         all layers.
 
@@ -1042,6 +1044,7 @@
         :param name: all layers with given name
         :param active: only layers with 'active' attribute set to True or False
         :param hidden: only layers with 'hidden' attribute set to True or False
+        :param except_ltype: True to return all layers with type not in ltype
 
         :return: list of selected layers
         """
@@ -1061,11 +1064,15 @@
         for layer in llist:
             # specified type only
             if ltype != None:
-                if one_type and layer.type != ltype:
-                    continue
-                elif not one_type and layer.type not in ltype:
-                    continue
-
+                if one_type:
+                    if (not except_ltype and layer.type != ltype) or \
+                        (except_ltype and layer.type == ltype):
+                        continue
+                elif not one_type:
+                    if (not except_ltype and layer.type not in ltype) or \
+                       (except_ltype and layer.type in ltype):
+                        continue
+            
             # mapset
             if (mapset != None and ltype != 'overlay') and \
                     layer.GetMapset() != mapset:



More information about the grass-commit mailing list