[GRASS-SVN] r47361 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 02:45:46 EDT 2011


Author: annakrat
Date: 2011-08-02 23:45:46 -0700 (Tue, 02 Aug 2011)
New Revision: 47361

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/preferences.py
Log:
wxNviz: change in z-exag behaviour

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-08-02 21:19:28 UTC (rev 47360)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-08-03 06:45:46 UTC (rev 47361)
@@ -604,8 +604,10 @@
                               data['persp']['value'],
                               data['twist']['value'])
         
+        ## multiple z-exag value from slider by original value computed in ogsf so it scales
+        ## correctly with maps of different height ranges        
         if event and event.zExag and 'value' in data['z-exag']:
-            self._display.SetZExag(data['z-exag']['value'])
+            self._display.SetZExag(self.iview['z-exag']['original'] * data['z-exag']['value'])
         if self.iview['focus']['x'] != -1:
             self._display.SetFocus(self.iview['focus']['x'], self.iview['focus']['y'],
                                    self.iview['focus']['z'])
@@ -1256,21 +1258,18 @@
 
     def ResetView(self):
         """!Reset to default view"""
-        self.view['z-exag']['value'], \
+        self.iview['z-exag']['original'], \
             self.iview['height']['value'], \
             self.iview['height']['min'], \
             self.iview['height']['max'] = self._display.SetViewDefault()
+            
+        ## set initial z-exag value at 1X    
+        self.view['z-exag']['value'] = 1.0
         
         self.view['z-exag']['min'] = UserSettings.Get(group = 'nviz', key = 'view',
-                                                      subkey = ('z-exag', 'min'))
+                                                      subkey = ('z-exag', 'min'))        
         zexagMax = UserSettings.Get(group = 'nviz', key = 'view',
-                                    subkey = ('z-exag', 'max'))
-        if zexagMax < self.view['z-exag']['value']:
-            self.view['z-exag']['max'] = self.view['z-exag']['value']
-        elif self.view['z-exag']['value'] < 1:
-            self.view['z-exag']['max'] = 10 * self.view['z-exag']['value']
-        else:
-            self.view['z-exag']['max'] = zexagMax
+                                    subkey = ('z-exag', 'max'))        
         
         self.view['position']['x'] = UserSettings.Get(group = 'nviz', key = 'view',
                                                  subkey = ('position', 'x'))

Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py	2011-08-02 21:19:28 UTC (rev 47360)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py	2011-08-03 06:45:46 UTC (rev 47361)
@@ -709,6 +709,8 @@
         self.internalSettings['nviz']['view']['persp']['max'] = 100
         self.internalSettings['nviz']['view']['height'] = {}
         self.internalSettings['nviz']['view']['height']['value'] = -1
+        self.internalSettings['nviz']['view']['z-exag'] = {}
+        self.internalSettings['nviz']['view']['z-exag']['original'] = 1
         self.internalSettings['nviz']['view']['focus'] = {}
         self.internalSettings['nviz']['view']['focus']['x'] = -1
         self.internalSettings['nviz']['view']['focus']['y'] = -1



More information about the grass-commit mailing list