[GRASS-SVN] r43142 - in grass/trunk/gui/wxpython: gui_modules icons
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 16 11:22:35 EDT 2010
Author: martinl
Date: 2010-08-16 15:22:35 +0000 (Mon, 16 Aug 2010)
New Revision: 43142
Modified:
grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
grass/trunk/gui/wxpython/icons/icon.py
Log:
wxGUI/nviz: set properties from cmd (d.vect)
Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2010-08-16 14:44:11 UTC (rev 43141)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2010-08-16 15:22:35 UTC (rev 43142)
@@ -490,6 +490,24 @@
Debug.msg(3, "GLWindow.UnloadDataLayers(): time = %f" % (stop-start))
+ def SetVectorFromCmd(self, item, data):
+ """!Set 3D view properties from cmd (d.vect)
+
+ @param item Layer Tree item
+ @param nviz data
+ """
+ cmd = self.tree.GetPyData(item)[0]['cmd']
+ if cmd[0] != 'd.vect':
+ return
+ for opt in cmd[1:]:
+ try:
+ key, value = opt.split('=')
+ except ValueError:
+ continue
+ if key == 'color':
+ data['lines']['color']['value'] = value
+ data['points']['color']['value'] = value
+
def SetMapObjProperties(self, item, id, nvizType):
"""!Set map object properties
@@ -516,7 +534,8 @@
elif type == 'vector':
# reset to default properties (lines/points)
data['vector'] = self.nvizDefault.SetVectorDefaultProp()
-
+ self.SetVectorFromCmd(item, data['vector'])
+
elif type == '3d-raster':
# reset to default properties
data[nvizType] = self.nvizDefault.SetVolumeDefaultProp()
Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py 2010-08-16 14:44:11 UTC (rev 43141)
+++ grass/trunk/gui/wxpython/icons/icon.py 2010-08-16 15:22:35 UTC (rev 43142)
@@ -339,17 +339,23 @@
desc = _('Show help for GCP Manager')),
# nviz
"nvizView": MetaIcon (img=Icons["nvizView"],
- label=_("Switch to view control page")),
+ label=_("Switch to view control page"),
+ desc=_("Change view settings")),
"nvizSurface": MetaIcon (img=Icons["nvizSurface"],
- label=_("Switch to surface (raster) control page")),
+ label=_("Switch to surface (raster) control page"),
+ desc=_("Change surface (loaded raster maps) settings")),
"nvizVector": MetaIcon (img=Icons["nvizVector"],
- label=_("Switch to vector (2D/3D) control page")),
+ label=_("Switch to vector (2D/3D) control page"),
+ desc=_("Change 2D/3D vector settings")),
"nvizVolume": MetaIcon (img=Icons["nvizVolume"],
- label=_("Switch to volume (3D raster) control page")),
+ label=_("Switch to volume (3D raster) control page"),
+ desc=_("Change volume (loaded 3D raster maps) settings")),
"nvizLight": MetaIcon (img=Icons["nvizLight"],
- label=_("Switch to lighting control page")),
+ label=_("Switch to lighting control page"),
+ desc=_("Change lighting settings")),
"nvizFringe": MetaIcon (img=Icons["nvizFringe"],
- label=_("Switch to fringe control page")),
+ label=_("Switch to fringe control page"),
+ desc=_("Switch on/off fringes")),
"nvizSettings": MetaIcon (img=Icons["settings"],
label=_("3D view mode tools"),
desc=_("Show/hide 3D view mode settings dialog")),
More information about the grass-commit
mailing list