Browse Source

wxGUI/nviz: set properties from cmd (d.vect)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43142 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
55ade311f2
2 changed files with 32 additions and 7 deletions
  1. 20 1
      gui/wxpython/gui_modules/nviz_mapdisp.py
  2. 12 6
      gui/wxpython/icons/icon.py

+ 20 - 1
gui/wxpython/gui_modules/nviz_mapdisp.py

@@ -490,6 +490,24 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
         
         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 @@ class GLWindow(MapWindow, glcanvas.GLCanvas):
             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()

+ 12 - 6
gui/wxpython/icons/icon.py

@@ -339,17 +339,23 @@ Icons = {
                         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")),