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

Public Member Functions

def __init__
 Initialize Nviz class instance.
def __del__
 Destroy Nviz class instance.
def ResizeWindow
 GL canvas resized.
def SetViewDefault
 Set default view (based on loaded data)
def SetView
 Change view settings.
def SetZExag
 Set z-exag value.
def Draw
 Draw canvas.
def EraseMap
 Erase map display (with background color)
def InitView
 Initialize view.
def SetBgColor
 Set background color.
def SetLight
 Change lighting settings.
def LoadSurface
 Load raster map (surface)
def UnloadSurface
 Unload surface.
def LoadVector
 Load vector map overlay.
def UnloadVector
 Unload vector set.
def LoadVolume
 Load 3d raster map (volume)
def UnloadVolume
 Unload volume.
def SetSurfaceTopo
 Set surface topography.
def SetSurfaceColor
 Set surface color.
def SetSurfaceMask
 Set surface mask.
def SetSurfaceTransp
 Set surface mask.
def SetSurfaceShine
 Set surface shininess.
def SetSurfaceEmit
 Set surface emission.
def SetSurfaceAttr
 Set surface attribute.
def UnsetSurfaceMask
 Unset surface mask.
def UnsetSurfaceTransp
 Unset surface transparency.
def UnsetSurfaceEmit
 Unset surface emission.
def UnsetSurfaceAttr
 Unset surface attribute.
def SetSurfaceRes
 Set surface resolution.
def SetSurfaceStyle
 Set draw style.
def SetWireColor
 Set color of wire.
def GetSurfacePosition
 Get surface position.
def SetSurfacePosition
 Set surface position.
def SetVectorLineMode
 Set mode of vector line overlay.
def SetVectorLineHeight
 Set vector height above surface (lines)
def SetVectorLineSurface
 Set reference surface of vector set (lines)
def SetVectorPointMode
 Set mode of vector point overlay.
def SetVectorPointHeight
 Set vector height above surface (points)
def SetVectorPointSurface
 Set reference surface of vector set (points)
def AddIsosurface
 Add new isosurface.
def DeleteIsosurface
 Delete isosurface.
def MoveIsosurface
 Move isosurface up/down in the list.
def SetIsosurfaceColor
 Set isosurface color.
def SetIsosurfaceMask
 Set isosurface mask.
def SetIsosurfaceTransp
 Set isosurface transparency.
def SetIsosurfaceShine
 Set isosurface shininess.
def SetIsosurfaceEmit
 Set isosurface emission.
def SetIsosurfaceAttr
 Set isosurface attribute.
def UnsetIsosurfaceMask
 Unset isosurface mask.
def UnsetIsosurfaceTransp
 Unset isosurface transparency.
def UnsetIsosurfaceEmit
 Unset isosurface emission.
def UnsetIsosurfaceAttr
 Unset surface attribute.
def SetIsosurfaceMode
 Set draw mode for isosurfaces.
def SetIsosurfaceRes
 Set draw resolution for isosurfaces.
def SaveToFile
 Save current GL screen to ppm/tif file.
def DrawLightingModel
 Draw lighting model.
def SetFringe
 Set fringe.
def GetPointOnSurface
 Get point on surface.
def QueryMap
 Query surface map.
def GetDistanceAlongSurface
 Get distance measured along surface.

Data Fields

 data_obj
 data
 width
 height
 showLight
 log

Detailed Description

Definition at line 63 of file wxnviz.py.


Constructor & Destructor Documentation

def gui_modules.wxnviz.Nviz.__init__ (   self,
  glog,
  gprogress 
)

Initialize Nviz class instance.

Parameters:
loglogging area

Definition at line 64 of file wxnviz.py.

References G_set_error_routine(), G_set_percent_routine(), GS_libinit(), and GVL_libinit().


Member Function Documentation

def gui_modules.wxnviz.Nviz.AddIsosurface (   self,
  id,
  level 
)

Add new isosurface.

Parameters:
idvolume id
levelisosurface level (topography)
Returns:
-1 on failure
1 on success

Definition at line 853 of file wxnviz.py.

References GVL_isosurf_add(), GVL_isosurf_num_isosurfs(), GVL_isosurf_set_att_const(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.DeleteIsosurface (   self,
  id,
  isosurf_id 
)

Delete isosurface.

Parameters:
idvolume id
isosurf_idisosurface id
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 873 of file wxnviz.py.

References GVL_isosurf_del(), GVL_isosurf_num_isosurfs(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.Draw (   self,
  quick,
  quick_mode 
)
def gui_modules.wxnviz.Nviz.DrawLightingModel (   self)

Draw lighting model.

Definition at line 1167 of file wxnviz.py.

References GS_draw_lighting_model(), and gui_modules.wxnviz.Nviz.showLight.

def gui_modules.wxnviz.Nviz.GetDistanceAlongSurface (   self,
  sid,
  p1,
  p2,
  useExag = True 
)

Get distance measured along surface.

Definition at line 1223 of file wxnviz.py.

References GS_get_distance_alongsurf().

def gui_modules.wxnviz.Nviz.GetPointOnSurface (   self,
  sx,
  sy 
)

Get point on surface.

Parameters:
sx,sycanvas coordinates (LL)

Definition at line 1186 of file wxnviz.py.

References GS_get_selected_point_on_surface().

Referenced by gui_modules.wxnviz.Nviz.QueryMap().

def gui_modules.wxnviz.Nviz.GetSurfacePosition (   self,
  id 
)

Get surface position.

Parameters:
idsurface id
Returns:
x,y,z
zero-length vector on error

Definition at line 681 of file wxnviz.py.

References GS_get_trans(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.LoadSurface (   self,
  name,
  color_name,
  color_value 
)
def gui_modules.wxnviz.Nviz.LoadVolume (   self,
  name,
  color_name,
  color_value 
)
def gui_modules.wxnviz.Nviz.MoveIsosurface (   self,
  id,
  isosurf_id,
  up 
)

Move isosurface up/down in the list.

Parameters:
idvolume id
isosurf_idisosurface id
upif true move up otherwise down
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 897 of file wxnviz.py.

References GVL_isosurf_move_down(), GVL_isosurf_move_up(), GVL_isosurf_num_isosurfs(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.QueryMap (   self,
  sx,
  sy 
)

Query surface map.

Parameters:
sx,sycanvas coordinates (LL)

Definition at line 1202 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.GetPointOnSurface(), GS_get_cat_at_xy(), and GS_get_val_at_xy().

def gui_modules.wxnviz.Nviz.SaveToFile (   self,
  filename,
  width = 20,
  height = 20,
  itype = 'ppm' 
)
def gui_modules.wxnviz.Nviz.SetFringe (   self,
  sid,
  color,
  elev,
  nw = False,
  ne = False,
  sw = False,
  se = False 
)
def gui_modules.wxnviz.Nviz.SetIsosurfaceAttr (   self,
  id,
  isosurf_id,
  attr,
  map,
  value 
)

Set isosurface attribute.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
attrattribute desc
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 setting attributes failed

Definition at line 1002 of file wxnviz.py.

References GVL_isosurf_num_isosurfs(), GVL_isosurf_set_att_const(), GVL_isosurf_set_att_map(), GVL_vol_exists(), and Nviz_color_from_str().

Referenced by gui_modules.wxnviz.Nviz.SetIsosurfaceColor(), gui_modules.wxnviz.Nviz.SetIsosurfaceEmit(), gui_modules.wxnviz.Nviz.SetIsosurfaceMask(), gui_modules.wxnviz.Nviz.SetIsosurfaceShine(), and gui_modules.wxnviz.Nviz.SetIsosurfaceTransp().

def gui_modules.wxnviz.Nviz.SetIsosurfaceColor (   self,
  id,
  isosurf_id,
  map,
  value 
)

Set isosurface color.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 925 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.SetIsosurfaceEmit (   self,
  id,
  isosurf_id,
  map,
  value 
)

Set isosurface emission.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 987 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.SetIsosurfaceMask (   self,
  id,
  isosurf_id,
  invert,
  value 
)

Set isosurface mask.

Todo:
invert
Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
inverttrue for invert mask
valuemap name to be used for mask
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 940 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.SetIsosurfaceMode (   self,
  id,
  mode 
)

Set draw mode for isosurfaces.

Parameters:
mode
Returns:
1 on success
-1 volume set not found
-2 on failure

Definition at line 1108 of file wxnviz.py.

References GVL_isosurf_set_drawmode(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.SetIsosurfaceRes (   self,
  id,
  res 
)

Set draw resolution for isosurfaces.

Parameters:
resresolution value
Returns:
1 on success
-1 volume set not found
-2 on failure

Definition at line 1127 of file wxnviz.py.

References GVL_isosurf_set_drawres(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.SetIsosurfaceShine (   self,
  id,
  isosurf_id,
  map,
  value 
)

Set isosurface shininess.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 972 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.SetIsosurfaceTransp (   self,
  id,
  isosurf_id,
  map,
  value 
)

Set isosurface transparency.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 on failure

Definition at line 957 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.SetLight (   self,
  x,
  y,
  z,
  color,
  bright,
  ambient,
  w = 0,
  lid = 1 
)
def gui_modules.wxnviz.Nviz.SetSurfaceColor (   self,
  id,
  map,
  value 
)

Set surface color.

Parameters:
idsurface id
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 421 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetSurfaceEmit (   self,
  id,
  map,
  value 
)

Set surface emission.

Parameters:
idsurface id
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 477 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetSurfaceMask (   self,
  id,
  invert,
  value 
)

Set surface mask.

Todo:
invert
Parameters:
idsurface id
invertif true invert mask
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 434 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetSurfacePosition (   self,
  id,
  x,
  y,
  z 
)

Set surface position.

Parameters:
idsurface id
x,y,ztranslation values
Returns:
1 on success
-1 surface not found
-2 setting position failed

Definition at line 700 of file wxnviz.py.

References GS_set_trans(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.SetSurfaceRes (   self,
  id,
  fine,
  coarse 
)

Set surface resolution.

Parameters:
idsurface id
finex/y fine resolution
coarsex/y coarse resolution
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 582 of file wxnviz.py.

References GS_set_drawres(), GS_setall_drawres(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.SetSurfaceShine (   self,
  id,
  map,
  value 
)

Set surface shininess.

Parameters:
idsurface id
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 464 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetSurfaceStyle (   self,
  id,
  style 
)

Set draw style.

Draw styles:

  • DM_GOURAUD
  • DM_FLAT
  • DM_FRINGE
  • DM_WIRE
  • DM_COL_WIRE
  • DM_POLY
  • DM_WIRE_POLY
  • DM_GRID_WIRE
  • DM_GRID_SURF
Parameters:
idsurface id (<= 0 for all)
styledraw style
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 607 of file wxnviz.py.

References GS_set_drawmode(), GS_setall_drawmode(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.SetSurfaceTopo (   self,
  id,
  map,
  value 
)

Set surface topography.

Parameters:
idsurface id
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 408 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetSurfaceTransp (   self,
  id,
  map,
  value 
)

Set surface mask.

Todo:
invert
Parameters:
idsurface id
mapif true use map otherwise constant
valuemap name of value
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 449 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.SetSurfaceAttr().

def gui_modules.wxnviz.Nviz.SetVectorLineHeight (   self,
  id,
  height 
)

Set vector height above surface (lines)

Parameters:
idvector set id
height
Returns:
-1 vector set not found
1 on success

Definition at line 746 of file wxnviz.py.

References GV_set_trans(), and GV_vect_exists().

def gui_modules.wxnviz.Nviz.SetVectorLineMode (   self,
  id,
  color_str,
  width,
  flat 
)

Set mode of vector line overlay.

Parameters:
idvector id
color_strcolor string
widthline width
flatdisplay flat or on surface
Returns:
-1 vector set not found
-2 on failure
1 on success

Definition at line 720 of file wxnviz.py.

References GV_set_vectmode(), GV_vect_exists(), and Nviz_color_from_str().

def gui_modules.wxnviz.Nviz.SetVectorLineSurface (   self,
  id,
  surf_id 
)

Set reference surface of vector set (lines)

Parameters:
idvector set id
surf_idsurface id
Returns:
1 on success
-1 vector set not found
-2 surface not found
-3 on failure

Definition at line 765 of file wxnviz.py.

References GS_surf_exists(), GV_select_surf(), and GV_vect_exists().

def gui_modules.wxnviz.Nviz.SetVectorPointHeight (   self,
  id,
  height 
)

Set vector height above surface (points)

Parameters:
idvector set id
height
Returns:
-1 vector set not found
1 on success

Definition at line 812 of file wxnviz.py.

References GP_set_trans(), and GP_site_exists().

def gui_modules.wxnviz.Nviz.SetVectorPointMode (   self,
  id,
  color_str,
  width,
  size,
  marker 
)

Set mode of vector point overlay.

Parameters:
idvector id
color_strcolor string
widthline width
flat
Returns:
-1 vector set not found

Definition at line 787 of file wxnviz.py.

References GP_site_exists(), and Nviz_color_from_str().

def gui_modules.wxnviz.Nviz.SetVectorPointSurface (   self,
  id,
  surf_id 
)

Set reference surface of vector set (points)

Parameters:
idvector set id
surf_idsurface id
Returns:
1 on success
-1 vector set not found
-2 surface not found
-3 on failure

Definition at line 831 of file wxnviz.py.

References GP_select_surf(), GP_site_exists(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.SetView (   self,
  x,
  y,
  height,
  persp,
  twist 
)

Change view settings.

Parameters:
x,yposition
height
perspperpective
twist

Definition at line 130 of file wxnviz.py.

References Nviz_set_viewpoint_height(), Nviz_set_viewpoint_persp(), Nviz_set_viewpoint_position(), and Nviz_set_viewpoint_twist().

def gui_modules.wxnviz.Nviz.SetWireColor (   self,
  id,
  color_str 
)

Set color of wire.

Todo:
all
Parameters:
surfaceid (< 0 for all)
colorcolor string (R:G:B)
Returns:
1 on success
-1 surface not found
-2 setting attributes failed
1 on success
0 on failure

Definition at line 645 of file wxnviz.py.

References G_free(), GS_get_surf_list(), GS_set_wire_color(), GS_surf_exists(), and Nviz_color_from_str().

def gui_modules.wxnviz.Nviz.UnloadSurface (   self,
  id 
)

Unload surface.

Parameters:
idsurface id
Returns:
1 on success
0 on failure

Definition at line 269 of file wxnviz.py.

References GS_delete_surface(), and GS_surf_exists().

def gui_modules.wxnviz.Nviz.UnloadVector (   self,
  id,
  points 
)

Unload vector set.

Parameters:
idvector set id
pointsvector points or lines set
Returns:
1 on success
0 on failure

Definition at line 321 of file wxnviz.py.

References GP_delete_site(), GP_site_exists(), GV_delete_vector(), and GV_vect_exists().

def gui_modules.wxnviz.Nviz.UnloadVolume (   self,
  id 
)

Unload volume.

Parameters:
idvolume id
Returns:
1 on success
0 on failure

Definition at line 390 of file wxnviz.py.

References GVL_delete_vol(), and GVL_vol_exists().

def gui_modules.wxnviz.Nviz.UnsetIsosurfaceAttr (   self,
  id,
  isosurf_id,
  attr 
)

Unset surface attribute.

Parameters:
idsurface id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
attrattribute descriptor
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-2 on failure

Definition at line 1080 of file wxnviz.py.

References GVL_isosurf_num_isosurfs(), GVL_isosurf_unset_att(), and GVL_vol_exists().

Referenced by gui_modules.wxnviz.Nviz.UnsetIsosurfaceEmit(), gui_modules.wxnviz.Nviz.UnsetIsosurfaceMask(), and gui_modules.wxnviz.Nviz.UnsetIsosurfaceTransp().

def gui_modules.wxnviz.Nviz.UnsetIsosurfaceEmit (   self,
  id,
  isosurf_id 
)

Unset isosurface emission.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 setting attributes failed

Definition at line 1067 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.UnsetIsosurfaceMask (   self,
  id,
  isosurf_id 
)

Unset isosurface mask.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 setting attributes failed

Definition at line 1041 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.UnsetIsosurfaceTransp (   self,
  id,
  isosurf_id 
)

Unset isosurface transparency.

Parameters:
idvolume id
isosurf_idisosurface id (0 - MAX_ISOSURFS)
Returns:
1 on success
-1 volume not found
-2 isosurface not found
-3 setting attributes failed

Definition at line 1054 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetIsosurfaceAttr().

def gui_modules.wxnviz.Nviz.UnsetSurfaceAttr (   self,
  id,
  attr 
)

Unset surface attribute.

Parameters:
idsurface id
attrattribute descriptor
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 559 of file wxnviz.py.

References GS_surf_exists(), and Nviz_unset_attr().

Referenced by gui_modules.wxnviz.Nviz.UnsetSurfaceEmit(), gui_modules.wxnviz.Nviz.UnsetSurfaceMask(), and gui_modules.wxnviz.Nviz.UnsetSurfaceTransp().

def gui_modules.wxnviz.Nviz.UnsetSurfaceEmit (   self,
  id 
)

Unset surface emission.

Parameters:
idsurface id
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 548 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetSurfaceAttr().

def gui_modules.wxnviz.Nviz.UnsetSurfaceMask (   self,
  id 
)

Unset surface mask.

Parameters:
idsurface id
Returns:
1 on success
-1 surface not found
-2 setting attributes failed
-1 on failure

Definition at line 525 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetSurfaceAttr().

def gui_modules.wxnviz.Nviz.UnsetSurfaceTransp (   self,
  id 
)

Unset surface transparency.

Parameters:
idsurface id
Returns:
1 on success
-1 surface not found
-2 setting attributes failed

Definition at line 537 of file wxnviz.py.

References gui_modules.wxnviz.Nviz.UnsetSurfaceAttr().


Field Documentation

gui_modules.wxnviz.Nviz.data_obj

Definition at line 80 of file wxnviz.py.

Referenced by gui_modules.wxnviz.Nviz.__del__().

gui_modules.wxnviz.Nviz.height
gui_modules.wxnviz.Nviz.log

Definition at line 93 of file wxnviz.py.

gui_modules.wxnviz.Nviz.showLight

Definition at line 83 of file wxnviz.py.

Referenced by gui_modules.wxnviz.Nviz.DrawLightingModel().

gui_modules.wxnviz.Nviz.width

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