[GRASS-SVN] r60391 - grass/branches/releasebranch_7_0/gui/wxpython/animation

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 21 06:04:37 PDT 2014


Author: annakrat
Date: 2014-05-21 06:04:37 -0700 (Wed, 21 May 2014)
New Revision: 60391

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/animation/nviztask.py
Log:
wxGUI/animation: support 3D animation for points (merge from trunk, r59523)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/nviztask.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/nviztask.py	2014-05-21 12:55:26 UTC (rev 60390)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/nviztask.py	2014-05-21 13:04:37 UTC (rev 60391)
@@ -24,6 +24,7 @@
 from core.gcmd import RunCommand, GException
 from core.utils import GetLayerNameFromCmd, CmdToTuple, _
 from grass.script import task as gtask
+from core.settings import UserSettings
 
 
 class NvizTask:
@@ -77,6 +78,9 @@
                 self._processSurface(layer['nviz']['surface'], mapName=layerName)
             if 'volume' in layer['nviz']:
                 self._processVolume(layer['nviz']['volume'], mapName=layerName)
+            if 'vector' in layer['nviz']:
+                if 'points' in layer['nviz']['vector']:
+                    self._processPoints(layer['nviz']['vector']['points'], mapName=layerName)
 
     def _processSurface(self, surface, mapName):
         self._setMultiTaskParam('elevation_map', mapName)
@@ -124,6 +128,25 @@
         value = ','.join(pos)
         self._setMultiTaskParam('surface_position', value)
 
+    def _processPoints(self, points, mapName):
+        for attrib in ('color', 'size', 'width'):
+            if attrib in points:
+                val = points[attrib]['value']
+                self._setMultiTaskParam('vpoint_' + attrib, str(val))
+        if 'height' in points:
+            height = points['height']['value']
+            self._setMultiTaskParam('vpoint_position', '0,0,{h}'.format(h=height))
+        if 'marker' in points:
+            marker = list(UserSettings.Get(group='nviz', key='vector',
+                                           subkey=['points', 'marker'],
+                                           internal=True))[points['marker']['value']]
+            self._setMultiTaskParam('vpoint_marker', marker)
+        if 'mode' in points:
+            if points['mode']['type'] == '3d':
+                self._setMultiTaskParam('vpoint_mode', '3D')
+            else:
+                self._setMultiTaskParam('vpoint_mode', 'surface')
+
     def _processVolume(self, volume, mapName):
         self._setMultiTaskParam('volume', mapName)
 



More information about the grass-commit mailing list