[GRASS-SVN] r32487 - in grass/trunk/gui/wxpython: . gui_modules icons scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 3 07:20:50 EDT 2008


Author: martinl
Date: 2008-08-03 07:20:50 -0400 (Sun, 03 Aug 2008)
New Revision: 32487

Added:
   grass/trunk/gui/wxpython/scripts/Makefile
   grass/trunk/gui/wxpython/scripts/d.rast3d
Modified:
   grass/trunk/gui/wxpython/gui_modules/render.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
   grass/trunk/gui/wxpython/icons/icon.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: 3d raster map (voxel) dialog added

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2008-08-03 11:00:36 UTC (rev 32486)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2008-08-03 11:20:50 UTC (rev 32487)
@@ -199,7 +199,7 @@
 
     def SetType(self, type):
         """Set layer type"""
-        if type not in ('raster', 'vector', 'overlay', 'command'):
+        if type not in ('raster', '3d-raster', 'vector', 'overlay', 'command'):
             raise gcmd.GStdError(_("Unsupported map layer type '%s'") % str(type))
         
         self.type = type

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-03 11:00:36 UTC (rev 32486)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-03 11:20:50 UTC (rev 32487)
@@ -128,6 +128,9 @@
         trgif = Icons["addrast"].GetBitmap(bmpsize)
         self.rast_icon = il.Add(trgif)
 
+        trgif = Icons["addrast3d"].GetBitmap(bmpsize)
+        self.rast3d_icon = il.Add(trgif)
+
         trgif = Icons["addrgb"].GetBitmap(bmpsize)
         self.rgb_icon = il.Add(trgif)
 
@@ -497,7 +500,7 @@
         """Add new item to the layer tree, create corresponding MapLayer instance.
         Launch property dialog if needed (raster, vector, etc.)
 
-        @param ltype layer type (raster, vector, ...)
+        @param ltype layer type (raster, vector, 3d-raster, ...)
         @param lname layer name
         @param lchecked if True layer is checked
         @param lopacity layer opacity level
@@ -577,6 +580,9 @@
         if ltype == 'raster':
             self.SetItemImage(layer, self.rast_icon)
             self.SetItemText(layer, '%s %s' % (_('raster'), _('(double click to set properties)')))
+        elif ltype == '3d-raster':
+            self.SetItemImage(layer, self.rast3d_icon)
+            self.SetItemText(layer, '%s %s' % (_('3d raster'), _('(double click to set properties)')))
         elif ltype == 'rgb':
             self.SetItemImage(layer, self.rgb_icon)
             self.SetItemText(layer, '%s %s' % (_('RGB'), _('(double click to set properties)')))
@@ -713,6 +719,10 @@
                 cmd.append('-o')
             menuform.GUI().ParseCommand(cmd, completed=(self.GetOptData,layer,params),
                                         parentframe=self)
+        elif ltype == '3d-raster':
+            cmd = ['d.rast3d']
+            menuform.GUI().ParseCommand(cmd, completed=(self.GetOptData,layer,params),
+                                        parentframe=self)
         elif ltype == 'rgb':
             menuform.GUI().ParseCommand(['d.rgb'], completed=(self.GetOptData,layer,params),
                                         parentframe=self)

Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py	2008-08-03 11:00:36 UTC (rev 32486)
+++ grass/trunk/gui/wxpython/icons/icon.py	2008-08-03 11:20:50 UTC (rev 32487)
@@ -80,14 +80,14 @@
     "digUndo" : wx.ART_ERROR, # FIXME
     "digSettings" : 'settings.gif',
     "digAdditionalTools" : wx.ART_ERROR, # FIXME
-    # gis manager
+    # layer manager
     "newdisplay" : 'gui-startmon.gif',
     "workspaceNew" : 'file-new.gif',
     "workspaceLoad" : 'file-new.gif', # change the icon if possible
     "workspaceOpen" : 'file-open.gif',
     "workspaceSave" : 'file-save.gif',
     "addrast"    : 'element-cell.gif',
-    "addrast3d"    : 'element-grid3.gif',
+    "addrast3d"  : 'element-grid3.gif',
     "addvect"    : 'element-vector.gif',
     "addcmd"     : 'gui-cmd.gif',
     "addgrp"     : 'gui-group.gif',

Added: grass/trunk/gui/wxpython/scripts/Makefile
===================================================================
--- grass/trunk/gui/wxpython/scripts/Makefile	                        (rev 0)
+++ grass/trunk/gui/wxpython/scripts/Makefile	2008-08-03 11:20:50 UTC (rev 32487)
@@ -0,0 +1,14 @@
+MODULE_TOPDIR = ../../..
+
+include $(MODULE_TOPDIR)/include/Make/Platform.make
+include $(MODULE_TOPDIR)/include/Make/Dir.make
+
+ETCDIR = $(ETC)/gui/scripts
+
+default: install_scripts
+
+install_scripts:
+	$(MKDIR) $(ETCDIR)
+	$(INSTALL) d.rast3d $(ETCDIR)/
+
+clean: cleansubdirs

Added: grass/trunk/gui/wxpython/scripts/d.rast3d
===================================================================
--- grass/trunk/gui/wxpython/scripts/d.rast3d	                        (rev 0)
+++ grass/trunk/gui/wxpython/scripts/d.rast3d	2008-08-03 11:20:50 UTC (rev 32487)
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+############################################################################
+#
+# MODULE:       d.rast3d
+#
+# AUTHOR(S):    Martin Landa <landa.martin gmail.com>
+#
+# PURPOSE:	Wrapper for wxGUI -- add 3d raster map layer into layer tree
+#
+# COPYRIGHT:	(C) 2008 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (>=v2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+#############################################################################
+
+#%Module
+#%  description: Displays 3d raster data in the active frame on the graphics monitor.
+#%  keywords: display, raster3d, voxel
+#%End
+#%option
+#% key: input
+#% type: string
+#% gisprompt: old,grid3,3d-raster
+#% description: 3D raster map to be displayed
+#% required : yes
+#%END
+
+if  [ -z "$GISBASE" ] ; then
+ echo "You must be in GRASS GIS to run this program." >&2
+ exit 1
+fi
+
+if [ "$1" != "@ARGS_PARSED@" ] ; then
+  exec g.parser "$0" "$@"
+fi
+
+exit 0


Property changes on: grass/trunk/gui/wxpython/scripts/d.rast3d
___________________________________________________________________
Name: svn:executable
   + *

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2008-08-03 11:00:36 UTC (rev 32486)
+++ grass/trunk/gui/wxpython/wxgui.py	2008-08-03 11:20:50 UTC (rev 32487)
@@ -1217,17 +1217,17 @@
         addvect = wx.MenuItem(vectmenu, -1, Icons["addvect"].GetLabel())
         addvect.SetBitmap(Icons["addvect"].GetBitmap(self.iconsize))
         vectmenu.AppendItem(addvect)
-        self.Bind(wx.EVT_MENU, self.addVector, addvect)
+        self.Bind(wx.EVT_MENU, self.AddVector, addvect)
 
         addtheme = wx.MenuItem(vectmenu, -1, Icons["addthematic"].GetLabel())
         addtheme.SetBitmap(Icons["addthematic"].GetBitmap(self.iconsize))
         vectmenu.AppendItem(addtheme)
-        self.Bind(wx.EVT_MENU, self.addThemeMap, addtheme)
+        self.Bind(wx.EVT_MENU, self.AddThemeMap, addtheme)
 
         addchart = wx.MenuItem(vectmenu, -1, Icons["addchart"].GetLabel())
         addchart.SetBitmap(Icons["addchart"].GetBitmap(self.iconsize))
         vectmenu.AppendItem(addchart)
-        self.Bind(wx.EVT_MENU, self.addThemeChart, addchart)
+        self.Bind(wx.EVT_MENU, self.AddThemeChart, addchart)
 
         # Popup the menu.  If an item is selected then its handler
         # will be called before PopupMenu returns.
@@ -1273,6 +1273,10 @@
         self.notebook.SetSelection(0)
         self.curr_page.maptree.AddLayer('raster')
 
+    def AddRaster3d(self, event):
+        self.notebook.SetSelection(0)
+        self.curr_page.maptree.AddLayer('3d-raster')
+
     def AddRGB(self, event):
         """Add RGB layer"""
         self.notebook.SetSelection(0)
@@ -1298,21 +1302,17 @@
         self.notebook.SetSelection(0)
         self.curr_page.maptree.AddLayer('rastnum')
 
-    def AddRaster3d(self, event):
-        self.notebook.SetSelection(0)
-        self.curr_page.maptree.AddLayer('raster')
-
-    def addVector(self, event):
+    def AddVector(self, event):
         """Add vector layer"""
         self.notebook.SetSelection(0)
         self.curr_page.maptree.AddLayer('vector')
 
-    def addThemeMap(self, event):
+    def AddThemeMap(self, event):
         """Add thematic map layer"""
         self.notebook.SetSelection(0)
         self.curr_page.maptree.AddLayer('thememap')
 
-    def addThemeChart(self, event):
+    def AddThemeChart(self, event):
         """Add thematic chart layer"""
         self.notebook.SetSelection(0)
         self.curr_page.maptree.AddLayer('themechart')



More information about the grass-commit mailing list