[GRASS-SVN] r33319 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 7 15:55:52 EDT 2008
Author: martinl
Date: 2008-09-07 15:55:52 -0400 (Sun, 07 Sep 2008)
New Revision: 33319
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
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/render.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: minor fixes in nviz and atm
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py 2008-09-07 17:29:25 UTC (rev 33318)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py 2008-09-07 19:55:52 UTC (rev 33319)
@@ -1838,8 +1838,10 @@
Return True if map has been redrawn, False if no map is given
"""
list = self.FindWindowById(self.layerPage[self.layer]['data'])
- cats = list.GetSelectedItems() # FIXME: category can be hiden in list
-
+ cats = {
+ self.layer : list.GetSelectedItems()
+ }
+
if self.mapdisplay.Map.GetLayerIndex(self.qlayer) < 0:
self.qlayer = None
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py 2008-09-07 17:29:25 UTC (rev 33318)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py 2008-09-07 19:55:52 UTC (rev 33319)
@@ -315,25 +315,34 @@
return 1
- def LoadDataLayers(self):
- """Load raster/vector from current layer tree
-
- @todo volumes
- """
- listOfItems = []
+ def _GetDataLayers(self, item, litems):
+ """Return get list of enabled map layers"""
# load raster & vector maps
- item = self.tree.GetFirstChild(self.tree.root)[0]
while item and item.IsOk():
type = self.tree.GetPyData(item)[0]['type']
+ if type == 'group':
+ subItem = self.tree.GetFirstChild(item)[0]
+ self._GetDataLayers(subItem, litems)
+ item = self.tree.GetNextSibling(item)
+
if not item.IsChecked() or \
type not in ('raster', 'vector', '3d-raster'):
item = self.tree.GetNextSibling(item)
continue
- listOfItems.append(item)
+ litems.append(item)
item = self.tree.GetNextSibling(item)
+
+ def LoadDataLayers(self):
+ """Load raster/vector from current layer tree
+ @todo volumes
+ """
+ listOfItems = []
+ item = self.tree.GetFirstChild(self.tree.root)[0]
+ self._GetDataLayers(item, listOfItems)
+
start = time.time()
while(len(listOfItems) > 0):
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py 2008-09-07 17:29:25 UTC (rev 33318)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py 2008-09-07 19:55:52 UTC (rev 33319)
@@ -1895,9 +1895,9 @@
data = self.mapWindow.GetSelectedLayer(type='nviz')
for attrb in ('width', 'color', 'mode'):
data['vector']['lines'][attrb]['update'] = None
- data['vector']['lines']['width'] = width
- data['vector']['lines']['color'] = color
- data['vector']['lines']['mode'] = mode
+ data['vector']['lines']['width']['value'] = width
+ data['vector']['lines']['color']['value'] = color
+ data['vector']['lines']['mode']['value'] = mode
# update properties
event = wxUpdateProperties(data=data)
@@ -2313,7 +2313,7 @@
page=panel,
text=" %s " % _("Layer properties"),
select=True)
-
+
self.UpdateVectorPage(layer, data['vector'])
elif pageId == 'volume':
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2008-09-07 17:29:25 UTC (rev 33318)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2008-09-07 19:55:52 UTC (rev 33319)
@@ -872,7 +872,8 @@
os.environ["GRASS_HEIGHT"] = str(self.height)
if UserSettings.Get(group='display', key='driver', subkey='type') == 'cairo':
os.environ["GRASS_AUTO_WRITE"] = "TRUE"
- del os.environ["GRASS_RENDER_IMMEDIATE"]
+ if os.environ.has_key("GRASS_RENDER_IMMEDIATE"):
+ del os.environ["GRASS_RENDER_IMMEDIATE"]
else:
os.environ["GRASS_PNG_AUTO_WRITE"] = "TRUE"
os.environ["GRASS_PNG_READ"] = "FALSE"
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py 2008-09-07 17:29:25 UTC (rev 33318)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py 2008-09-07 19:55:52 UTC (rev 33319)
@@ -1326,9 +1326,10 @@
"""Enable/disable items in layer tree"""
item = self.GetFirstChild(self.root)[0]
while item and item.IsOk():
- ltype = self.GetPyData(item)[0]['maplayer'].type
- if type == ltype:
+ mapLayer = self.GetPyData(item)[0]['maplayer']
+ if mapLayer and type == mapLayer.type:
self.EnableItem(item, enable)
+
item = self.GetNextSibling(item)
def __FindSubItemByData(self, item, key, value):
More information about the grass-commit
mailing list