[GRASS-SVN] r61938 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 13 18:47:14 PDT 2014


Author: annakrat
Date: 2014-09-13 18:47:14 -0700 (Sat, 13 Sep 2014)
New Revision: 61938

Modified:
   grass/trunk/gui/wxpython/core/workspace.py
Log:
wxGUI: save and load wxnviz rotation in workspace

Modified: grass/trunk/gui/wxpython/core/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/core/workspace.py	2014-09-14 01:36:28 UTC (rev 61937)
+++ grass/trunk/gui/wxpython/core/workspace.py	2014-09-14 01:47:14 UTC (rev 61938)
@@ -655,7 +655,12 @@
             iview['dir']['y'] = -1
             iview['dir']['z'] = -1
             iview['dir']['use'] = False
-        
+        node_rot = node_view.find('rotation')
+        if node_rot is not None:
+            rotation = node_rot.text
+            if rotation:
+                iview['rotation'] = [float(item) for item in rotation.split(',')]
+
         view['background'] = {}
         color = self.__processLayerNvizNode(node_view, 'background_color', str)
         view['background']['color'] = tuple(map(int, color.split(':')))
@@ -1226,6 +1231,10 @@
         self.file.write('%s<z>%d</z>\n' % (' ' * self.indent, iview['focus']['z']))
         self.indent -= 4
         self.file.write('%s</focus>\n' % (' ' * self.indent))
+        # rotation
+        rotation = ','.join([str(i) for i in iview['rotation']]) if iview['rotation'] else ''
+        self.file.write('%s<rotation>%s</rotation>\n' % (' ' * self.indent, rotation))
+
         # background
         self.__writeTagWithValue('background_color', view['background']['color'][:3], format = 'd:%d:%d')
         



More information about the grass-commit mailing list