[GRASS-SVN] r43058 - in grass/trunk/gui: icons/grass2 wxpython/gui_modules wxpython/icons

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 12 04:20:02 EDT 2010


Author: martinl
Date: 2010-08-12 08:20:02 +0000 (Thu, 12 Aug 2010)
New Revision: 43058

Added:
   grass/trunk/gui/icons/grass2/3d-fringe.png
   grass/trunk/gui/icons/grass2/3d-light.png
   grass/trunk/gui/icons/grass2/3d-raster.png
   grass/trunk/gui/icons/grass2/3d-vector.png
   grass/trunk/gui/icons/grass2/3d-view.png
   grass/trunk/gui/icons/grass2/3d-volume.png
Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/icons/grass2_icons.py
   grass/trunk/gui/wxpython/icons/grass_icons.py
   grass/trunk/gui/wxpython/icons/icon.py
   grass/trunk/gui/wxpython/icons/silk_icons.py
Log:
wxGUI/nviz: more icons (view/data/appearance) in the wxNViz toolbar -
thanks to Robert Szczepanek for new wxNviz icons


Added: grass/trunk/gui/icons/grass2/3d-fringe.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-fringe.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass/trunk/gui/icons/grass2/3d-light.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-light.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass/trunk/gui/icons/grass2/3d-raster.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-raster.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass/trunk/gui/icons/grass2/3d-vector.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-vector.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass/trunk/gui/icons/grass2/3d-view.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-view.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass/trunk/gui/icons/grass2/3d-volume.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/3d-volume.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -100,7 +100,8 @@
         """!Create view settings page"""
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
-        self.page['view'] = { 'id' : 0 }
+        self.page['view'] = { 'id' : 0,
+                              'notebook' : self.GetId()}
         
         pageSizer = wx.BoxSizer(wx.VERTICAL)
         box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
@@ -302,10 +303,9 @@
         """!Create view settings page"""
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
-        self.page['surface'] = {}
-        self.page['surface']['id'] = 1
-        self.page['surface']['panel'] = panel.GetId()
-        
+        self.page['surface'] = { 'id' : 0,
+                                 'panel' : panel.GetId(),
+                                 'notebook' : self.notebookData.GetId() }
         pageSizer = wx.BoxSizer(wx.VERTICAL)
         
         self.win['surface'] = {}
@@ -612,10 +612,9 @@
         """!Create view settings page"""
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
-        self.page['vector'] = {}
-        self.page['vector']['id'] = 2
-        self.page['vector']['panel'] = panel.GetId()
-        
+        self.page['vector'] = { 'id' : 1,
+                                'panel' : panel.GetId(),
+                                'notebook' : self.notebookData.GetId() }
         pageSizer = wx.BoxSizer(wx.VERTICAL)
         
         self.win['vector'] = {}
@@ -876,10 +875,9 @@
         """!Create view settings page"""
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
-        self.page['volume'] = {}
-        self.page['volume']['id'] = 3
-        self.page['volume']['panel'] = panel.GetId()
-        
+        self.page['volume'] = { 'id' : 2,
+                                'panel' : panel.GetId(),
+                                'notebook' : self.notebookData.GetId() }
         pageSizer = wx.BoxSizer(wx.VERTICAL)
         
         self.win['volume'] = {}
@@ -1117,7 +1115,8 @@
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
         
-        self.page['light'] = { 'id' : 4 } 
+        self.page['light'] = { 'id' : 0, 
+                               'notebook' : self.notebookAppearance.GetId() }
         self.win['light'] = {}
         
         pageSizer = wx.BoxSizer(wx.VERTICAL)
@@ -1240,7 +1239,8 @@
         panel = SP.ScrolledPanel(parent = self, id = wx.ID_ANY)
         panel.SetupScrolling(scroll_x = False)
         
-        self.page['fringe'] = { 'id' : 2 } 
+        self.page['fringe'] = { 'id' : 1,
+                                'notebook' : self.notebookAppearance.GetId() }
         self.win['fringe'] = {}
 
         pageSizer = wx.BoxSizer(wx.VERTICAL)
@@ -2783,7 +2783,15 @@
         
     def SetPage(self, name):
         """!Get named page"""
-        self.SetSelection(self.page[name]['id'])
+        if name == 'view':
+            self.SetSelection(0)
+        elif name in ('surface', 'vector', 'volume'):
+            self.SetSelection(1)
+        else:
+            self.SetSelection(2)
+        win = self.FindWindowById(self.page[name]['notebook'])
+        
+        win.SetSelection(self.page[name]['id'])
 
 class PositionWindow(wx.Window):
     """!Abstract position control window, see subclasses

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -1535,11 +1535,38 @@
         
     def ToolbarData(self):
         """!Toolbar data"""
+        self.view = wx.NewId()
+        self.surface = wx.NewId()
+        self.vector = wx.NewId()
+        self.volume = wx.NewId()
+        self.light = wx.NewId()
+        self.fringe = wx.NewId()
         self.settings = wx.NewId()
         self.quit = wx.NewId()
-        
+
         # tool, label, bitmap, kind, shortHelp, longHelp, handler
         return   (
+            (self.view, "view", Icons["nvizView"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizView"].GetLabel(), Icons["nvizView"].GetDesc(),
+             self.OnShowPage),
+            ("", "", "", "", "", "", ""),
+            (self.surface, "surface", Icons["nvizSurface"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizSurface"].GetLabel(), Icons["nvizSurface"].GetDesc(),
+             self.OnShowPage),
+            (self.vector, "vector", Icons["nvizVector"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizVector"].GetLabel(), Icons["nvizVector"].GetDesc(),
+             self.OnShowPage),
+            (self.volume, "volume", Icons["nvizVolume"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizVolume"].GetLabel(), Icons["nvizVolume"].GetDesc(),
+             self.OnShowPage),
+            ("", "", "", "", "", "", ""),
+            (self.light, "light", Icons["nvizLight"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizLight"].GetLabel(), Icons["nvizLight"].GetDesc(),
+             self.OnShowPage),
+            (self.fringe, "fringe", Icons["nvizFringe"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["nvizFringe"].GetLabel(), Icons["nvizFringe"].GetDesc(),
+             self.OnShowPage),
+            ("", "", "", "", "", "", ""),
             (self.settings, "settings", Icons["nvizSettings"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["nvizSettings"].GetLabel(), Icons["nvizSettings"].GetDesc(),
              self.OnSettings),
@@ -1548,6 +1575,31 @@
              self.OnExit),
             )
     
+    def OnShowPage(self, event):
+        """!Go to the selected page"""
+        lmgr = self.parent.GetLayerManager()
+        if not lmgr or not hasattr(lmgr, "nviz"):
+            event.Skip()
+            return
+        
+        eId = event.GetId()
+        if eId == self.view:
+            lmgr.nviz.SetPage('view')
+        elif eId == self.surface:
+            lmgr.nviz.SetPage('surface')
+        elif eId == self.surface:
+            lmgr.nviz.SetPage('surface')
+        elif eId == self.vector:
+            lmgr.nviz.SetPage('vector')
+        elif eId == self.volume:
+            lmgr.nviz.SetPage('volume')
+        elif eId == self.light:
+            lmgr.nviz.SetPage('light')
+        elif eId == self.fringe:
+            lmgr.nviz.SetPage('fringe')
+        
+        lmgr.Raise()
+        
     def OnSettings(self, event):
         """!Show nviz notebook page"""
         if not self.settingsDialog:

Modified: grass/trunk/gui/wxpython/icons/grass2_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass2_icons.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/icons/grass2_icons.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -109,6 +109,13 @@
     "pythonSave"     : 'python-export.png',
     "modelProperties" : 'options.png',
     "modelVariables" : 'modeler-variables.png',
+    # 3d view
+    "nvizView"       : '3d-view.png',
+    "nvizSurface"    : '3d-raster.png',
+    "nvizVector"     : '3d-vector.png',
+    "nvizVolume"     : '3d-volume.png',
+    "nvizLight"      : '3d-light.png',
+    "nvizFringe"     : '3d-fringe.png',
     # various
     "settings"       : 'settings.png',
     'redraw'         : 'redraw.png',

Modified: grass/trunk/gui/wxpython/icons/grass_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass_icons.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/icons/grass_icons.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -111,6 +111,13 @@
     "pythonSave"     : wx.ART_ERROR,
     "modelProperties" : wx.ART_ERROR,
     "modelVariables" : wx.ART_ERROR,
+    # 3d view
+    "nvizView"       : wx.ART_ERROR,
+    "nvizSurface"    : wx.ART_ERROR,
+    "nvizVector"     : wx.ART_ERROR,
+    "nvizVolume"     : wx.ART_ERROR,
+    "nvizLight"      : wx.ART_ERROR,
+    "nvizFringe"     : wx.ART_ERROR,
     # various
     "settings"       : 'edit-color.gif',
     "redraw"         : 'gui-display.gif',

Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/icons/icon.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -335,6 +335,18 @@
                             label=_("Settings"),
                             desc=_("Settings dialog for georectification tool")),
     # nviz
+    "nvizView": MetaIcon (img=Icons["nvizView"],
+                          label=_("Go to view control page")),
+    "nvizSurface": MetaIcon (img=Icons["nvizSurface"],
+                          label=_("Go to surface (raster) control page")),
+    "nvizVector": MetaIcon (img=Icons["nvizVector"],
+                          label=_("Go to vector (2D/3D) control page")),
+    "nvizVolume": MetaIcon (img=Icons["nvizVolume"],
+                          label=_("Go to volume (3D raster) control page")),
+    "nvizLight": MetaIcon (img=Icons["nvizLight"],
+                          label=_("Go to lighting control page")),
+    "nvizFringe": MetaIcon (img=Icons["nvizFringe"],
+                          label=_("Go to fringe control page")),
     "nvizSettings": MetaIcon (img=Icons["settings"],
                               label=_("3D view mode tools"),
                               desc=_("Show/hide 3D view mode tools dialog")),

Modified: grass/trunk/gui/wxpython/icons/silk_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/silk_icons.py	2010-08-12 07:37:29 UTC (rev 43057)
+++ grass/trunk/gui/wxpython/icons/silk_icons.py	2010-08-12 08:20:02 UTC (rev 43058)
@@ -113,6 +113,13 @@
     "pythonSave"     : wx.ART_ERROR,
     "modelProperties" : wx.ART_ERROR,
     "modelVariables" : wx.ART_ERROR,
+    # 3d view
+    "nvizView"       : wx.ART_ERROR,
+    "nvizSurface"    : wx.ART_ERROR,
+    "nvizVector"     : wx.ART_ERROR,
+    "nvizVolume"     : wx.ART_ERROR,
+    "nvizLight"      : wx.ART_ERROR,
+    "nvizFringe"     : wx.ART_ERROR,
     # various
     "settings"     : 'color_swatch.png',
     "redraw"       : 'arrow_refresh.png',



More information about the grass-commit mailing list