[GRASS-SVN] r61939 - in grass/branches/releasebranch_7_0: . gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 13 18:50:03 PDT 2014


Author: annakrat
Date: 2014-09-13 18:50:03 -0700 (Sat, 13 Sep 2014)
New Revision: 61939

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py
Log:
wxGUI: save and load wxnviz rotation in workspace (merge from trunk, r61938)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61829,61831,61851-61852,61854,61858,61888,61891,61905,61907,61913-61914,61916,61918,61921
   + /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61829,61831,61851-61852,61854,61858,61888,61891,61905,61907,61913-61914,61916,61918,61921,61938

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py	2014-09-14 01:47:14 UTC (rev 61938)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py	2014-09-14 01:50:03 UTC (rev 61939)
@@ -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