[GRASS-SVN] r29923 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 1 02:17:40 EST 2008
Author: cmbarton
Date: 2008-02-01 02:17:38 -0500 (Fri, 01 Feb 2008)
New Revision: 29923
Modified:
grass/trunk/gui/wxpython/gui_modules/georect.py
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
Now we can set GCPs and extract coordinates from the xy map window and the previously rectified window from the working mapset.
Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py 2008-02-01 07:16:55 UTC (rev 29922)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py 2008-02-01 07:17:38 UTC (rev 29923)
@@ -135,7 +135,7 @@
finally:
f.close()
self.new_gisrc = '' #GISRC file for source location/mapset of map(s) to georectify
-
+
# define wizard pages
self.wizard = wiz.Wizard(parent, -1, "Setup for georectification")
self.startpage = LocationPage(self.wizard, self)
@@ -185,7 +185,7 @@
self.xy_mapdisp = mapdisp.MapFrame(self.parent, title="Set ground control points (GCPs)",
pos=wx.DefaultPosition, size=(640,480),
style=wx.DEFAULT_FRAME_STYLE, toolbars=["georect"],
- Map=self.Map, gwiz=self, georect=True)
+ Map=self.Map, gwiz=self, gismgr=self.parent, georect=True)
self.mapwin = self.xy_mapdisp.MapWindow
@@ -253,6 +253,7 @@
def Cleanup(self):
# return to current location and mapset
self.SwitchEnv('original')
+ self.parent.georect = False
self.wizard.Destroy()
class LocationPage(TitledPage):
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-02-01 07:16:55 UTC (rev 29922)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-02-01 07:17:38 UTC (rev 29923)
@@ -137,12 +137,13 @@
pos = wx.DefaultPosition,
size = wx.DefaultSize,
style=wx.NO_FULL_REPAINT_ON_RESIZE,
- Map=None, tree=None):
+ Map=None, tree=None, gismgr=None):
wx.Window.__init__(self, parent, id, pos, size, style)
self.parent = parent
self.Map = Map
self.tree = tree
+ self.gismanager=gismgr
#
# Flags
@@ -1103,7 +1104,8 @@
self.DrawLines(pdc=self.pdcTmp)
except:
pass
- elif self.mouse["use"] == "pointer" and self.parent.grtoolbar:
+ elif self.mouse["use"] == "pointer" and self.gismanager.georectifying:
+ self.SetCursor(self.parent.cursors["cross"])
print self.Pixel2Cell(self.mouse['end'])
self.DrawCross(pdc=self.pdcTmp, coords=self.mouse['end'],
size=5)
@@ -2114,7 +2116,7 @@
self.__InitDisplay() # initialize region values
# initialize buffered DC & set default cursor
- self.MapWindow = BufferedWindow(self, id=wx.ID_ANY, Map=self.Map, tree=self.tree)
+ self.MapWindow = BufferedWindow(self, id=wx.ID_ANY, Map=self.Map, tree=self.tree, gismgr=self.gismanager)
self.MapWindow.Bind(wx.EVT_MOTION, self.OnMotion)
self.MapWindow.SetCursor(self.cursors["default"])
@@ -2297,7 +2299,7 @@
self.MapWindow.UpdateMap(render=True)
def OnPointer(self, event):
- """Pointer button clicled"""
+ """Pointer button clicked"""
self.MapWindow.mouse['use'] = "pointer"
self.MapWindow.mouse['box'] = "point"
@@ -2319,7 +2321,7 @@
self.MapWindow.mouse['box'] = 'point'
else: # moveLine, deleteLine
self.MapWindow.mouse['box'] = 'box'
- elif self.grtoolbar:
+ elif self.gismanager.georectifying:
self.MapWindow.SetCursor(self.cursors["cross"])
else:
self.MapWindow.SetCursor(self.cursors["default"])
More information about the grass-commit
mailing list