[GRASS-SVN] r59523 - grass/trunk/gui/wxpython/animation
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 30 16:14:28 PDT 2014
Author: annakrat
Date: 2014-03-30 16:14:28 -0700 (Sun, 30 Mar 2014)
New Revision: 59523
Modified:
grass/trunk/gui/wxpython/animation/nviztask.py
Log:
wxGUI/animation: support 3D animation for points
Modified: grass/trunk/gui/wxpython/animation/nviztask.py
===================================================================
--- grass/trunk/gui/wxpython/animation/nviztask.py 2014-03-30 18:51:43 UTC (rev 59522)
+++ grass/trunk/gui/wxpython/animation/nviztask.py 2014-03-30 23:14:28 UTC (rev 59523)
@@ -28,6 +28,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:
@@ -81,6 +82,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)
@@ -128,6 +132,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