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

Base class for map display window. More...

Inheritance diagram for mapdisp.MapFrameBase:
Collaboration diagram for mapdisp.MapFrameBase:

Public Member Functions

def __init__
 
def SetProperty
 Sets property. More...
 
def GetProperty
 Returns property. More...
 
def HasProperty
 Checks whether object has property. More...
 
def GetPPM
 Get pixel per meter. More...
 
def SetMapScale
 Set current map scale. More...
 
def GetMapScale
 Get current map scale. More...
 
def GetProgressBar
 Returns progress bar. More...
 
def GetMap
 Returns current Map instance. More...
 
def GetWindow
 Get map window. More...
 
def GetMapToolbar
 Returns toolbar with zooming tools. More...
 
def GetToolbar
 Returns toolbar if exists else None. More...
 
def StatusbarUpdate
 Update statusbar content. More...
 
def IsAutoRendered
 Check if auto-rendering is enabled. More...
 
def CoordinatesChanged
 Shows current coordinates on statusbar. More...
 
def StatusbarReposition
 Reposition items in statusbar. More...
 
def StatusbarEnableLongHelp
 Enable/disable toolbars long help. More...
 
def IsStandalone
 Check if Map display is standalone. More...
 
def OnRender
 Re-render map composition (each map layer) More...
 
def OnDraw
 Re-display current map composition. More...
 
def OnErase
 Erase the canvas. More...
 
def OnZoomIn
 Zoom in the map. More...
 
def OnZoomOut
 Zoom out the map. More...
 
def OnPointer
 Sets mouse mode to pointer. More...
 
def OnPan
 Panning, set mouse to drag. More...
 
def OnZoomBack
 Zoom last (previously stored position) More...
 
def OnZoomToMap
 Set display extents to match selected raster (including NULLs) or vector map. More...
 
def OnZoomToWind
 Set display geometry to match computational region settings (set with g.region) More...
 
def OnZoomToDefault
 Set display geometry to match default region settings. More...
 

Data Fields

 Map
 
 parent
 
 cursors
 
 iconsize
 
 toolbars
 
 height
 

Detailed Description

Base class for map display window.

Derived class must use statusbarManager or override GetProperty, SetProperty and HasProperty methods. If derived class enables and disables auto-rendering, it should override IsAutoRendered method.

Definition at line 28 of file mapdisp.py.

Constructor & Destructor Documentation

def mapdisp.MapFrameBase.__init__ (   self,
  parent = None,
  id = wx.ID_ANY,
  title = None,
  style = wx.DEFAULT_FRAME_STYLE,
  toolbars = None,
  Map = None,
  auimgr = None,
  name = None,
  kwargs 
)
Parameters
toolbarsarray of activated toolbars, e.g. ['map', 'digit']
Mapinstance of render.Map
auimgsAUI manager
nameframe name
kwargswx.Frame attributes

Definition at line 38 of file mapdisp.py.

Member Function Documentation

def mapdisp.MapFrameBase.CoordinatesChanged (   self)

Shows current coordinates on statusbar.

Used in BufferedWindow to report change of map coordinates (under mouse cursor).

Definition at line 221 of file mapdisp.py.

def mapdisp.MapFrameBase.GetMap (   self)

Returns current Map instance.

Definition at line 190 of file mapdisp.py.

References mapdisp.MapFrameBase.Map, mapdisplay.MapFrame.Map, manager.GCPWizard.Map, and manager.GCP.Map.

Referenced by frame.MapFrame.RemoveQueryLayer().

def mapdisp.MapFrameBase.GetMapScale (   self,
  map = None 
)

Get current map scale.

Parameters
mapMap instance (if none self.Map is used)

Definition at line 157 of file mapdisp.py.

References mapdisp.MapFrameBase.GetPPM(), mapdisp.MapFrameBase.Map, mapdisplay.MapFrame.Map, manager.GCPWizard.Map, and manager.GCP.Map.

def mapdisp.MapFrameBase.GetPPM (   self)

Get pixel per meter.

Todo:

now computed every time, is it necessary?

enable user to specify ppm (and store it in UserSettings)

Definition at line 106 of file mapdisp.py.

Referenced by mapdisp.MapFrameBase.GetMapScale(), and mapdisp.MapFrameBase.SetMapScale().

def mapdisp.MapFrameBase.GetProgressBar (   self)

Returns progress bar.

Progress bar can be used by other classes.

Definition at line 183 of file mapdisp.py.

Referenced by mapdisplay.MapFrame.OnUpdateProgress(), and frame.MapFrame.OnUpdateProgress().

def mapdisp.MapFrameBase.GetProperty (   self,
  name 
)

Returns property.

Definition at line 98 of file mapdisp.py.

Referenced by mapdisp.MapFrameBase.IsAutoRendered().

def mapdisp.MapFrameBase.GetToolbar (   self,
  name 
)

Returns toolbar if exists else None.

Toolbars dictionary contains currently used toolbars only.

Definition at line 203 of file mapdisp.py.

References mapdisp.MapFrameBase.toolbars.

Referenced by frame.MapFrame.OnCloseWindow(), frame.MapFrame.OnPointer(), and frame.MapFrame.OnRender().

def mapdisp.MapFrameBase.HasProperty (   self,
  name 
)

Checks whether object has property.

Definition at line 102 of file mapdisp.py.

def mapdisp.MapFrameBase.IsAutoRendered (   self)

Check if auto-rendering is enabled.

Definition at line 217 of file mapdisp.py.

References mapdisp.MapFrameBase.GetProperty().

Referenced by frame.MapFrame.QueryVector().

def mapdisp.MapFrameBase.IsStandalone (   self)

Check if Map display is standalone.

Definition at line 237 of file mapdisp.py.

Referenced by frame.MapFrame.OnQuery().

def mapdisp.MapFrameBase.OnDraw (   self,
  event 
)

Re-display current map composition.

Definition at line 246 of file mapdisp.py.

def mapdisp.MapFrameBase.OnErase (   self,
  event 
)

Erase the canvas.

Definition at line 251 of file mapdisp.py.

def mapdisp.MapFrameBase.OnPointer (   self,
  event 
)

Sets mouse mode to pointer.

Definition at line 296 of file mapdisp.py.

def mapdisp.MapFrameBase.OnRender (   self,
  event 
)

Re-render map composition (each map layer)

Definition at line 241 of file mapdisp.py.

def mapdisp.MapFrameBase.OnZoomBack (   self,
  event 
)

Zoom last (previously stored position)

Definition at line 321 of file mapdisp.py.

def mapdisp.MapFrameBase.OnZoomIn (   self,
  event 
)
def mapdisp.MapFrameBase.OnZoomOut (   self,
  event 
)
def mapdisp.MapFrameBase.OnZoomToDefault (   self,
  event 
)

Set display geometry to match default region settings.

Definition at line 339 of file mapdisp.py.

Referenced by mapdisplay.MapFrame.OnZoomMenu(), and frame.MapFrame.OnZoomMenu().

def mapdisp.MapFrameBase.OnZoomToMap (   self,
  event 
)

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

Definition at line 326 of file mapdisp.py.

def mapdisp.MapFrameBase.OnZoomToWind (   self,
  event 
)

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

Definition at line 333 of file mapdisp.py.

Referenced by mapdisplay.MapFrame.OnZoomMenu(), and frame.MapFrame.OnZoomMenu().

def mapdisp.MapFrameBase.SetMapScale (   self,
  value,
  map = None 
)

Set current map scale.

Parameters
valuescale value (n if scale is 1:n)
mapMap instance (if none self.Map is used)

Definition at line 136 of file mapdisp.py.

References mapdisp.MapFrameBase.GetPPM(), mapdisp.MapFrameBase.GetWindow(), render.Map.GetWindow(), mapdisp.MapFrameBase.Map, mapdisplay.MapFrame.Map, manager.GCPWizard.Map, and manager.GCP.Map.

def mapdisp.MapFrameBase.SetProperty (   self,
  name,
  value 
)

Sets property.

Definition at line 94 of file mapdisp.py.

Referenced by frame.MapFrame.SetProperties().

def mapdisp.MapFrameBase.StatusbarEnableLongHelp (   self,
  enable = True 
)

Enable/disable toolbars long help.

Definition at line 232 of file mapdisp.py.

def mapdisp.MapFrameBase.StatusbarReposition (   self)

Reposition items in statusbar.

Definition at line 228 of file mapdisp.py.

def mapdisp.MapFrameBase.StatusbarUpdate (   self)

Field Documentation

mapdisp.MapFrameBase.iconsize

Definition at line 68 of file mapdisp.py.

Referenced by frame.GMFrame.OnAboutGRASS().


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