GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_modules.mapdisp.MapFrame Class Reference

Main frame for map display window. More...

Public Member Functions

def __init__
 Main map display window with toolbars, statusbar and DrawWindow.
def AddToolbar
 Add defined toolbar to the window.
def RemoveToolbar
 Removes defined toolbar from the window.
def OnUpdateProgress
 Update progress bar info.
def OnFocus
def OnDraw
 Re-display current map composition.
def OnRender
 Re-render map composition (each map layer)
def OnPointer
 Pointer button clicked.
def OnZoomIn
def OnZoomOut
def OnZoomBack
def OnPan
def OnErase
def OnZoomRegion
def OnAlignRegion
def OnToggleRender
 Enable/disable auto-rendering.
def IsAutoRendered
 Check if auto-rendering is enabled.
def OnToggleShowRegion
 Show/Hide extent in map canvas.
def OnToggleResolution
def OnToggleStatus
def OnChangeMapScale
def OnGoTo
def StatusbarUpdate
 Update statusbar content.
def StatusbarEnableLongHelp
 Enable/disable toolbars long help.
def StatusbarReposition
 Reposition checkbox in statusbar.
def SaveToFile
 Save map to image.
def PrintMenu
def OnCloseWindow
 Window closed.
def GetRender
 Returns current instance of render.Map()
def GetWindow
 Get map window.
def OnNvizQuerySurface
 Query current surface in 3D view mode.
def OnNvizQueryVector
 Query current vector in 3D view mode.
def QueryMap
 Query raster or vector map layers by r/v.what.
def QueryVector
 Query vector map layer features.
def OnQuery
 Query tools menu.
def AddTmpVectorMapLayer
 Add temporal vector map layer to map composition.
def OnAnalyze
 Analysis tools menu.
def OnMeasure
 Init measurement routine that calculates map distance along transect drawn on map display.
def MeasureDist
 Calculate map distance from screen distance and print to output window.
def Profile
 Init profile canvas and tools.
def FormatDist
 Format length numbers and units in a nice way, as a function of length.
def Histogram
 Init histogram display canvas and tools.
def OnDecoration
 Decorations overlay menu.
def OnAddBarscale
 Handler for scale/arrow map decoration menu selection.
def OnAddLegend
 Handler for legend map decoration menu selection.
def OnAddText
 Handler for text decoration menu selection.
def GetOptData
 Callback method for decoration overlay command generated by dialog created in menuform.py.
def OnZoomToMap
 Set display extents to match selected raster (including NULLs) or vector map.
def OnZoomToRaster
 Set display extents to match selected raster map (ignore NULLs)
def OnZoomToWind
 Set display geometry to match computational region settings (set with g.region)
def OnZoomToDefault
 Set display geometry to match default region settings.
def OnZoomToSaved
 Set display geometry to match extents in saved region file.
def OnDisplayToWind
 Set computational region (WIND file) to match display extents.
def SaveDisplayRegion
 Save display extents to named region file.
def OnZoomMenu
 Popup Zoom menu.
def SetProperties
 Set properies of map display window.
def IsStandalone
 Check if Map display is standalone.
def GetLayerManager
 Get reference to Layer Manager.

Data Fields

 Map
 tree
 page
 layerbook
 parent
 cursors
 iconsize
 toolbars
 statusbar
 statusbarWin
 MapWindow2D
 MapWindow
 MapWindowVDigit
 MapWindow3D
 printopt
 dialogs
 decorationDialog
 height
 mapScaleValue
 ppm
 screen X region problem user should specify ppm
 tmpreg
 totaldist
 profile
 histogram

Detailed Description

Main frame for map display window.

Drawing takes place in child double buffered drawing window.

Definition at line 77 of file mapdisp.py.


Constructor & Destructor Documentation

def gui_modules.mapdisp.MapFrame.__init__ (   self,
  parent = None,
  id = wx.ID_ANY,
  title = _("GRASS GIS - Map display"),
  style = wx.DEFAULT_FRAME_STYLE,
  toolbars = ["map"],
  tree = None,
  notebook = None,
  lmgr = None,
  page = None,
  Map = None,
  auimgr = None,
  kwargs 
)

Main map display window with toolbars, statusbar and DrawWindow.

Parameters:
toolbarsarray of activated toolbars, e.g. ['map', 'digit']
treereference to layer tree
notebookcontrol book ID in Layer Manager
lmgrLayer Manager
pagenotebook page with layer tree
Mapinstance of render.Map
auimgsAUI manager
kwargswx.Frame attribures

Definition at line 84 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame._layerManager, and gui_modules.mapdisp.MapFrame._layerManager.


Member Function Documentation

def gui_modules.mapdisp.MapFrame.AddTmpVectorMapLayer (   self,
  name,
  cats,
  useId = False,
  addLayer = True 
)

Add temporal vector map layer to map composition.

Parameters:
namename of map layer
useIduse feature id instead of category

Definition at line 1467 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.QueryVector().

def gui_modules.mapdisp.MapFrame.AddToolbar (   self,
  name 
)
def gui_modules.mapdisp.MapFrame.FormatDist (   self,
  dist 
)

Format length numbers and units in a nice way, as a function of length.

From code by Hamish Bowman Grass Development Team 2006

Definition at line 1647 of file mapdisp.py.

References round.

Referenced by gui_modules.mapdisp.MapFrame.MeasureDist().

def gui_modules.mapdisp.MapFrame.GetLayerManager (   self)

Get reference to Layer Manager.

Returns:
window reference
None (if standalone)

Definition at line 1945 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame._layerManager, and gui_modules.mapdisp.MapFrame._layerManager.

def gui_modules.mapdisp.MapFrame.GetOptData (   self,
  dcmd,
  type,
  params,
  propwin 
)

Callback method for decoration overlay command generated by dialog created in menuform.py.

Definition at line 1844 of file mapdisp.py.

References python.task.grassTask.params, gui_modules.histogram.HistFrame.params, gui_modules.gmodeler.ModelParamDialog.params, and gui_modules.histogram.HistFrame.propwin.

def gui_modules.mapdisp.MapFrame.Histogram (   self,
  event 
)

Init histogram display canvas and tools.

Definition at line 1697 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnAnalyze().

def gui_modules.mapdisp.MapFrame.IsAutoRendered (   self)

Check if auto-rendering is enabled.

Definition at line 702 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.statusbarWin, and gui_modules.mapdisp.MapFrame.statusbarWin.

def gui_modules.mapdisp.MapFrame.IsStandalone (   self)
def gui_modules.mapdisp.MapFrame.MeasureDist (   self,
  beginpt,
  endpt 
)

Calculate map distance from screen distance and print to output window.

Definition at line 1593 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.FormatDist(), gui_modules.mapdisp.MapFrame.FormatDist(), round, and gui_modules.mapdisp.MapFrame.totaldist.

def gui_modules.mapdisp.MapFrame.OnAddBarscale (   self,
  event 
)

Handler for scale/arrow map decoration menu selection.

Definition at line 1738 of file mapdisp.py.

References gui_modules.mapdisp.MapFrame.dialogs, and gui_modules.gcpmapdisp.MapFrame.dialogs.

Referenced by gui_modules.mapdisp.MapFrame.OnDecoration().

def gui_modules.mapdisp.MapFrame.OnAddLegend (   self,
  event 
)

Handler for legend map decoration menu selection.

Definition at line 1770 of file mapdisp.py.

References gui_modules.mapdisp.MapFrame.dialogs, and gui_modules.gcpmapdisp.MapFrame.dialogs.

Referenced by gui_modules.mapdisp.MapFrame.OnDecoration().

def gui_modules.mapdisp.MapFrame.OnAddText (   self,
  event 
)

Handler for text decoration menu selection.

Definition at line 1800 of file mapdisp.py.

References gui_modules.mapdisp.MapFrame.dialogs, and gui_modules.gcpmapdisp.MapFrame.dialogs.

Referenced by gui_modules.mapdisp.MapFrame.OnDecoration().

def gui_modules.mapdisp.MapFrame.OnAlignRegion (   self,
  event 
)
Align region

Definition at line 686 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnAnalyze (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnDecoration (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnDisplayToWind (   self,
  event 
)

Set computational region (WIND file) to match display extents.

Definition at line 1883 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnZoomMenu().

def gui_modules.mapdisp.MapFrame.OnDraw (   self,
  event 
)

Re-display current map composition.

Definition at line 551 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnErase (   self,
  event 
)
Erase the canvas

Definition at line 671 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnFocus (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnGoTo (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnMeasure (   self,
  event 
)

Init measurement routine that calculates map distance along transect drawn on map display.

Definition at line 1549 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnAnalyze().

def gui_modules.mapdisp.MapFrame.OnNvizQuerySurface (   self,
  event 
)

Query current surface in 3D view mode.

Definition at line 1219 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.toolbars, and gui_modules.mapdisp.MapFrame.toolbars.

Referenced by gui_modules.mapdisp.MapFrame.OnQuery().

def gui_modules.mapdisp.MapFrame.OnNvizQueryVector (   self,
  event 
)

Query current vector in 3D view mode.

Definition at line 1230 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.toolbars, and gui_modules.mapdisp.MapFrame.toolbars.

Referenced by gui_modules.mapdisp.MapFrame.OnQuery().

def gui_modules.mapdisp.MapFrame.OnPan (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnToggleRender (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnToggleResolution (   self,
  event 
)
Use resolution of computation region settings
for redering image instead of display resolution

Definition at line 719 of file mapdisp.py.

References gui_modules.histogram.HistFrame.OnRender(), gui_modules.gcpmapdisp.MapFrame.OnRender(), gui_modules.mapdisp.MapFrame.OnRender(), gui_modules.gcpmapdisp.MapFrame.statusbarWin, and gui_modules.mapdisp.MapFrame.statusbarWin.

def gui_modules.mapdisp.MapFrame.OnToggleShowRegion (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnToggleStatus (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnUpdateProgress (   self,
  event 
)

Update progress bar info.

Definition at line 525 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.statusbarWin, and gui_modules.mapdisp.MapFrame.statusbarWin.

def gui_modules.mapdisp.MapFrame.OnZoomBack (   self,
  event 
)
Zoom last (previously stored position)

Definition at line 650 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnZoomIn (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnZoomOut (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnZoomRegion (   self,
  event 
)
def gui_modules.mapdisp.MapFrame.OnZoomToDefault (   self,
  event 
)

Set display geometry to match default region settings.

Definition at line 1872 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnZoomMenu().

def gui_modules.mapdisp.MapFrame.OnZoomToMap (   self,
  event 
)

Set display extents to match selected raster (including NULLs) or vector map.

Definition at line 1855 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnZoomToRaster (   self,
  event 
)

Set display extents to match selected raster map (ignore NULLs)

Definition at line 1861 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.OnZoomToSaved (   self,
  event 
)

Set display geometry to match extents in saved region file.

Definition at line 1877 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnZoomMenu().

def gui_modules.mapdisp.MapFrame.OnZoomToWind (   self,
  event 
)

Set display geometry to match computational region settings (set with g.region)

Definition at line 1866 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnZoomMenu().

def gui_modules.mapdisp.MapFrame.PrintMenu (   self,
  event 
)
Print options and output menu for map display

Definition at line 1163 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.Profile (   self,
  event 
)

Init profile canvas and tools.

Definition at line 1631 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnAnalyze().

def gui_modules.mapdisp.MapFrame.QueryMap (   self,
  x,
  y 
)

Query raster or vector map layers by r/v.what.

Parameters:
x,ycoordinates

Definition at line 1241 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.IsStandalone(), and gui_modules.mapdisp.MapFrame.IsStandalone().

def gui_modules.mapdisp.MapFrame.QueryVector (   self,
  x,
  y 
)

Query vector map layer features.

Attribute data of selected vector object are displayed in GUI dialog. Data can be modified (On Submit)

Definition at line 1350 of file mapdisp.py.

References gui_modules.mapdisp.MapFrame.AddTmpVectorMapLayer(), gui_modules.mapdisp.MapFrame.dialogs, gui_modules.gcpmapdisp.MapFrame.dialogs, gui_modules.mapdisp.MapFrame.MapWindow, gui_modules.gcpmapdisp.MapFrame.MapWindow, gui_modules.gcpmanager.GCP.MapWindow, and gui_modules.menuform.UpdateDialog().

def gui_modules.mapdisp.MapFrame.SaveDisplayRegion (   self,
  event 
)

Save display extents to named region file.

Definition at line 1889 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnZoomMenu().

def gui_modules.mapdisp.MapFrame.SaveToFile (   self,
  event 
)

Save map to image.

Definition at line 1115 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.toolbars, and gui_modules.mapdisp.MapFrame.toolbars.

def gui_modules.mapdisp.MapFrame.SetProperties (   self,
  render = False,
  mode = 0,
  showCompExtent = False,
  constrainRes = False,
  projection = False 
)
def gui_modules.mapdisp.MapFrame.StatusbarEnableLongHelp (   self,
  enable = True 
)

Enable/disable toolbars long help.

Definition at line 1073 of file mapdisp.py.

def gui_modules.mapdisp.MapFrame.StatusbarReposition (   self)

Reposition checkbox in statusbar.

Definition at line 1079 of file mapdisp.py.

References gui_modules.gcpmapdisp.MapFrame.statusbarWin, and gui_modules.mapdisp.MapFrame.statusbarWin.


Field Documentation

gui_modules.mapdisp.MapFrame.decorationDialog

Definition at line 288 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.histogram

Definition at line 1700 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.iconsize
gui_modules.mapdisp.MapFrame.layerbook

Definition at line 101 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.mapScaleValue

Definition at line 852 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnChangeMapScale().

gui_modules.mapdisp.MapFrame.MapWindow
gui_modules.mapdisp.MapFrame.MapWindow2D

Definition at line 235 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.RemoveToolbar().

gui_modules.mapdisp.MapFrame.MapWindow3D

Definition at line 243 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.RemoveToolbar().

gui_modules.mapdisp.MapFrame.MapWindowVDigit

Definition at line 241 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.RemoveToolbar().

gui_modules.mapdisp.MapFrame.ppm

screen X region problem user should specify ppm

Definition at line 852 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.OnChangeMapScale().

gui_modules.mapdisp.MapFrame.printopt

Definition at line 269 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.profile
gui_modules.mapdisp.MapFrame.statusbar

Definition at line 146 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.tmpreg

Definition at line 1287 of file mapdisp.py.

gui_modules.mapdisp.MapFrame.totaldist

Definition at line 1553 of file mapdisp.py.

Referenced by gui_modules.mapdisp.MapFrame.MeasureDist().


The documentation for this class was generated from the following file: