[GRASS-SVN] r43027 - in grass/branches/develbranch_6: gui/wxpython
gui/wxpython/gui_modules gui/wxpython/icons
gui/wxpython/scripts include/Make
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 9 14:50:29 EDT 2010
Author: martinl
Date: 2010-08-09 18:50:29 +0000 (Mon, 09 Aug 2010)
New Revision: 43027
Added:
grass/branches/develbranch_6/gui/wxpython/scripts/Makefile
grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d.py
grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd.py
grass/branches/develbranch_6/gui/wxpython/scripts/p.db.py
grass/branches/develbranch_6/gui/wxpython/scripts/p.mon.py
grass/branches/develbranch_6/gui/wxpython/scripts/p.rast.py
grass/branches/develbranch_6/gui/wxpython/scripts/p.vect.py
Removed:
grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d
grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd
grass/branches/develbranch_6/gui/wxpython/scripts/p.db
grass/branches/develbranch_6/gui/wxpython/scripts/p.mon
grass/branches/develbranch_6/gui/wxpython/scripts/p.rast
grass/branches/develbranch_6/gui/wxpython/scripts/p.vect
Modified:
grass/branches/develbranch_6/gui/wxpython/Makefile
grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
grass/branches/develbranch_6/gui/wxpython/icons/icon.py
grass/branches/develbranch_6/gui/wxpython/wxgui.py
grass/branches/develbranch_6/include/Make/Platform.make.in
grass/branches/develbranch_6/include/Make/Python.make
Log:
wxGUI/nviz: fix volumes + convert support scripts to Python
Modified: grass/branches/develbranch_6/gui/wxpython/Makefile
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/Makefile 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/Makefile 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,8 +1,8 @@
MODULE_TOPDIR = ../..
-SUBDIRS = docs vdigit
+SUBDIRS = docs vdigit scripts
EXTRA_CLEAN_FILES = menustrings.py
-CLEAN_SUBDIRS = vdigit
+CLEAN_SUBDIRS = vdigit scripts
include $(MODULE_TOPDIR)/include/Make/Dir.make
include $(MODULE_TOPDIR)/include/Make/Doxygen.make
@@ -10,25 +10,19 @@
ETCDIR = $(ETC)/wxpython
-SRCFILES := $(wildcard scripts/* compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README scripts/wxgui
+SRCFILES := $(wildcard compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README
DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) $(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
default: install_scripts
$(MAKE) parsubdirs
install_scripts:
- -for dir in '' compat gui_modules icons icons/silk images scripts vdigit xml; do \
+ -for dir in '' compat gui_modules icons icons/silk images vdigit xml; do \
if [ ! -d $(ETCDIR)/$$dir ] ; then $(MKDIR) $(ETCDIR)/$$dir ; fi ; \
done
$(MAKE) $(DSTFILES)
$(MAKE) menustrings.py
-$(ETCDIR)/scripts/wxgui: wxgui
- $(INSTALL) $< $@
-
-$(ETCDIR)/scripts/%: scripts/%
- $(INSTALL) $< $@
-
$(ETCDIR)/%: %
$(INSTALL_DATA) $< $@
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -154,6 +154,7 @@
cmd = cmd + os.listdir(os.path.join(gisbase, 'scripts'))
if gui_scripts is True:
os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'gui', 'scripts')
+ os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'wxpython', 'scripts')
cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
if subprocess.mswindows:
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -459,6 +459,7 @@
#
try:
layertype = {'d.rast' : 'raster',
+ 'd.rast3d' : '3d-raster',
'd.rgb' : 'rgb',
'd.his' : 'his',
'd.shaded' : 'shaded',
@@ -473,11 +474,11 @@
'd.rhumbline' : 'rhumb',
'd.labels' : 'labels'}[cmdlist[0]]
except KeyError:
- wx.MessageBox(caption = _("Message"),
- message=_("Command '%s' not yet implemented in the GUI. "
- "Try adding it as a command layer instead.") % cmdlist[0])
+ gcmd.GMessage(parent = self.parent,
+ message = _("Command '%s' not yet implemented in the WxGUI. "
+ "Try adding it as a command layer instead.") % cmdlist[0])
return None
-
+
# add layer into layer tree
if cmdlist[0] == 'd.rast':
lname = utils.GetLayerNameFromCmd(cmdlist, fullyQualified = True,
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -279,7 +279,7 @@
self.popupMenu.Append(self.popupID3, text=_("Properties"))
self.Bind(wx.EVT_MENU, self.OnPopupProperties, id=self.popupID3)
- if ltype in ('raster', 'vector', 'raster3d') and self.mapdisplay.toolbars['nviz']:
+ if ltype in ('raster', 'vector', '3d-raster') and self.mapdisplay.toolbars['nviz']:
self.popupMenu.Append(self.popupID11, _("3D view properties"))
self.Bind (wx.EVT_MENU, self.OnNvizProperties, id=self.popupID11)
@@ -619,7 +619,7 @@
self.lmgr.nviz.SetPage('surface')
elif ltype == 'vector':
self.lmgr.nviz.SetPage('vector')
- elif ltype == 'raster3d':
+ elif ltype == '3d-raster':
self.lmgr.nviz.SetPage('volume')
def RenameLayer (self, event):
@@ -813,11 +813,7 @@
# run properties dialog if no properties given
if len(cmd) == 0:
self.PropertiesDialog(layer, show=True)
-
- if ltype == '3d-raster' and \
- not self.mapdisplay.toolbars['nviz']:
- self.EnableItem(layer, False)
-
+
else: # group
self.SetPyData(layer, ({'cmd': None,
'type' : ltype,
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -393,10 +393,6 @@
self.toolbars['nviz'] = toolbars.NvizToolbar(self, self.Map)
self.toolbars['map'].Enable2D(False)
- # update layer tree (-> enable 3d-rasters)
- if self.tree:
- self.tree.EnableItemType(type='3d-raster', enable=True)
-
# update status bar
self.statusbarWin['toggle'].Enable(False)
@@ -477,11 +473,6 @@
# remove nviz notebook page
self._layerManager.RemoveNviz()
- # update layer tree (-> disable 3d-rasters)
- if self.tree:
- self.tree.EnableItemType(type='3d-raster', enable=False)
-
-
self.MapWindow.UpdateMap()
self.toolbars['map'].combo.SetValue (_("2D view"))
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -762,18 +762,22 @@
if self.tree:
self.tree.rerender = False
- if render:
- # update display size
- self.Map.ChangeMapSize(self.GetClientSize())
- if self.parent.statusbarWin['resolution'].IsChecked():
- # use computation region resolution for rendering
- windres = True
+ try:
+ if render:
+ # update display size
+ self.Map.ChangeMapSize(self.GetClientSize())
+ if self.parent.statusbarWin['resolution'].IsChecked():
+ # use computation region resolution for rendering
+ windres = True
+ else:
+ windres = False
+ self.mapfile = self.Map.Render(force = True, mapWindow = self.parent,
+ windres = windres)
else:
- windres = False
- self.mapfile = self.Map.Render(force=True, mapWindow=self.parent,
- windres=windres)
- else:
- self.mapfile = self.Map.Render(force=False, mapWindow=self.parent)
+ self.mapfile = self.Map.Render(force = False, mapWindow = self.parent)
+ except gcmd.GException, e:
+ gcmd.GError(message = e)
+ self.mapfile = None
self.img = self.GetImage() # id=99
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_tools.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -887,9 +887,9 @@
# selection
box = wx.StaticBox (parent = panel, id = wx.ID_ANY,
- label = " %s " % (_("3D Raster map")))
+ label = " %s " % (_("3D raster map")))
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
- rmaps = gselect.Select(parent = panel, type = 'raster3d',
+ rmaps = gselect.Select(parent = panel, type = 'raster3D',
onPopup = self.GselectOnPopup)
rmaps.GetChildren()[0].Bind(wx.EVT_TEXT, self.OnSetRaster3D)
self.win['volume']['map'] = rmaps.GetId()
@@ -1327,7 +1327,7 @@
elif nvizType == 'vector':
return self.mapWindow.GetLayerByName(name, mapType = 'vector', dataType = 'nviz')
elif nvizType == 'volume':
- return self.mapWindow.GetLayerByName(name, mapType = 'raster3d', dataType = 'nviz')
+ return self.mapWindow.GetLayerByName(name, mapType = '3d-raster', dataType = 'nviz')
return None
@@ -1522,12 +1522,12 @@
"""!3D Raster map selected, update surface page"""
name = event.GetString()
try:
- data = self.mapWindow.GetLayerByName(name, mapType = 'raster3d', dataType = 'nviz')['surface']
+ data = self.mapWindow.GetLayerByName(name, mapType = '3d-raster', dataType = 'nviz')['volume']
except:
self.EnablePage('volume', False)
return
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
self.EnablePage('volume', True)
self.UpdateVolumePage(layer, data, updateName = False)
@@ -1666,7 +1666,7 @@
'value' : str(value),
'update' : None }
else: # volume / isosurface
- data = self.mapWindow.GetLayerByName(name, mapType = 'raster3d', dataType = 'nviz')
+ data = self.mapWindow.GetLayerByName(name, mapType = '3d-raster', dataType = 'nviz')
list = self.FindWindowById(self.win['volume']['isosurfs'])
id = list.GetSelection()
data[nvizType]['isosurface'][id][attrb] = { 'map' : useMap,
@@ -1761,12 +1761,13 @@
'value' : str(value),
'update' : None }
else:
- data = self.mapWindow.GetLayerByName(name, mapType = 'raster3d', dataType = 'nviz')
+ data = self.mapWindow.GetLayerByName(name, mapType = '3d-raster', dataType = 'nviz')
list = self.FindWindowById(self.win['volume']['isosurfs'])
id = list.GetSelection()
- data[nvizType]['isosurface'][id][attrb] = { 'map' : useMap,
- 'value' : str(value),
- 'update' : None }
+ if id > -1:
+ data[nvizType]['isosurface'][id][attrb] = { 'map' : useMap,
+ 'value' : str(value),
+ 'update' : None }
# update properties
event = wxUpdateProperties(data = data)
@@ -2273,7 +2274,7 @@
# update dialog
name = self.FindWindowById(self.win['volume']['map']).GetValue()
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
data = self.GetLayerData('volume')['volume']['isosurface'][selection]
self.UpdateVolumeIsosurfPage(layer, data)
@@ -2295,7 +2296,7 @@
list.SetSelection(item)
name = self.FindWindowById(self.win['volume']['map']).GetValue()
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
data = self.GetLayerData('volume')['volume']
id = data['object']['id']
@@ -2356,7 +2357,7 @@
list.SetSelection(list.GetCount()-1)
name = self.FindWindowById(self.win['volume']['map']).GetValue()
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
data = self.GetLayerData('volume')['volume']
id = data['object']['id']
@@ -2383,7 +2384,7 @@
return # this should not happen
name = self.FindWindowById(self.win['volume']['map']).GetValue()
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
data = self.GetLayerData('volume')['volume']
id = data['object']['id']
@@ -2415,7 +2416,7 @@
return # this should not happen
name = self.FindWindowById(self.win['volume']['map']).GetValue()
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
data = self.GetLayerData('volume')['volume']
id = data['object']['id']
@@ -2471,7 +2472,7 @@
layer = self.mapWindow.GetLayerByName(name, mapType = 'vector')
self.UpdateVectorPage(layer, data['vector'])
elif pageId == 'volume':
- layer = self.mapWindow.GetLayerByName(name, mapType = 'raster3d')
+ layer = self.mapWindow.GetLayerByName(name, mapType = '3d-raster')
self.UpdateVectorPage(layer, data['vector'])
elif pageId == 'light':
zval = self.mapWindow.light['position']['z']
@@ -2713,14 +2714,10 @@
"""!Update volume page"""
if updateName:
self.FindWindowById(self.win['volume']['map']).SetValue(layer.name)
- # self.FindWindowById(self.win['volume']['desc']).SetLabel(desc)
-
list = self.FindWindowById(self.win['volume']['isosurfs'])
- #
# draw
- #
- for control, data in data['draw'].iteritems():
+ for control, idata in data['draw'].iteritems():
if control == 'all': # skip 'all' property
continue
@@ -2732,7 +2729,7 @@
else:
value = 1
else:
- value = data['value']
+ value = idata['value']
if win.GetName() == "selection":
win.SetSelection(value)
@@ -2741,7 +2738,7 @@
self.SetIsosurfaceMode(data['draw']['shading']['value'])
self.SetIsosurfaceResolution(data['draw']['resolution']['value'])
-
+
self.UpdateVolumeIsosurfPage(layer, data['attribute'])
def UpdateVolumeIsosurfPage(self, layer, data):
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -131,7 +131,7 @@
'overlay')
if self.type not in layertypes:
- raise gcmd.GException(_("<%(name)s>: layer type <%(type)s> is not supported yet.") % \
+ raise gcmd.GException(_("<%(name)s>: layer type <%(type)s> is not supported") % \
{'type' : self.type, 'name' : self.name})
#
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1557,6 +1557,7 @@
self.workspaceOpen = wx.NewId()
self.workspaceSave = wx.NewId()
self.addrast = wx.NewId()
+ self.addrast3d = wx.NewId()
self.addshaded = wx.NewId()
self.addvect = wx.NewId()
self.addthematic = wx.NewId()
@@ -1586,6 +1587,9 @@
(self.addrast, 'addrast', Icons["addrast"].GetBitmap(),
wx.ITEM_NORMAL, Icons["addrast"].GetLabel(), Icons["addrast"].GetDesc(),
self.parent.OnAddRaster),
+ (self.addrast3d, 'addrast3d', Icons["addrast3d"].GetBitmap(),
+ wx.ITEM_NORMAL, Icons["addrast3d"].GetLabel(), Icons["addrast3d"].GetDesc(),
+ self.parent.OnAddRaster3D),
(self.addshaded, 'addshaded', Icons["addshaded"].GetBitmap(),
wx.ITEM_NORMAL, _("Add various raster-based map layers"), "",
self.parent.OnAddRasterMisc),
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -24,6 +24,7 @@
from ctypes import *
try:
from grass.lib.grass import *
+ from grass.lib.g3d import *
from grass.lib.ogsf import *
from grass.lib.nviz import *
errorMsg = ''
Modified: grass/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -192,9 +192,9 @@
"addvect" : MetaIcon (img=Icons["addvect"],
label=_("Add vector map layer (Ctrl+V)")),
"addcmd" : MetaIcon (img=Icons["addcmd"],
- label=_("Add command map layer")),
+ label=_("Add command layer")),
"addgrp" : MetaIcon (img=Icons["addgrp"],
- label=_("Add map layer group")),
+ label=_("Add group")),
"addovl" : MetaIcon (img=Icons["addovl"],
label=_("Add grid or vector labels overlay")),
"delcmd" : MetaIcon (img=Icons["delcmd"],
@@ -228,7 +228,8 @@
"addtext" : MetaIcon (img=Icons["addtext"],
label=_("Add text layer")),
"addrast3d" : MetaIcon (img=Icons["addrast3d"],
- label=_("Add 3D raster map")),
+ label=_("Add 3D raster map layer"),
+ desc = _("Note that 3D raster data are rendered only in 3D view mode")),
"settings" : MetaIcon (img=Icons["settings"],
label=_("Show GUI settings")),
# digit
Added: grass/branches/develbranch_6/gui/wxpython/scripts/Makefile
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/Makefile (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/Makefile 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,26 @@
+MODULE_TOPDIR = ../../..
+
+include $(MODULE_TOPDIR)/include/Make/Dir.make
+include $(MODULE_TOPDIR)/include/Make/Python.make
+
+SCRIPTDIR = $(ETC)/wxpython/scripts
+
+ifdef MINGW
+PYFILES := $(patsubst %.py, $(SCRIPTDIR)/%.py, $(filter %.py, $(PY_SOURCES)))
+else
+PYFILES := $(patsubst %.py, $(SCRIPTDIR)/%, $(filter %.py, $(PY_SOURCES)))
+endif
+
+default: install_scripts
+
+install_scripts:
+ $(MAKE) $(PYFILES)
+
+$(SCRIPTDIR)/%: %.py | $(SCRIPTDIR)
+ $(INSTALL) $< $@
+
+$(SCRIPTDIR)/%.py: %.py | $(SCRIPTDIR)
+ $(INSTALL) $< $@
+
+$(SCRIPTDIR):
+ -test -d $@ | $(MKDIR) $@
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/Makefile
___________________________________________________________________
Added: svn:mime-type
+ text/x-sh
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-#
-############################################################################
-#
-# 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
-#%end
-
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,grid3,3d-raster
-#% description: 3D raster map to be displayed
-#% required : yes
-#%end
-
-from grass.script import core as grass
-
-if __name__ == "__main__":
- options, flags = grass.parser()
- main()
Added: grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+#
+############################################################################
+#
+# MODULE: d.rast3d
+#
+# AUTHOR(S): Martin Landa <landa.martin gmail.com>
+#
+# PURPOSE: Wrapper for wxGUI to add 3D raster map into layer tree
+#
+# COPYRIGHT: (C) 2008, 2010 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 map layer.
+#% keywords: display, raster3d
+#%end
+
+#%option
+#% key: map
+#% type: string
+#% gisprompt: old,grid3,3d-raster
+#% description: 3D raster map to be displayed
+#% required : yes
+#%end
+
+from grass.script import core as grass
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/d.rast3d.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-#%module
-#% description: Wrapper for display commands and pX monitors
-#% keywords: display
-#%end
-#%option
-#% key: cmd
-#% type: string
-#% required: yes
-#% multiple: no
-#% label: Command to be performed
-#% description: Example: "d.rast map=elevation.dem at PERMANENT catlist=1300-1400 -i"
-#%end
-#%option
-#% key: opacity
-#% type: string
-#% required: no
-#% multiple: no
-#% key_desc: val
-#% description: Opacity level in percentage
-#% answer: 100
-#%end
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
- exec g.parser "$0" "$@"
-fi
-
-cmdfile="`g.gisenv get=GRASS_PYCMDFILE`"
-
-if [ -e ${cmdfile} ] && [ -n "${cmdfile}" ]; then
- :
-else
- g.message -e "GRASS_PYCMDFILE - File not found. Run p.mon"
- exit 1
-fi
-
-cmd="${GIS_OPT_CMD}"
-
-g.message -d message="$0: ${cmd}"
-
-echo "${cmd}" >> "${cmdfile}"
-
-exit 0
Added: grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: p.cmd
+# AUTHOR(S): Martin Landa, Hamish Bowman
+# Converted to Python by Huidae Cho
+# PURPOSE: Wrapper for display commands and pX monitors
+# COPYRIGHT: (C) 2009 by The GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%Module
+#% description: Wrapper for display commands and pX monitors
+#% keywords: display
+#%End
+
+#%Option
+#% key: cmd
+#% type: string
+#% required: yes
+#% multiple: no
+#% label: Command to be performed
+#% description: Example: "d.rast map=elevation.dem at PERMANENT catlist=1300-1400 -i"
+#%End
+
+#%Option
+#% key: opacity
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: val
+#% description: Opacity level in percentage
+#% answer: 100
+#%End
+
+import os
+import grass.script as grass
+
+def main():
+ cmd_file = grass.gisenv()["GRASS_PYCMDFILE"]
+
+ if cmd_file == "" or os.path.exists(cmd_file) == False:
+ grass.message(_("GRASS_PYCMDFILE - File not found. Run p.mon."), "e")
+ return
+
+ cmd = options["cmd"]
+ opacity = options["opacity"]
+
+ fp = open(cmd_file, "a")
+ fp.write("%s opacity=%s\n" % (cmd, opacity))
+ fp.close()
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/p.cmd.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/p.db
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.db 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.db 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-#%Module
-#% description: Start stand-alone attribute table manager
-#% keywords: database
-#%End
-#%Option
-#% key: table
-#% type: string
-#% required: yes
-#% multiple: no
-#% description: Table name
-#%End
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
- exec g.parser "$0" "$@"
-fi
-
-# CODE GOES HERE
-
-if [ -z "$PYTHONPATH" ] ; then
- PYTHONPATH="$GISBASE/etc/wxpython"
-else
- PYTHONPATH="$GISBASE/etc/wxpython:$PYTHONPATH"
-fi
-export PYTHONPATH
-
-"$GRASS_PYTHON" "$PYTHONPATH/gui_modules/dbm.py" "$GIS_OPT_TABLE"
-
-exit 0
Added: grass/branches/develbranch_6/gui/wxpython/scripts/p.db.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.db.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.db.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: p.db
+# AUTHOR(S): Jachym Cepicky, Markus Neteler, Hamish Bowman
+# Converted to Python by Huidae Cho
+# PURPOSE: Start stand-alone attribute table manager
+# COPYRIGHT: (C) 2009 by The GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%Module
+#% description: Start stand-alone attribute table manager
+#% keywords: database
+#%End
+#%Option
+#% key: table
+#% type: string
+#% required: yes
+#% multiple: no
+#% description: Table name
+#%End
+
+import os
+import grass.script as grass
+
+def main():
+ table = options["table"]
+
+ os.spawnlp(os.P_NOWAIT, os.environ["GRASS_PYTHON"], os.environ["GRASS_PYTHON"], "%s/etc/wxpython/gui_modules/dbm.py" % os.environ["GISBASE"], table)
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/p.db.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/p.mon
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.mon 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.mon 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-#%Module
-#% description: To establish and control use of a graphics display monitor.
-#% keywords: display
-#%End
-#%Flag
-#% key: l
-#% description: List all monitors
-#%End
-#%Flag
-#% key: L
-#% description: List all monitors (with current status)
-#%End
-#%Flag
-#% key: p
-#% description: Print name of currently selected monitor
-#%End
-#%Flag
-#% key: r
-#% description: Release currently selected monitor
-#%End
-#%Flag
-#% key: s
-#% description: Do not automatically select when starting
-#%End
-#%Option
-#% key: start
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of graphics monitor to start (p0-p9)
-#%End
-#%Option
-#% key: stop
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of graphics monitor to stop
-#%End
-#%Option
-#% key: select
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of graphics monitor to select
-#%End
-#%Option
-#% key: unlock
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of graphics monitor to unlock
-#%End
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
- exec g.parser "$0" "$@"
-fi
-
-# CODE GOES HERE
-
-if [ -z "$PYTHONPATH" ] ; then
- PYTHONPATH="$GISBASE/etc/wxpython"
-else
- PYTHONPATH="$GISBASE/etc/wxpython:$PYTHONPATH"
-fi
-export PYTHONPATH
-
-start="$GIS_OPT_START"
-select="$GIS_OPT_SELECT"
-stop="$GIS_OPT_STOP"
-unlock="$GIS_OPT_UNLOCK"
-
-# create the command file
-command_file="`g.tempfile pid=$$`"
-g.gisenv set="GRASS_PYCMDFILE=${command_file}"
-
-if [ -n "$start" ] ; then
- "$GRASS_PYTHON" "$PYTHONPATH/gui_modules/mapdisp.py" "$start" "${command_file}" &
-fi
-
-if [[ -n "$stop" || -n "$select" || -n "$unlock" ]] ; then
- g.message -w "Not implemented yet"
-fi
-
-exit 0
Added: grass/branches/develbranch_6/gui/wxpython/scripts/p.mon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.mon.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.mon.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: p.mon
+# AUTHOR(S): Jachym Cepicky, Michael Barton, Martin Landa, Markus Neteler,
+# Hamish Bowman
+# Converted to Python by Huidae Cho
+# PURPOSE: To establish and control use of a graphics display monitor.
+# COPYRIGHT: (C) 2009 by The GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%Module
+#% description: To establish and control use of a graphics display monitor.
+#% keywords: display
+#%End
+
+##%Flag
+##% key: l
+##% description: List all monitors
+##%End
+
+##%Flag
+##% key: L
+##% description: List all monitors (with current status)
+##%End
+
+##%Flag
+##% key: p
+##% description: Print name of currently selected monitor
+##%End
+
+##%Flag
+##% key: r
+##% description: Release currently selected monitor
+##%End
+
+##%Flag
+##% key: s
+##% description: Do not automatically select when starting
+##%End
+
+#%Option
+#% key: start
+#% type: string
+#% required: no
+#% multiple: no
+#% description: Name of graphics monitor to start (p0-p9)
+#%End
+
+##%Option
+##% key: stop
+##% type: string
+##% required: no
+##% multiple: no
+##% description: Name of graphics monitor to stop
+##%End
+
+##%Option
+##% key: select
+##% type: string
+##% required: no
+##% multiple: no
+##% description: Name of graphics monitor to select
+##%End
+
+##%Option
+##% key: unlock
+##% type: string
+##% required: no
+##% multiple: no
+##% description: Name of graphics monitor to unlock
+##%End
+
+import os
+import grass.script as grass
+
+def main():
+ start = options["start"]
+# select = options["select"]
+# stop = options["stop"]
+# unlock = options["unlock"]
+
+ # create the command file
+ command_file = grass.tempfile()
+ os.system("g.gisenv set=GRASS_PYCMDFILE=%s" % command_file)
+
+ if start != "":
+ os.spawnlp(os.P_NOWAIT, os.environ["GRASS_PYTHON"], os.environ["GRASS_PYTHON"], "%s/etc/wxpython/gui_modules/mapdisp.py" % os.environ["GISBASE"], start, command_file)
+ return
+
+# if stop != "" or select != "" or unlock != "":
+# grass.message(_("Not implemented yet"), "w")
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/p.mon.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/p.rast
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.rast 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.rast 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-#%Module
-#% description: Displays and overlays raster map layers in the active display frame on the graphics monitor
-#% keywords: display
-#%End
-#%flag
-#% key: i
-#% description: Invert catlist
-#%End
-#%Option
-#% key: map
-#% type: string
-#% required: yes
-#% multiple: no
-#% description: Raster map to be displayed
-#% gisprompt: old,cell,raster
-#%End
-#%Option
-#% key: catlist
-#% type: string
-#% required: no
-#% multiple: yes
-#% key_desc: cat[-cat]
-#% description: List of categories to be displayed (INT maps)
-#%End
-#%Option
-#% key: vallist
-#% type: string
-#% required: no
-#% multiple: yes
-#% key_desc: val[-val]
-#% description: List of values to be displayed (FP maps)
-#%End
-#%Option
-#% key: opacity
-#% type: string
-#% required: no
-#% multiple: no
-#% key_desc: val[-val]
-#% description: Set opacity between 0-100%
-#%End
-
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
- exec g.parser "$0" "$@"
-fi
-
-# CODE GOES HERE
-
-cmdfile="`g.gisenv get=GRASS_PYCMDFILE`"
-
-if [ -e ${cmdfile} ] && [ -n "${cmdfile}" ]; then
- echo -n
-else
- g.message -e "GRASS_PYCMDFILE - File not found. Run p.mon"
- exit 1
-fi
-
-
-eval "`echo ${GIS_OPT_MAP} | sed -e 's/^/NAME=/' -e 's/@/; MAPSET=/'`;"
-
-#echo $NAME
-
-if [ -z "${MAPSET}" ]; then
- mapset=""
-else
- mapset="mapset=${MAPSET}"
-fi
-
-#echo $MAPSET
-
-eval "`g.findfile element=cell file=${NAME} ${mapset}`"
-
-#echo $NAME
-#echo $MAPSET
-
-if [ -z "${GIS_OPT_CATLIST}" ]; then
- CATLIST="None"
-else
- CATLIST="${GIS_OPT_CATLIST}"
-fi
-
-if [ -z "${GIS_OPT_VALLIST}" ]; then
- VALLIST="None"
-else
- VALLIST="${GIS_OPT_VALLIST}"
-fi
-
-if [ -z "${GIS_OPT_OPACITY}" ]; then
- OPACITY="100"
-else
- OPACITY="${GIS_OPT_OPACITY}"
-fi
-
-if [ "${GIS_FLAG_I}" -eq "1" ]; then
- INVERT="True"
-else
- INVERT="False"
-fi
-
-
-#cmd="self.map.AddRasterLayer(self, $NAME $MAPSET $CATLIST $VALLIST $INVERCATS $INVERT $OPACITY)"
-
-cmd="addraster ${name} ${mapset} ${CATLIST} ${VALLIST} ${INVERT} ${OPACITY}"
-
-#echo "${cmd}"
-echo "${cmd}" >> "${cmdfile}"
Added: grass/branches/develbranch_6/gui/wxpython/scripts/p.rast.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.rast.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.rast.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: p.rast
+# AUTHOR(S): Jachym Cepicky, Martin Landa, Hamish Bowman
+# Converted to Python by Huidae Cho
+# PURPOSE: Displays raster map layer in the active map display window.
+# COPYRIGHT: (C) 2009 by The GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%module
+#% description: Displays raster map layer in the active map display window.
+#% keywords: display, raster
+#%end
+#%flag
+#% key: n
+#% description: Make null cells opaque
+#%end
+#%flag
+#% key: i
+#% description: Invert catlist
+#% guisection: Selection
+#%end
+#%option
+#% key: map
+#% type: string
+#% required: yes
+#% multiple: no
+#% key_desc: name
+#% description: Raster map to be displayed
+#% gisprompt: old,cell,raster
+#%end
+#%option
+#% key: catlist
+#% type: string
+#% required: no
+#% multiple: yes
+#% key_desc: cat[-cat]
+#% description: List of categories to be displayed (INT maps)
+#% guisection: Selection
+#%end
+#%option
+#% key: vallist
+#% type: string
+#% required: no
+#% multiple: yes
+#% key_desc: val[-val]
+#% description: List of values to be displayed (FP maps)
+#% guisection: Selection
+#%end
+#%option
+#% key: bg
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: color
+#% description: Background color (for null)
+#% gisprompt: old_color,color,color
+#%end
+#%option
+#% key: opacity
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: val
+#% answer: 100
+#% description: Set opacity between 0-100%
+#%end
+
+import sys
+import os
+import grass.script as grass
+
+def construct_command(cmd):
+ line = cmd
+ for key, val in options.iteritems():
+ if val != "":
+ line += " %s=%s" % (key, val)
+ for key, val in flags.iteritems():
+ if val == True:
+ line += " -%s" % key
+ return line
+
+def main():
+ cmd_file = grass.gisenv()["GRASS_PYCMDFILE"]
+
+ if cmd_file == "" or os.path.exists(cmd_file) == False:
+ grass.message(_("GRASS_PYCMDFILE - File not found. Run p.mon."), "e")
+ return
+
+ cmd = construct_command("d"+os.path.basename(sys.argv[0])[1:-3])
+
+ fp = open(cmd_file, "a")
+ fp.write("%s\n" % cmd)
+ fp.close()
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/p.rast.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Deleted: grass/branches/develbranch_6/gui/wxpython/scripts/p.vect
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.vect 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.vect 2010-08-09 18:50:29 UTC (rev 43027)
@@ -1,335 +0,0 @@
-#!/bin/sh
-
-#%Module
-#% description: Displays GRASS vector data in the active frame on the graphics monitor.
-#% keywords: display
-#%End
-#%Flag
-#% key: v
-#% description: Run verbosely
-#%End
-#%Flag
-#% key: a
-#% description: Get colors from map table column (of form RRR:GGG:BBB)
-#% guisection: Colors
-#%End
-#%Flag
-#% key: c
-#% description: Random colors according to category number (or layer number if 'layer=-1' is given)
-#% guisection: Colors
-#%End
-#%Flag
-#% key: i
-#% description: Use values from 'cats' option as line ID
-#% guisection: Query
-#%End
-#%Flag
-#% key: x
-#% description: Don't add to list of vectors and commands in monitor (it won't be drawn if the monitor is refreshed)
-#%End
-#%Option
-#% key: map
-#% type: string
-#% required: yes
-#% multiple: no
-#% key_desc: name
-#% description: Name of input vector map
-#% gisprompt: old,vector,vector
-#%End
-#%Option
-#% key: type
-#% type: string
-#% required: no
-#% multiple: yes
-#% options: point,line,boundary,centroid,area,face
-#% label: Type
-#% description: Feature type(s)
-#% answer: point,line,boundary,centroid,area,face
-#%End
-#%Option
-#% key: display
-#% type: string
-#% required: no
-#% multiple: yes
-#% options: shape,cat,topo,dir,attr,zcoor
-#% description: Display
-#% answer: shape
-#%End
-#%Option
-#% key: attrcol
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of column to be displayed
-#% guisection: Labels
-#%End
-#%Option
-#% key: icon
-#% type: string
-#% required: no
-#% multiple: no
-#% options: demo/muchomurka,demo/smrk,basic/arrow1,basic/arrow2,basic/box,basic/circle,basic/cross1,basic/cross2,basic/diamond,basic/marker,basic/octagon,basic/point,basic/pushpin,basic/star,basic/triangle,basic/x,extra/4pt_star,extra/adcp,extra/airport,extra/alpha_flag,extra/bridge,extra/compass,extra/dive_flag,extra/fancy_compass,extra/half-circle,extra/offbox_ne,extra/offbox_nw,extra/offbox_se,extra/offbox_sw,extra/pentagon,extra/target
-#% description: Point and centroid symbol
-#% answer: basic/x
-#% guisection: Symbols
-#%End
-#%Option
-#% key: size
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Symbol size
-#% answer: 8
-#% guisection: Symbols
-#%End
-#%Option
-#% key: layer
-#% type: integer
-#% required: no
-#% multiple: no
-#% label: Layer number
-#% description: Layer number. If -1, all layers are displayed.
-#% answer: 1
-#%End
-#%Option
-#% key: cats
-#% type: string
-#% required: no
-#% multiple: no
-#% key_desc: range
-#% label: Category values
-#% description: Example: 1,3,7-9,13
-#% guisection: Query
-#%End
-#%Option
-#% key: where
-#% type: string
-#% required: no
-#% multiple: no
-#% key_desc: sql_query
-#% label: WHERE conditions of SQL statement without 'where' keyword.
-#% description: Example: income < 1000 and inhab >= 10000
-#% guisection: Query
-#%End
-#%Option
-#% key: width
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Line width
-#% answer: 0
-#% guisection: Lines
-#%End
-#%Option
-#% key: wcolumn
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of column for line widths (these values will be scaled by wscale)
-#% guisection: Lines
-#%End
-#%Option
-#% key: wscale
-#% type: double
-#% required: no
-#% multiple: no
-#% description: Scale factor for wcolumn
-#% answer: 1
-#% guisection: Lines
-#%End
-#%Option
-#% key: color
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Line color
-#% answer: black
-#% gisprompt: color,grass,color
-#% guisection: Colors
-#%End
-#%Option
-#% key: fcolor
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Area fill color
-#% answer: 200:200:200
-#% gisprompt: color,grass,color
-#% guisection: Colors
-#%End
-#%Option
-#% key: rgb_column
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Name of color definition column (for use with -a flag)
-#% answer: GRASSRGB
-#% guisection: Colors
-#%End
-#%Option
-#% key: llayer
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Layer for labels (default: the given layer number)
-#% guisection: Labels
-#%End
-#%Option
-#% key: lcolor
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Label color
-#% answer: red
-#% gisprompt: color,grass,color
-#% guisection: Labels
-#%End
-#%Option
-#% key: bgcolor
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Label background color
-#% answer: none
-#% gisprompt: color,grass,color
-#% guisection: Labels
-#%End
-#%Option
-#% key: bcolor
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Label border color
-#% answer: none
-#% gisprompt: color,grass,color
-#% guisection: Labels
-#%End
-#%Option
-#% key: lsize
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Label size (pixels)
-#% answer: 8
-#% guisection: Labels
-#%End
-#%Option
-#% key: font
-#% type: string
-#% required: no
-#% multiple: no
-#% description: Font name
-#% guisection: Labels
-#%End
-#%Option
-#% key: xref
-#% type: string
-#% required: no
-#% multiple: no
-#% options: left,center,right
-#% description: Label horizontal justification
-#% answer: left
-#% guisection: Labels
-#%End
-#%Option
-#% key: yref
-#% type: string
-#% required: no
-#% multiple: no
-#% options: top,center,bottom
-#% description: Label vertical justification
-#% answer: center
-#% guisection: Labels
-#%End
-#%Option
-#% key: minreg
-#% type: double
-#% required: no
-#% multiple: no
-#% description: Minimum region size (average from height and width) when map is displayed
-#%End
-#%Option
-#% key: maxreg
-#% type: double
-#% required: no
-#% multiple: no
-#% description: Maximum region size (average from height and width) when map is displayed
-#%End
-#%Option
-#% key: render
-#% type: string
-#% required: no
-#% multiple: no
-#% options: g,r,d,c
-#% description: Rendering method for filled polygons
-#% answer: g
-#%End
-
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
- exec g.parser "$0" "$@"
-fi
-
-# CODE GOES HERE
-
-cmdfile="`g.gisenv get=GRASS_PYCMDFILE`"
-
-if [ -e ${cmdfile} ] && [ -n "${cmdfile}" ]; then
- echo -n
-else
- echo "WARNING: GRASS_PYCMDFILE - File not found. Run p.mon" >&2
- exit 1
-fi
-
-
-eval "`echo ${GIS_OPT_MAP} | sed -e 's/^/NAME=/' -e 's/@/; MAPSET=/'`;"
-
-#echo $NAME
-
-if [ -z "${MAPSET}" ]; then
- mapset=""
-else
- mapset="mapset=${MAPSET}"
-fi
-
-#echo $MAPSET
-
-eval "`g.findfile element=vector file=${NAME} ${mapset}`"
-
-#echo $NAME
-#echo $MAPSET
-
-if [ -z "${GIS_OPT_CATLIST}" ]; then
- CATLIST="None"
-else
- CATLIST="${GIS_OPT_CATLIST}"
-fi
-
-if [ -z "${GIS_OPT_VALLIST}" ]; then
- VALLIST="None"
-else
- VALLIST="${GIS_OPT_VALLIST}"
-fi
-
-if [ -z "${GIS_OPT_OPACITY}" ]; then
- OPACITY="100"
-else
- OPACITY="${GIS_OPT_OPACITY}"
-fi
-
-if [ "${GIS_FLAG_c}" -eq "1" ]; then
- CATSCOLORS="True"
-else
- CATSCOLORS="False"
-fi
-
-
-#cmd="self.map.AddRasterLayer(self, $NAME $MAPSET $CATLIST $VALLIST $INVERCATS $INVERT $OPACITY)"
-
-cmd="addvector ${name} ${mapset}"
-echo "${cmd}" >> "${cmdfile}"
Added: grass/branches/develbranch_6/gui/wxpython/scripts/p.vect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/scripts/p.vect.py (rev 0)
+++ grass/branches/develbranch_6/gui/wxpython/scripts/p.vect.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -0,0 +1,367 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: p.vect
+# AUTHOR(S): Jachym Cepicky, Hamish Bowman
+# Converted to Python by Huidae Cho
+# PURPOSE: Displays vector map layer in the active map display window.
+# COPYRIGHT: (C) 2009 by The GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%module
+#% description: Displays vector map layer in the active map display window.
+#% keywords: display, vector
+#%end
+#%flag
+#% key: a
+#% description: Get colors from map table column (of form RRR:GGG:BBB)
+#% guisection: Colors
+#%end
+#%flag
+#% key: c
+#% description: Random colors according to category number (or layer number if 'layer=-1' is given)
+#% guisection: Colors
+#%end
+#%flag
+#% key: i
+#% description: Use values from 'cats' option as feature id
+#% guisection: Selection
+#%end
+#%flag
+#% key: z
+#% description: Colorize polygons according to z height
+#%end
+#%option
+#% key: map
+#% type: string
+#% required: yes
+#% multiple: no
+#% key_desc: name
+#% description: Name of input vector map
+#% gisprompt: old,vector,vector
+#%end
+#%option
+#% key: display
+#% type: string
+#% required: no
+#% multiple: yes
+#% options: shape,cat,topo,dir,attr,zcoor
+#% description: Display
+#% answer: shape
+#%end
+#%option
+#% key: type
+#% type: string
+#% required: no
+#% multiple: yes
+#% options: point,line,boundary,centroid,area,face
+#% description: Feature type
+#% answer: point,line,boundary,centroid,area,face
+#% guisection: Selection
+#%end
+#%option
+#% key: layer
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Layer number (if -1, all layers are displayed)
+#% description: A single vector map can be connected to multiple database tables. This number determines which table to use.
+#% answer: 1
+#% gisprompt: old_layer,layer,layer_all
+#% guisection: Selection
+#%end
+#%option
+#% key: cats
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: range
+#% label: Category values
+#% description: Example: 1,3,7-9,13
+#% guisection: Selection
+#%end
+#%option
+#% key: where
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: sql_query
+#% label: WHERE conditions of SQL statement without 'where' keyword
+#% description: Example: income < 1000 and inhab >= 10000
+#% guisection: Selection
+#%end
+#%option
+#% key: color
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Line color
+#% description: Either a standard GRASS color, R:G:B triplet, or "none"
+#% answer: black
+#% gisprompt: old_color,color,color_none
+#% guisection: Colors
+#%end
+#%option
+#% key: fcolor
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Area fill color
+#% description: Either a standard GRASS color, R:G:B triplet, or "none"
+#% answer: 200:200:200
+#% gisprompt: old_color,color,color_none
+#% guisection: Colors
+#%end
+#%option
+#% key: rgb_column
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: name
+#% description: Name of color definition column (for use with -a flag)
+#% answer: GRASSRGB
+#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
+#% guisection: Colors
+#%end
+#%option
+#% key: zcolor
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: style
+#% description: Type of color table (for use with -z flag)
+#% answer: terrain
+#% guisection: Colors
+#%end
+#%option
+#% key: width
+#% type: integer
+#% required: no
+#% multiple: no
+#% description: Line width
+#% answer: 0
+#% guisection: Lines
+#%end
+#%option
+#% key: wcolumn
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: name
+#% description: Name of column for line widths (these values will be scaled by wscale)
+#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
+#% guisection: Lines
+#%end
+#%option
+#% key: wscale
+#% type: double
+#% required: no
+#% multiple: no
+#% description: Scale factor for wcolumn
+#% answer: 1
+#% guisection: Lines
+#%end
+#%option
+#% key: icon
+#% type: string
+#% required: no
+#% multiple: no
+#% options: basic/marker,basic/circle,basic/arrow1,basic/star,basic/point,basic/triangle,basic/box,basic/arrow2,basic/octagon,basic/cross2,basic/pushpin,basic/diamond,basic/cross1,basic/x,demo/smrk,demo/muchomurka,extra/dive_flag,extra/half-box,extra/bridge,extra/fiducial,extra/ping,extra/offbox_ne,extra/adcp,extra/alpha_flag,extra/4pt_star,extra/half-circle,extra/offbox_nw,extra/fancy_compass,extra/airport,extra/compass,extra/offbox_se,extra/fish,extra/target,extra/offbox_sw,extra/n_arrow1,extra/pentagon,extra/n_arrow2,geology/strike_circle,geology/strike_box,geology/strike_line,geology/strike_triangle
+#% description: Point and centroid symbol
+#% answer: basic/x
+#% guisection: Symbols
+#%end
+#%option
+#% key: size
+#% type: integer
+#% required: no
+#% multiple: no
+#% description: Symbol size
+#% answer: 5
+#% guisection: Symbols
+#%end
+#%option
+#% key: size_column
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: name
+#% description: Name of numeric column containing symbol size
+#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
+#% guisection: Symbols
+#%end
+#%option
+#% key: rot_column
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: name
+#% label: Name of numeric column containing symbol rotation angle
+#% description: Measured in degrees CCW from east
+#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
+#% guisection: Symbols
+#%end
+#%option
+#% key: llayer
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Layer number or name
+#% description: Layer number for labels (default: the given layer number)
+#% answer: 1
+#% gisprompt: old_layer,layer,layer
+#% guisection: Labels
+#%end
+#%option
+#% key: attrcol
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: name
+#% description: Name of column to be displayed
+#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
+#% guisection: Labels
+#%end
+#%option
+#% key: lcolor
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Label color
+#% description: Either a standard color name or R:G:B triplet
+#% answer: red
+#% gisprompt: old_color,color,color
+#% guisection: Labels
+#%end
+#%option
+#% key: bgcolor
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Label background color
+#% description: Either a standard GRASS color, R:G:B triplet, or "none"
+#% answer: none
+#% gisprompt: old_color,color,color_none
+#% guisection: Labels
+#%end
+#%option
+#% key: bcolor
+#% type: string
+#% required: no
+#% multiple: no
+#% label: Label border color
+#% description: Either a standard GRASS color, R:G:B triplet, or "none"
+#% answer: none
+#% gisprompt: old_color,color,color_none
+#% guisection: Labels
+#%end
+#%option
+#% key: lsize
+#% type: integer
+#% required: no
+#% multiple: no
+#% description: Label size (pixels)
+#% answer: 8
+#% guisection: Labels
+#%end
+#%option
+#% key: font
+#% type: string
+#% required: no
+#% multiple: no
+#% description: Font name
+#% guisection: Labels
+#%end
+#%option
+#% key: encoding
+#% type: string
+#% required: no
+#% multiple: no
+#% description: Text encoding
+#% guisection: Labels
+#%end
+#%option
+#% key: xref
+#% type: string
+#% required: no
+#% multiple: no
+#% options: left,center,right
+#% description: Label horizontal justification
+#% answer: left
+#% guisection: Labels
+#%end
+#%option
+#% key: yref
+#% type: string
+#% required: no
+#% multiple: no
+#% options: top,center,bottom
+#% description: Label vertical justification
+#% answer: center
+#% guisection: Labels
+#%end
+#%option
+#% key: minreg
+#% type: double
+#% required: no
+#% multiple: no
+#% description: Minimum region size (average from height and width) when map is displayed
+#%end
+#%option
+#% key: maxreg
+#% type: double
+#% required: no
+#% multiple: no
+#% description: Maximum region size (average from height and width) when map is displayed
+#%end
+#%option
+#% key: opacity
+#% type: string
+#% required: no
+#% multiple: no
+#% key_desc: val
+#% answer: 100
+#% description: Set opacity between 0-100%
+#%end
+
+import sys
+import os
+import grass.script as grass
+
+def construct_command(cmd):
+ line = cmd
+ for key, val in options.iteritems():
+ if val != "":
+ line += " %s=%s" % (key, val)
+ for key, val in flags.iteritems():
+ if val == True:
+ line += " -%s" % key
+ return line
+
+def main():
+ cmd_file = grass.gisenv()["GRASS_PYCMDFILE"]
+
+ if cmd_file == "" or os.path.exists(cmd_file) == False:
+ grass.message(_("GRASS_PYCMDFILE - File not found. Run p.mon."), "e")
+ return
+
+ cmd = construct_command("d"+os.path.basename(sys.argv[0])[1:-3])
+
+ fp = open(cmd_file, "a")
+ fp.write("%s\n" % cmd)
+ fp.close()
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/branches/develbranch_6/gui/wxpython/scripts/p.vect.py
___________________________________________________________________
Added: svn:mime-type
+ text/x-python
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py 2010-08-09 18:50:29 UTC (rev 43027)
@@ -96,14 +96,15 @@
GIS. Includes command console page for typing GRASS (and other)
commands, tree widget page for managing map layers.
"""
- def __init__(self, parent, id=wx.ID_ANY, title=_("GRASS GIS Layer Manager"),
- workspace=None):
+ def __init__(self, parent, id = wx.ID_ANY, title = _("GRASS GIS Layer Manager"),
+ workspace = None,
+ size = (575, 450), style = wx.DEFAULT_FRAME_STYLE, **kwargs):
self.parent = parent
self.baseTitle = title
self.iconsize = (16, 16)
- wx.Frame.__init__(self, parent=parent, id=id, size=(550, 450),
- style=wx.DEFAULT_FRAME_STYLE)
+ wx.Frame.__init__(self, parent = parent, id = id, size = size,
+ style = style, **kwargs)
self.SetTitle(self.baseTitle)
self.SetName("LayerManager")
@@ -1182,7 +1183,6 @@
return self.curr_page.maptree.mapdisplay
- # toolBar button handlers
def OnAddRaster(self, event):
"""!Add raster map layer"""
# start new map display if no display is available
@@ -1190,48 +1190,49 @@
self.NewDisplay(show=False)
self.AddRaster(event)
+
+ def OnAddRaster3D(self, event):
+ """!Add 3D raster map layer"""
+ # start new map display if no display is available
+ if not self.curr_page:
+ self.NewDisplay(show=False)
+ self.AddRaster3D(event)
+
def OnAddRasterMisc(self, event):
"""!Add raster menu"""
# start new map display if no display is available
if not self.curr_page:
self.NewDisplay(show=False)
-
+
point = wx.GetMousePosition()
rastmenu = wx.Menu()
-
- # add items to the menu
- if self.curr_page.maptree.mapdisplay.toolbars['nviz']:
- addrast3d = wx.MenuItem(rastmenu, -1, Icons ["addrast3d"].GetLabel())
- addrast3d.SetBitmap(Icons["addrast3d"].GetBitmap (self.iconsize))
- rastmenu.AppendItem(addrast3d)
- self.Bind(wx.EVT_MENU, self.AddRaster3d, addrast3d)
-
+
addshaded = wx.MenuItem(rastmenu, -1, Icons ["addshaded"].GetLabel())
addshaded.SetBitmap(Icons["addshaded"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addshaded)
self.Bind(wx.EVT_MENU, self.AddShaded, addshaded)
-
+
addrgb = wx.MenuItem(rastmenu, -1, Icons["addrgb"].GetLabel())
addrgb.SetBitmap(Icons["addrgb"].GetBitmap(self.iconsize))
rastmenu.AppendItem(addrgb)
self.Bind(wx.EVT_MENU, self.AddRGB, addrgb)
-
+
addhis = wx.MenuItem(rastmenu, -1, Icons ["addhis"].GetLabel())
addhis.SetBitmap(Icons["addhis"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addhis)
self.Bind(wx.EVT_MENU, self.AddHIS, addhis)
-
+
addrastarrow = wx.MenuItem(rastmenu, -1, Icons ["addrarrow"].GetLabel())
addrastarrow.SetBitmap(Icons["addrarrow"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addrastarrow)
self.Bind(wx.EVT_MENU, self.AddRastarrow, addrastarrow)
-
+
addrastnums = wx.MenuItem(rastmenu, -1, Icons ["addrnum"].GetLabel())
addrastnums.SetBitmap(Icons["addrnum"].GetBitmap (self.iconsize))
rastmenu.AppendItem(addrastnums)
self.Bind(wx.EVT_MENU, self.AddRastnum, addrastnums)
-
+
# Popup the menu. If an item is selected then its handler
# will be called before PopupMenu returns.
self.PopupMenu(rastmenu)
@@ -1316,7 +1317,7 @@
self.notebook.SetSelection(0)
self.curr_page.maptree.AddLayer('raster')
- def AddRaster3d(self, event):
+ def AddRaster3D(self, event):
self.notebook.SetSelection(0)
self.curr_page.maptree.AddLayer('3d-raster')
Modified: grass/branches/develbranch_6/include/Make/Platform.make.in
===================================================================
--- grass/branches/develbranch_6/include/Make/Platform.make.in 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/include/Make/Platform.make.in 2010-08-09 18:50:29 UTC (rev 43027)
@@ -249,8 +249,8 @@
MINGW = @MINGW32@
MACOSX_APP = @MACOSX_APP@
-MACOSX_ARCHS = @MACOSX_ARCHS@
-MACOSX_SDK = @MACOSX_SDK@
+MACOSX_ARCHS = @MACOSX_ARCHS@
+MACOSX_SDK = @MACOSX_SDK@
# Cross compilation
CROSS_COMPILING = @CROSS_COMPILING@
Modified: grass/branches/develbranch_6/include/Make/Python.make
===================================================================
--- grass/branches/develbranch_6/include/Make/Python.make 2010-08-09 18:16:56 UTC (rev 43026)
+++ grass/branches/develbranch_6/include/Make/Python.make 2010-08-09 18:50:29 UTC (rev 43027)
@@ -8,6 +8,8 @@
endif
PYMOD_CFLAGS = $(SHLIB_CFLAGS) $(PYTHONINC) $(PYTHON_CFLAGS)
+PY_SOURCES := $(wildcard *.py)
+
%.pyc: %.py
$(PYTHON) -m py_compile $<
More information about the grass-commit
mailing list