[GRASS-SVN] r43143 - in grass/branches/develbranch_6/gui/wxpython: gui_modules icons

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 16 11:25:26 EDT 2010


Author: martinl
Date: 2010-08-16 15:25:26 +0000 (Mon, 16 Aug 2010)
New Revision: 43143

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/icons/icon.py
Log:
wxGUI/nviz: set properties from cmd (d.vect)
(merge r43142 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-08-16 15:22:35 UTC (rev 43142)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py	2010-08-16 15:25:26 UTC (rev 43143)
@@ -489,6 +489,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
         
@@ -515,7 +533,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/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-08-16 15:22:35 UTC (rev 43142)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-08-16 15:25:26 UTC (rev 43143)
@@ -336,17 +336,23 @@
                             desc=_("Settings dialog for georectification tool")),
     # 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