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

Virtual class which stores information about layers (map layers and overlays) of the map composition. More...

Inheritance diagram for render.Layer:
Collaboration diagram for render.Layer:

Public Member Functions

def __init__
 
def __del__
 
def Render
 Render layer to image. More...
 
def GetCmd
 Get GRASS command as list of string. More...
 
def GetType
 Get map layer type. More...
 
def GetElement
 Get map element type. More...
 
def GetOpacity
 
def GetName
 Get map layer name. More...
 
def IsActive
 Check if layer is activated for rendering. More...
 
def SetType
 Set layer type. More...
 
def SetName
 Set layer name. More...
 
def SetActive
 Active or deactive layer. More...
 
def SetHidden
 Hide or show map layer in Layer Manager. More...
 
def SetOpacity
 Set opacity value. More...
 
def SetCmd
 Set new command for layer. More...
 

Data Fields

 type
 
 name
 
 cmd
 
 active
 
 hidden
 
 opacity
 
 force_render
 
 mapfile
 
 maskfile
 

Detailed Description

Virtual class which stores information about layers (map layers and overlays) of the map composition.

For map layer use MapLayer class. For overlays use Overlay class.

Definition at line 48 of file render.py.

Constructor & Destructor Documentation

def render.Layer.__init__ (   self,
  type,
  cmd,
  name = None,
  active = True,
  hidden = False,
  opacity = 1.0 
)
Todo:
pass cmd as tuple instead of list
Parameters
typelayer type ('raster', 'vector', 'overlay', 'command', etc.)
cmdGRASS command to render layer, given as list, e.g. ['d.rast', 'map=elevation']
namelayer name, e.g. 'elevation' (for layer tree)
activelayer is active, will be rendered only if True
hiddenlayer is hidden, won't be listed in Layer Manager if True
opacitylayer opacity <0;1>

Definition at line 56 of file render.py.

def render.Layer.__del__ (   self)

Definition at line 101 of file render.py.

References render.Layer.GetCmd(), and render.Layer.name.

Member Function Documentation

def render.Layer.GetCmd (   self,
  string = False 
)

Get GRASS command as list of string.

Parameters
stringget command as string if True otherwise as list
Returns
command list/string

Definition at line 211 of file render.py.

References render.Layer.cmd, gcmd.Command.cmd, gcmd.CommandThread.cmd, utils.GetCmdString(), and render.Layer.type.

Referenced by render.Layer.__del__(), wxnviz.ImageTexture.Corresponds(), dialogs.ModelSearchDialog.OnOk(), render.Layer.Render(), and render.Layer.SetCmd().

def render.Layer.GetElement (   self)
def render.Layer.GetName (   self,
  fullyQualified = True 
)

Get map layer name.

Parameters
fullyQualifiedTrue to return fully qualified name as a string 'name' otherwise directory { 'name', 'mapset' } is returned
Returns
string / directory

Definition at line 253 of file render.py.

References render.Layer.name.

Referenced by dialogs.ItemCheckListCtrl.OnCheckItem(), widgets.SingleSymbolPanel.OnDoubleClick(), and widgets.SingleSymbolPanel.OnLeftDown().

def render.Layer.GetOpacity (   self,
  float = False 
)
Get layer opacity level

@param float get opacity level in <0,1> otherwise <0,100>

@return opacity level

Definition at line 240 of file render.py.

References render.Layer.opacity.

Referenced by dialogs.SetOpacityDialog.OnApply().

def render.Layer.GetType (   self)

Get map layer type.

Definition at line 230 of file render.py.

References render.Layer.type.

Referenced by dialogs.ModelDataDialog.OnOK().

def render.Layer.IsActive (   self)

Check if layer is activated for rendering.

Definition at line 272 of file render.py.

References render.Layer.active.

def render.Layer.Render (   self)
def render.Layer.SetActive (   self,
  enable = True 
)

Active or deactive layer.

Definition at line 291 of file render.py.

References render.Layer.active.

def render.Layer.SetCmd (   self,
  cmd 
)
def render.Layer.SetHidden (   self,
  enable = False 
)

Hide or show map layer in Layer Manager.

Definition at line 295 of file render.py.

References render.Layer.hidden.

def render.Layer.SetOpacity (   self,
  value 
)

Set opacity value.

Definition at line 299 of file render.py.

References render.Layer.opacity.

def render.Layer.SetType (   self,
  type 
)

Set layer type.

Definition at line 276 of file render.py.

References render.Layer.type.

Field Documentation

render.Layer.active
render.Layer.force_render

Definition at line 82 of file render.py.

Referenced by render.Layer.Render(), and render.Layer.SetCmd().

render.Layer.hidden

Definition at line 79 of file render.py.

Referenced by render.Layer.SetHidden().

render.Layer.maskfile

Definition at line 99 of file render.py.

Referenced by render.Layer.Render().

render.Layer.opacity

Definition at line 80 of file render.py.

Referenced by render.Layer.GetOpacity(), and render.Layer.SetOpacity().


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