GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
frame.MapFrame Class Reference

Main frame for map display window. More...

Inheritance diagram for frame.MapFrame:
Collaboration diagram for frame.MapFrame:

Public Member Functions

def __init__
 Main map display window with toolbars, statusbar and BufferedWindow (map canvas) More...
 
def GetMapWindow
 
def AddNviz
 Add 3D view mode window. More...
 
def RemoveNviz
 Restore 2D view. More...
 
def AddToolbar
 Add defined toolbar to the window. More...
 
def RemoveToolbar
 Removes defined toolbar from the window. More...
 
def IsPaneShown
 Check if pane (toolbar, mapWindow ...) of given name is currently shown. More...
 
def OnUpdateProgress
 Update progress bar info. More...
 
def OnFocus
 Change choicebook page to match display. More...
 
def RemoveQueryLayer
 Removes temporary map layers (queries) More...
 
def OnRender
 Re-render map composition (each map layer) More...
 
def OnPointer
 Pointer button clicked. More...
 
def OnRotate
 Rotate 3D view. More...
 
def OnFlyThrough
 Fly-through mode. More...
 
def OnZoomRegion
 
def OnAlignRegion
 
def SaveToFile
 Save map to image. More...
 
def PrintMenu
 
def OnCloseWindow
 Window closed. More...
 
def Query
 Query selected layers. More...
 
def QueryMap
 Query raster or vector map layers by r/v.what. More...
 
def QueryVector
 Query vector map layer features. More...
 
def OnQuery
 Query tools menu. More...
 
def AddTmpVectorMapLayer
 Add temporal vector map layer to map composition. More...
 
def OnMeasure
 Init measurement routine that calculates map distance along transect drawn on map display. More...
 
def MeasureDist
 Calculate map distance from screen distance and print to output window. More...
 
def OnProfile
 Launch profile tool. More...
 
def FormatDist
 Format length numbers and units in a nice way, as a function of length. More...
 
def OnHistogram
 Init histogram display canvas and tools. More...
 
def OnAddBarscale
 Handler for scale/arrow map decoration menu selection. More...
 
def OnAddLegend
 Handler for legend map decoration menu selection. More...
 
def OnAddText
 Handler for text decoration menu selection. More...
 
def OnAddArrow
 Handler for north arrow menu selection. More...
 
def GetOptData
 Callback method for decoration overlay command generated by dialog created in menuform.py. More...
 
def OnZoomToMap
 Set display extents to match selected raster (including NULLs) or vector map. More...
 
def OnZoomToRaster
 Set display extents to match selected raster map (ignore NULLs) More...
 
def OnZoomToSaved
 Set display geometry to match extents in saved region file. More...
 
def OnDisplayToWind
 Set computational region (WIND file) to match display extents. More...
 
def OnSaveDisplayRegion
 Save display extents to named region file. More...
 
def OnSaveWindRegion
 Save computational region to named region file. More...
 
def OnZoomMenu
 Popup Zoom menu. More...
 
def SetProperties
 Set properies of map display window. More...
 
def IsStandalone
 Check if Map display is standalone. More...
 
def GetLayerManager
 Get reference to Layer Manager. More...
 
def GetMapToolbar
 Returns toolbar with zooming tools. More...
 

Data Fields

 tree
 
 page
 
 layerbook
 
 statusbarItems
 
 statusbarItemsHiddenInNviz
 
 statusbarManager
 
 MapWindow2D
 
 MapWindow
 
 MapWindowVDigit
 
 MapWindow3D
 
 printopt
 
 dialogs
 
 decorationDialog
 
 tmpreg
 
 totaldist
 

Detailed Description

Main frame for map display window.

Drawing takes place in child double buffered drawing window.

Definition at line 58 of file mapdisp/frame.py.

Constructor & Destructor Documentation

def frame.MapFrame.__init__ (   self,
  parent = None,
  title = _("GRASS GIS - Map display"),
  toolbars = ["map"],
  tree = None,
  notebook = None,
  lmgr = None,
  page = None,
  Map = None,
  auimgr = None,
  name = 'MapWindow',
  kwargs 
)

Main map display window with toolbars, statusbar and BufferedWindow (map canvas)

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
nameframe name
kwargswx.Frame attributes

Definition at line 64 of file mapdisp/frame.py.

References mapdisplay.MapFrame._layerManager, and frame.MapFrame._layerManager.

Member Function Documentation

def frame.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 870 of file mapdisp/frame.py.

References utils.ListOfCatsToRange().

Referenced by frame.MapFrame.QueryVector().

def frame.MapFrame.AddToolbar (   self,
  name 
)
def frame.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 1023 of file mapdisp/frame.py.

References round.

Referenced by frame.MapFrame.MeasureDist().

def frame.MapFrame.GetLayerManager (   self)

Get reference to Layer Manager.

Returns
window reference
None (if standalone)

Definition at line 1287 of file mapdisp/frame.py.

References mapdisplay.MapFrame._layerManager, and frame.MapFrame._layerManager.

def frame.MapFrame.GetMapToolbar (   self)
def frame.MapFrame.GetOptData (   self,
  dcmd,
  type,
  params,
  propwin 
)

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

Definition at line 1204 of file mapdisp/frame.py.

References python.task.grassTask.params, histogram.HistogramFrame.params, model.ModelParamDialog.params, and histogram.HistogramFrame.propwin.

Referenced by histogram.HistogramFrame.OnOptions().

def frame.MapFrame.IsPaneShown (   self,
  name 
)

Check if pane (toolbar, mapWindow ...) of given name is currently shown.

Definition at line 420 of file mapdisp/frame.py.

Referenced by frame.MapFrame.OnAddText(), frame.MapFrame.OnCloseWindow(), frame.MapFrame.Query(), frame.MapFrame.QueryVector(), and frame.MapFrame.SaveToFile().

def frame.MapFrame.IsStandalone (   self)

Check if Map display is standalone.

Definition at line 1280 of file mapdisp/frame.py.

References mapdisplay.MapFrame._layerManager, and frame.MapFrame._layerManager.

Referenced by frame.MapFrame.OnQuery().

def frame.MapFrame.MeasureDist (   self,
  beginpt,
  endpt 
)

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

Definition at line 967 of file mapdisp/frame.py.

References mapdisplay.MapFrame.FormatDist(), frame.MapFrame.FormatDist(), round, and frame.MapFrame.totaldist.

def frame.MapFrame.OnAddArrow (   self,
  event 
)

Handler for north arrow menu selection.

Opens Appearance page of nviz notebook.

Definition at line 1196 of file mapdisp/frame.py.

def frame.MapFrame.OnAddBarscale (   self,
  event 
)

Handler for scale/arrow map decoration menu selection.

Definition at line 1083 of file mapdisp/frame.py.

References frame.GMFrame.dialogs, frame.MapFrame.dialogs, and mapdisplay.MapFrame.dialogs.

def frame.MapFrame.OnAddLegend (   self,
  event 
)

Handler for legend map decoration menu selection.

Definition at line 1115 of file mapdisp/frame.py.

References frame.GMFrame.dialogs, frame.MapFrame.dialogs, and mapdisplay.MapFrame.dialogs.

def frame.MapFrame.OnAddText (   self,
  event 
)

Handler for text decoration menu selection.

Definition at line 1145 of file mapdisp/frame.py.

References frame.GMFrame.dialogs, frame.MapFrame.dialogs, mapdisplay.MapFrame.dialogs, frame.GMFrame.IsPaneShown(), frame.MapFrame.IsPaneShown(), and max.

def frame.MapFrame.OnAlignRegion (   self,
  event 
)
Align region

Definition at line 539 of file mapdisp/frame.py.

def frame.MapFrame.OnDisplayToWind (   self,
  event 
)

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

Definition at line 1232 of file mapdisp/frame.py.

Referenced by frame.MapFrame.OnZoomMenu().

def frame.MapFrame.OnFocus (   self,
  event 
)

Change choicebook page to match display.

Definition at line 433 of file mapdisp/frame.py.

References mapdisplay.MapFrame.page, wizard.TitledPage.page, and frame.MapFrame.page.

def frame.MapFrame.OnHistogram (   self,
  event 
)

Init histogram display canvas and tools.

Definition at line 1073 of file mapdisp/frame.py.

def frame.MapFrame.OnMeasure (   self,
  event 
)

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

Definition at line 924 of file mapdisp/frame.py.

def frame.MapFrame.OnProfile (   self,
  event 
)

Launch profile tool.

Definition at line 1007 of file mapdisp/frame.py.

def frame.MapFrame.OnRender (   self,
  event 
)

Re-render map composition (each map layer)

Definition at line 451 of file mapdisp/frame.py.

References mapdisp.MapFrameBase.GetToolbar(), frame.MapFrame.RemoveQueryLayer(), and mapdisp.MapFrameBase.StatusbarUpdate().

def frame.MapFrame.OnSaveDisplayRegion (   self,
  event 
)

Save display extents to named region file.

Definition at line 1238 of file mapdisp/frame.py.

Referenced by frame.MapFrame.OnZoomMenu().

def frame.MapFrame.OnSaveWindRegion (   self,
  event 
)

Save computational region to named region file.

Definition at line 1243 of file mapdisp/frame.py.

Referenced by frame.MapFrame.OnZoomMenu().

def frame.MapFrame.OnUpdateProgress (   self,
  event 
)
def frame.MapFrame.OnZoomRegion (   self,
  event 
)
Zoom to region

Definition at line 530 of file mapdisp/frame.py.

References mapwindow.BufferedWindow.UpdateMap(), and mapwindow.GLWindow.UpdateMap().

def frame.MapFrame.OnZoomToMap (   self,
  event 
)

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

Definition at line 1215 of file mapdisp/frame.py.

def frame.MapFrame.OnZoomToRaster (   self,
  event 
)

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

Definition at line 1221 of file mapdisp/frame.py.

def frame.MapFrame.OnZoomToSaved (   self,
  event 
)

Set display geometry to match extents in saved region file.

Definition at line 1226 of file mapdisp/frame.py.

Referenced by frame.MapFrame.OnZoomMenu().

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

Definition at line 597 of file mapdisp/frame.py.

def frame.MapFrame.Query (   self,
  x,
  y,
  layers 
)

Query selected layers.

Calls QueryMap in case of raster or more vectors, or QueryVector in case of one vector with db connection.

Parameters
x,ycoordinates
layersselected tree item layers

Definition at line 643 of file mapdisp/frame.py.

References frame.GMFrame.IsPaneShown(), frame.MapFrame.IsPaneShown(), frame.MapFrame.QueryMap(), and frame.MapFrame.QueryVector().

def frame.MapFrame.QueryMap (   self,
  east,
  north,
  qdist,
  layers 
)

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

Parameters
east,northcoordinates
qdistquery distance
layersselected tree items

Definition at line 698 of file mapdisp/frame.py.

References utils.GetLayerNameFromCmd().

Referenced by frame.MapFrame.Query().

def frame.MapFrame.QueryVector (   self,
  east,
  north,
  qdist,
  posWindow,
  layer 
)
def frame.MapFrame.RemoveQueryLayer (   self)

Removes temporary map layers (queries)

Definition at line 445 of file mapdisp/frame.py.

References mapdisp.MapFrameBase.GetMap(), and layertree.LayerTree.GetMap().

Referenced by frame.MapFrame.OnRender().

def frame.MapFrame.RemoveToolbar (   self,
  name 
)

Removes defined toolbar from the window.

Todo:
Only hide, activate by calling AddToolbar()

Definition at line 397 of file mapdisp/frame.py.

References mapdisplay.MapFrame.MapWindow, frame.MapFrame.MapWindow, manager.GCP.MapWindow, frame.MapFrame.MapWindow2D, mapdisp.MapFrameBase.toolbars, and frame.GMFrame.toolbars.

def frame.MapFrame.SaveToFile (   self,
  event 
)

Save map to image.

Definition at line 549 of file mapdisp/frame.py.

References dialogs.GetImageHandlers(), frame.GMFrame.IsPaneShown(), and frame.MapFrame.IsPaneShown().

def frame.MapFrame.SetProperties (   self,
  render = False,
  mode = 0,
  showCompExtent = False,
  constrainRes = False,
  projection = False,
  alignExtent = True 
)

Set properies of map display window.

Definition at line 1270 of file mapdisp/frame.py.

References statusbar.SbManager.SetProperty(), mapdisp.MapFrameBase.SetProperty(), and mapdisp.MapFrameBase.StatusbarUpdate().

Referenced by frame.MapFrame.OnZoomMenu().

Field Documentation

frame.MapFrame.decorationDialog

Definition at line 181 of file mapdisp/frame.py.

frame.MapFrame.layerbook

Definition at line 84 of file mapdisp/frame.py.

frame.MapFrame.MapWindow2D

Definition at line 128 of file mapdisp/frame.py.

Referenced by frame.MapFrame.RemoveNviz(), and frame.MapFrame.RemoveToolbar().

frame.MapFrame.MapWindow3D

Definition at line 136 of file mapdisp/frame.py.

Referenced by frame.MapFrame.AddNviz(), and frame.MapFrame.RemoveNviz().

frame.MapFrame.MapWindowVDigit

Definition at line 134 of file mapdisp/frame.py.

Referenced by frame.MapFrame.GetMapWindow().

frame.MapFrame.page
frame.MapFrame.printopt

Definition at line 162 of file mapdisp/frame.py.

frame.MapFrame.statusbarItemsHiddenInNviz

Definition at line 107 of file mapdisp/frame.py.

Referenced by frame.MapFrame.AddNviz(), and frame.MapFrame.RemoveNviz().

frame.MapFrame.statusbarManager

Definition at line 116 of file mapdisp/frame.py.

frame.MapFrame.tmpreg

Definition at line 726 of file mapdisp/frame.py.

frame.MapFrame.totaldist

Definition at line 928 of file mapdisp/frame.py.

Referenced by frame.MapFrame.MeasureDist().

frame.MapFrame.tree

Definition at line 82 of file mapdisp/frame.py.

Referenced by frame.MapFrame.AddNviz(), and frame.MapFrame.GetMapWindow().


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