GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
wxnviz.Nviz Class Reference
Inheritance diagram for wxnviz.Nviz:
Collaboration diagram for wxnviz.Nviz:

Public Member Functions

def __init__
 Initialize Nviz class instance. More...
 
def __del__
 Destroy Nviz class instance. More...
 
def Init
 Initialize window. More...
 
def ResizeWindow
 GL canvas resized. More...
 
def GetLongDim
 Get longest dimension, used for initial size of north arrow. More...
 
def SetViewDefault
 Set default view (based on loaded data) More...
 
def SetView
 Change view settings. More...
 
def GetViewpointPosition
 
def LookHere
 Look here feature. More...
 
def LookAtCenter
 Center view at center of displayed surface. More...
 
def GetFocus
 Get focus. More...
 
def SetFocus
 Set focus. More...
 
def GetViewdir
 Get viewdir. More...
 
def SetViewdir
 Set viewdir. More...
 
def SetZExag
 Set z-exag value. More...
 
def Draw
 Draw canvas. More...
 
def EraseMap
 Erase map display (with background color) More...
 
def InitView
 Initialize view. More...
 
def SetBgColor
 Set background color. More...
 
def SetLight
 Change lighting settings. More...
 
def LoadSurface
 Load raster map (surface) More...
 
def AddConstant
 Add new constant surface. More...
 
def UnloadSurface
 Unload surface. More...
 
def LoadVector
 Load vector map overlay. More...
 
def UnloadVector
 Unload vector set. More...
 
def VectorSurfaceSelected
 Check if surface is selected (currently unused) More...
 
def LoadVolume
 Load 3d raster map (volume) More...
 
def UnloadVolume
 Unload volume. More...
 
def SetSurfaceTopo
 Set surface topography. More...
 
def SetSurfaceColor
 Set surface color. More...
 
def SetSurfaceMask
 Set surface mask. More...
 
def SetSurfaceTransp
 Set surface mask. More...
 
def SetSurfaceShine
 Set surface shininess. More...
 
def SetSurfaceEmit
 Set surface emission (currently unused) More...
 
def SetSurfaceAttr
 Set surface attribute. More...
 
def UnsetSurfaceMask
 Unset surface mask. More...
 
def UnsetSurfaceTransp
 Unset surface transparency. More...
 
def UnsetSurfaceEmit
 Unset surface emission (currently unused) More...
 
def UnsetSurfaceAttr
 Unset surface attribute. More...
 
def SetSurfaceRes
 Set surface resolution. More...
 
def SetSurfaceStyle
 Set draw style. More...
 
def SetWireColor
 Set color of wire. More...
 
def GetSurfacePosition
 Get surface position. More...
 
def SetSurfacePosition
 Set surface position. More...
 
def SetVectorLineMode
 Set mode of vector line overlay. More...
 
def SetVectorLineHeight
 Set vector height above surface (lines) More...
 
def SetVectorLineSurface
 Set reference surface of vector set (lines) More...
 
def UnsetVectorLineSurface
 Unset reference surface of vector set (lines) More...
 
def SetVectorPointMode
 Set mode of vector point overlay. More...
 
def SetVectorPointHeight
 Set vector height above surface (points) More...
 
def SetVectorPointSurface
 Set reference surface of vector set (points) More...
 
def ReadVectorColors
 Read vector colors. More...
 
def CheckColorTable
 Check if color table exists. More...
 
def UnsetVectorPointSurface
 Unset reference surface of vector set (points) More...
 
def SetVectorPointZMode
 Set z mode (use z coordinate or not) More...
 
def AddIsosurface
 Add new isosurface. More...
 
def AddSlice
 Add new slice. More...
 
def DeleteIsosurface
 Delete isosurface. More...
 
def DeleteSlice
 Delete slice. More...
 
def MoveIsosurface
 Move isosurface up/down in the list. More...
 
def MoveSlice
 Move slice up/down in the list. More...
 
def SetIsosurfaceTopo
 Set isosurface level. More...
 
def SetIsosurfaceColor
 Set isosurface color. More...
 
def SetIsosurfaceMask
 Set isosurface mask. More...
 
def SetIsosurfaceTransp
 Set isosurface transparency. More...
 
def SetIsosurfaceShine
 Set isosurface shininess. More...
 
def SetIsosurfaceEmit
 Set isosurface emission (currently unused) More...
 
def SetIsosurfaceAttr
 Set isosurface attribute. More...
 
def UnsetIsosurfaceMask
 Unset isosurface mask. More...
 
def UnsetIsosurfaceTransp
 Unset isosurface transparency. More...
 
def UnsetIsosurfaceEmit
 Unset isosurface emission (currently unused) More...
 
def UnsetIsosurfaceAttr
 Unset surface attribute. More...
 
def SetIsosurfaceMode
 Set draw mode for isosurfaces. More...
 
def SetSliceMode
 Set draw mode for slices. More...
 
def SetIsosurfaceRes
 Set draw resolution for isosurfaces. More...
 
def SetSliceRes
 Set draw resolution for slices. More...
 
def SetSlicePosition
 Set slice position. More...
 
def SetSliceTransp
 Set slice transparency. More...
 
def SetIsosurfaceInOut
 Set inout mode. More...
 
def GetVolumePosition
 Get volume position. More...
 
def SetVolumePosition
 Set volume position. More...
 
def GetCPlaneCurrent
 
def GetCPlanesCount
 Returns number of cutting planes. More...
 
def GetCPlaneRotation
 Returns rotation parameters of current cutting plane. More...
 
def GetCPlaneTranslation
 Returns translation parameters of current cutting plane. More...
 
def SetCPlaneRotation
 Set current clip plane rotation. More...
 
def SetCPlaneTranslation
 Set current clip plane translation. More...
 
def SetCPlaneInteractively
 
def SelectCPlane
 Select cutting plane. More...
 
def UnselectCPlane
 Unselect cutting plane. More...
 
def SetFenceColor
 Select current cutting plane. More...
 
def GetXYRange
 Get xy range. More...
 
def GetZRange
 Get z range. More...
 
def SaveToFile
 Save current GL screen to ppm/tif file. More...
 
def DrawLightingModel
 Draw lighting model. More...
 
def DrawFringe
 Draw fringe. More...
 
def SetFringe
 Set fringe. More...
 
def DrawArrow
 Draw north arrow. More...
 
def SetArrow
 Set north arrow from canvas coordinates. More...
 
def DeleteArrow
 Delete north arrow. More...
 
def SetScalebar
 Set scale bar from canvas coordinates. More...
 
def DrawScalebar
 Draw scale bar. More...
 
def DeleteScalebar
 Delete scalebar. More...
 
def GetPointOnSurface
 Get point on surface. More...
 
def QueryMap
 Query surface map. More...
 
def GetDistanceAlongSurface
 Get distance measured along surface. More...
 
def GetRotationParameters
 Get rotation parameters (angle, x, y, z axes) More...
 
def Rotate
 Set rotation parameters Rotate scene (difference from current state). More...
 
def UnsetRotation
 Stop rotating the scene. More...
 
def ResetRotation
 Reset scene rotation. More...
 
def GetRotationMatrix
 Get rotation matrix. More...
 
def SetRotationMatrix
 Set rotation matrix. More...
 
def Start2D
 
def FlyThrough
 Fly through the scene. More...
 

Data Fields

 data_obj
 
 data
 
 color_obj
 
 color
 
 width
 
 height
 
 showLight
 
 log
 

Detailed Description

Definition at line 82 of file wxnviz.py.

Constructor & Destructor Documentation

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

Initialize Nviz class instance.

Parameters
loglogging area
gprogressprogressbar

Definition at line 83 of file wxnviz.py.

References G_set_error_routine(), G_set_percent_routine(), wxnviz.Nviz.Init(), gselect.TreeCtrlComboPopup.Init(), and preferences.PropertiesDialog.Init().

Member Function Documentation

def wxnviz.Nviz.AddIsosurface (   self,
  id,
  level,
  isosurf_id = None 
)

Add new isosurface.

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

Definition at line 1067 of file wxnviz.py.

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

def wxnviz.Nviz.AddSlice (   self,
  id,
  slice_id = None 
)

Add new slice.

Parameters
idvolume id
Returns
-1 on failure
number of slices

Definition at line 1092 of file wxnviz.py.

References GVL_slice_add(), GVL_slice_num_slices(), and GVL_vol_exists().

def wxnviz.Nviz.CheckColorTable (   self,
  id,
  type 
)

Check if color table exists.

Parameters
idvector set id
typevector set type (lines/points)
Returns
1 color table exists
0 no color table found
-1 on error
-2 vector set not found

Definition at line 1007 of file wxnviz.py.

References GP_get_sitename(), GV_get_vectname(), and wxnviz.Nviz.ReadVectorColors().

def 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 1113 of file wxnviz.py.

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

def wxnviz.Nviz.DeleteScalebar (   self,
  id 
)
def wxnviz.Nviz.DeleteSlice (   self,
  id,
  slice_id 
)

Delete slice.

Parameters
idvolume id
slice_idslice id
Returns
1 on success
-1 volume not found
-2 slice not found
-3 on failure

Definition at line 1137 of file wxnviz.py.

References GVL_slice_del(), GVL_slice_num_slices(), and GVL_vol_exists().

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

Draw canvas.

Draw quick mode:

  • DRAW_QUICK_SURFACE
  • DRAW_QUICK_VLINES
  • DRAW_QUICK_VPOINTS
  • DRAW_QUICK_VOLUME
Parameters
quickif true draw in wiremode
quick_modequick mode

Definition at line 246 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_draw_all(), Nviz_draw_cplane(), and Nviz_draw_quick().

Referenced by frame.PsMapBufferedWindow.DrawGraphics(), frame.PsMapBufferedWindow.OnDragging(), frame.PsMapBufferedWindow.OnLeftUp(), wxnviz.Nviz.SaveToFile(), and frame.PsMapBufferedWindow.Zoom().

def wxnviz.Nviz.EraseMap (   self)
def wxnviz.Nviz.FlyThrough (   self,
  flyInfo,
  mode,
  exagInfo 
)

Fly through the scene.

Parameters
flyInfofly parameters
mode0 or 1 for different fly behaviour
exagInfoparameters changing fly speed

Definition at line 1881 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, and Nviz_flythrough().

def wxnviz.Nviz.GetCPlaneRotation (   self)
def wxnviz.Nviz.GetCPlanesCount (   self)
def wxnviz.Nviz.GetCPlaneTranslation (   self)
def wxnviz.Nviz.GetDistanceAlongSurface (   self,
  sid,
  p1,
  p2,
  useExag = True 
)

Get distance measured along surface.

Definition at line 1812 of file wxnviz.py.

References GS_get_distance_alongsurf().

def wxnviz.Nviz.GetLongDim (   self)

Get longest dimension, used for initial size of north arrow.

Definition at line 142 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, and Nviz_get_longdim().

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

Get point on surface.

Parameters
sx,sycanvas coordinates (LL)

Definition at line 1775 of file wxnviz.py.

References GS_get_selected_point_on_surface().

Referenced by wxnviz.Nviz.QueryMap().

def wxnviz.Nviz.GetRotationMatrix (   self)

Get rotation matrix.

Definition at line 1862 of file wxnviz.py.

References GS_get_rotation_matrix().

def wxnviz.Nviz.GetRotationParameters (   self,
  dx,
  dy 
)

Get rotation parameters (angle, x, y, z axes)

Parameters
dx,dydifference from previous mouse drag event

Definition at line 1821 of file wxnviz.py.

References Nviz_get_modelview(), wxnviz.Nviz.width, render.Map.width, colorrules.ColorTable.width, model.ModelCondition.width, and dialogs.ImageSizeDialog.width.

def wxnviz.Nviz.GetSurfacePosition (   self,
  id 
)

Get surface position.

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

Definition at line 798 of file wxnviz.py.

References GS_get_trans(), and GS_surf_exists().

def wxnviz.Nviz.GetViewdir (   self)

Get viewdir.

Definition at line 220 of file wxnviz.py.

References GS_get_viewdir().

def wxnviz.Nviz.GetViewpointPosition (   self)

Definition at line 181 of file wxnviz.py.

References Nviz_get_viewpoint_height(), and Nviz_get_viewpoint_position().

def wxnviz.Nviz.GetVolumePosition (   self,
  id 
)

Get volume position.

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

Definition at line 1567 of file wxnviz.py.

References GVL_get_trans(), and GVL_vol_exists().

def wxnviz.Nviz.Init (   self)

Initialize window.

Definition at line 118 of file wxnviz.py.

References GS_libinit(), and GVL_libinit().

Referenced by wxnviz.Nviz.__init__().

def wxnviz.Nviz.LoadSurface (   self,
  name,
  color_name,
  color_value 
)

Load raster map (surface)

Parameters
nameraster map name
color_nameraster map for color (None for color_value)
color_valuecolor string (named color or RGB triptet)
Returns
object id
-1 on failure

Definition at line 309 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, G_find_cell2(), G_fully_qualified_name(), G_warning(), GS_delete_surface(), Nviz_color_from_str(), Nviz_new_map_obj(), Nviz_set_attr(), and Nviz_set_focus_map().

def wxnviz.Nviz.LoadVector (   self,
  name,
  points 
)

Load vector map overlay.

Parameters
namevector map name
pointsif true load 2d points rather then 2d lines
Returns
object id, id of base surface (or -1 if it is not loaded)
-1 on failure

Definition at line 390 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, G_fully_qualified_name(), G_warning(), GS_get_surf_list(), GS_num_surfs(), GS_set_att_const(), and Nviz_new_map_obj().

def wxnviz.Nviz.LoadVolume (   self,
  name,
  color_name,
  color_value 
)

Load 3d raster map (volume)

Parameters
name3d raster map name
color_name3d raster map for color (None for color_value)
color_valuecolor string (named color or RGB triptet)
Returns
object id
-1 on failure

Definition at line 462 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, G_find_grid3(), G_fully_qualified_name(), G_warning(), GVL_delete_vol(), Nviz_color_from_str(), Nviz_new_map_obj(), and Nviz_set_attr().

def wxnviz.Nviz.LookAtCenter (   self)

Center view at center of displayed surface.

Definition at line 198 of file wxnviz.py.

References Nviz_set_focus_map().

def wxnviz.Nviz.LookHere (   self,
  x,
  y 
)

Look here feature.

Parameters
x,yscreen coordinates

Definition at line 190 of file wxnviz.py.

References Nviz_look_here().

def 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 1161 of file wxnviz.py.

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

def wxnviz.Nviz.MoveSlice (   self,
  id,
  slice_id,
  up 
)

Move slice up/down in the list.

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

Definition at line 1189 of file wxnviz.py.

References GVL_slice_move_down(), GVL_slice_move_up(), GVL_slice_num_slices(), and GVL_vol_exists().

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

Query surface map.

Parameters
sx,sycanvas coordinates (LL)

Definition at line 1791 of file wxnviz.py.

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

def wxnviz.Nviz.ReadVectorColors (   self,
  name,
  mapset 
)

Read vector colors.

Parameters
namevector map name mapset name ("" for search path)
Returns
-1 on error
0 if color table missing
1 on success (color table found)

Definition at line 995 of file wxnviz.py.

References wxnviz.Nviz.color.

Referenced by wxnviz.Nviz.CheckColorTable().

def wxnviz.Nviz.ResetRotation (   self)

Reset scene rotation.

Definition at line 1858 of file wxnviz.py.

References Nviz_init_rotation().

def wxnviz.Nviz.ResizeWindow (   self,
  width,
  height 
)
def wxnviz.Nviz.Rotate (   self,
  angle,
  x,
  y,
  z 
)

Set rotation parameters Rotate scene (difference from current state).

Parameters
angleangle
x,y,zaxis coordinate

Definition at line 1845 of file wxnviz.py.

References Nviz_set_rotation().

def wxnviz.Nviz.SelectCPlane (   self,
  index 
)

Select cutting plane.

Parameters
indexindex of cutting plane

Definition at line 1662 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, and Nviz_on_cplane().

def wxnviz.Nviz.SetArrow (   self,
  sx,
  sy,
  size,
  color 
)

Set north arrow from canvas coordinates.

Parameters
sx,sycanvas coordinates
sizearrow length
colorarrow color

Definition at line 1741 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_color_from_str(), and Nviz_set_arrow().

def wxnviz.Nviz.SetBgColor (   self,
  color_str 
)
def wxnviz.Nviz.SetCPlaneRotation (   self,
  x,
  y,
  z 
)
def wxnviz.Nviz.SetCPlaneTranslation (   self,
  x,
  y,
  z 
)
def wxnviz.Nviz.SetFenceColor (   self,
  index 
)

Select current cutting plane.

Parameters
indextype of fence - from 0 (off) to 4

Definition at line 1676 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, and Nviz_set_fence_color().

def wxnviz.Nviz.SetFringe (   self,
  sid,
  color,
  elev,
  nw = False,
  ne = False,
  sw = False,
  se = False 
)

Set fringe.

Parameters
sidsurface id
colorcolor
elevelevation (height)
nw,ne,sw,sefringe edges (turn on/off)

Definition at line 1723 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_color_from_str(), and Nviz_set_fringe().

def 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 1309 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 wxnviz.Nviz.SetIsosurfaceColor(), wxnviz.Nviz.SetIsosurfaceEmit(), wxnviz.Nviz.SetIsosurfaceMask(), wxnviz.Nviz.SetIsosurfaceShine(), wxnviz.Nviz.SetIsosurfaceTopo(), and wxnviz.Nviz.SetIsosurfaceTransp().

def 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 1232 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

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

Set isosurface emission (currently unused)

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 1294 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

def wxnviz.Nviz.SetIsosurfaceInOut (   self,
  id,
  isosurf_id,
  inout 
)

Set inout mode.

Parameters
inoutmode true/false
Returns
1 on success
-1 volume set not found
-2 isosurface not found
-3 on failure

Definition at line 1544 of file wxnviz.py.

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

def 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 1247 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

def 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 1415 of file wxnviz.py.

References GVL_isosurf_set_drawmode(), and GVL_vol_exists().

def 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 1453 of file wxnviz.py.

References GVL_isosurf_set_drawres(), and GVL_vol_exists().

def 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 1279 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

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

Set isosurface level.

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 1217 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

def 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 1264 of file wxnviz.py.

References wxnviz.Nviz.SetIsosurfaceAttr().

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

Change lighting settings.

Parameters
x,y,zposition
colorlight color (as string)
brightlight brightness
ambientlight ambient
wlocal coordinate (default to 0)

Definition at line 296 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_set_light_ambient(), Nviz_set_light_bright(), Nviz_set_light_color(), and Nviz_set_light_position().

def wxnviz.Nviz.SetRotationMatrix (   self,
  matrix 
)

Set rotation matrix.

Definition at line 1871 of file wxnviz.py.

References GS_set_rotation_matrix(), and tools.range.

def wxnviz.Nviz.SetScalebar (   self,
  id,
  sx,
  sy,
  size,
  color 
)

Set scale bar from canvas coordinates.

Parameters
sx,sycanvas coordinates
idscale bar id
sizescale bar length
colorscale bar color

Definition at line 1755 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_color_from_str(), and Nviz_set_scalebar().

def wxnviz.Nviz.SetSliceMode (   self,
  id,
  mode 
)

Set draw mode for slices.

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

Definition at line 1434 of file wxnviz.py.

References GVL_slice_set_drawmode(), and GVL_vol_exists().

def wxnviz.Nviz.SetSlicePosition (   self,
  id,
  slice_id,
  x1,
  x2,
  y1,
  y2,
  z1,
  z2,
  dir 
)

Set slice position.

Parameters
idvolume id
slice_idslice id
x1,x2,y1,y2,z1,z2slice coordinates
diraxis
Returns
1 on success
-1 volume not found
-2 slice not found
-3 on failure

Definition at line 1491 of file wxnviz.py.

References GVL_slice_num_slices(), GVL_slice_set_pos(), and GVL_vol_exists().

def wxnviz.Nviz.SetSliceRes (   self,
  id,
  res 
)

Set draw resolution for slices.

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

Definition at line 1472 of file wxnviz.py.

References GVL_slice_set_drawres(), and GVL_vol_exists().

def wxnviz.Nviz.SetSliceTransp (   self,
  id,
  slice_id,
  value 
)

Set slice transparency.

Parameters
idvolume id
slice_idslice id
x1,x2,y1,y2,z1,z2slice coordinates
valuetransparency value (0 - 255)
Returns
1 on success
-1 volume not found
-2 slice not found
-3 on failure

Definition at line 1517 of file wxnviz.py.

References GVL_slice_num_slices(), GVL_slice_set_transp(), and GVL_vol_exists().

def wxnviz.Nviz.SetSurfaceAttr (   self,
  id,
  attr,
  map,
  value 
)

Set surface attribute.

Parameters
idsurface id
attrattribute desc
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 607 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, GS_surf_exists(), Nviz_color_from_str(), and Nviz_set_attr().

Referenced by wxnviz.Nviz.SetSurfaceColor(), wxnviz.Nviz.SetSurfaceEmit(), wxnviz.Nviz.SetSurfaceMask(), wxnviz.Nviz.SetSurfaceShine(), wxnviz.Nviz.SetSurfaceTopo(), and wxnviz.Nviz.SetSurfaceTransp().

def wxnviz.Nviz.SetSurfaceColor (   self,
  id,
  map,
  value 
)

Set surface color.

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

Definition at line 538 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

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

Set surface emission (currently unused)

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 594 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

def 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 551 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

def 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 817 of file wxnviz.py.

References GS_set_trans(), and GS_surf_exists().

def 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 699 of file wxnviz.py.

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

def 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 581 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

def 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 724 of file wxnviz.py.

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

def 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 525 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

def 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 566 of file wxnviz.py.

References wxnviz.Nviz.SetSurfaceAttr().

def 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 863 of file wxnviz.py.

References GV_set_trans(), and GV_vect_exists().

def 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 837 of file wxnviz.py.

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

def 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 882 of file wxnviz.py.

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

def 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 954 of file wxnviz.py.

References GP_set_trans(), and GP_site_exists().

def 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 926 of file wxnviz.py.

References GP_set_sitemode(), GP_site_exists(), and Nviz_color_from_str().

def 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 973 of file wxnviz.py.

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

def wxnviz.Nviz.SetVectorPointZMode (   self,
  id,
  zMode 
)

Set z mode (use z coordinate or not)

Parameters
idvolume id
zModebool
Returns
-1 on failure
0 when no 3d
1 on success

Definition at line 1052 of file wxnviz.py.

References GP_set_zmode(), and GP_site_exists().

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

Change view settings.

Parameters
x,yposition
height
perspperpective
twist

Definition at line 166 of file wxnviz.py.

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

def wxnviz.Nviz.SetViewDefault (   self)

Set default view (based on loaded data)

Returns
z-exag value, default, min and max height

Definition at line 146 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, Nviz_change_exag(), Nviz_get_exag(), and Nviz_get_exag_height().

def wxnviz.Nviz.SetViewdir (   self,
  x,
  y,
  z 
)

Set viewdir.

Definition at line 228 of file wxnviz.py.

References GS_set_viewdir().

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

Set volume position.

Parameters
idvolume id
x,y,ztranslation values
Returns
1 on success
-1 volume not found
-2 setting position failed

Definition at line 1586 of file wxnviz.py.

References GVL_set_trans(), and GVL_vol_exists().

def 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 762 of file wxnviz.py.

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

def wxnviz.Nviz.SetZExag (   self,
  z_exag 
)
def wxnviz.Nviz.UnloadSurface (   self,
  id 
)

Unload surface.

Parameters
idsurface id
Returns
1 on success
0 on failure

Definition at line 372 of file wxnviz.py.

References GS_delete_surface(), and GS_surf_exists().

def 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 425 of file wxnviz.py.

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

def wxnviz.Nviz.UnloadVolume (   self,
  id 
)

Unload volume.

Parameters
idvolume id
Returns
1 on success
0 on failure

Definition at line 507 of file wxnviz.py.

References GVL_delete_vol(), and GVL_vol_exists().

def wxnviz.Nviz.UnselectCPlane (   self,
  index 
)

Unselect cutting plane.

Parameters
indexindex of cutting plane

Definition at line 1669 of file wxnviz.py.

References wxnviz.Nviz.data, forms.UpdateThread.data, model.ModelAction.data, model.ProcessModelFile.data, tools.ViewPositionWindow.data, tools.LightPositionWindow.data, and Nviz_off_cplane().

def 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 1387 of file wxnviz.py.

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

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

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

Unset isosurface emission (currently unused)

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 1374 of file wxnviz.py.

References wxnviz.Nviz.UnsetIsosurfaceAttr().

def 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 1348 of file wxnviz.py.

References wxnviz.Nviz.UnsetIsosurfaceAttr().

def 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 1361 of file wxnviz.py.

References wxnviz.Nviz.UnsetIsosurfaceAttr().

def wxnviz.Nviz.UnsetRotation (   self)

Stop rotating the scene.

Definition at line 1854 of file wxnviz.py.

References Nviz_unset_rotation().

def 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 676 of file wxnviz.py.

References GS_surf_exists(), and Nviz_unset_attr().

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

def wxnviz.Nviz.UnsetSurfaceEmit (   self,
  id 
)

Unset surface emission (currently unused)

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

Definition at line 665 of file wxnviz.py.

References wxnviz.Nviz.UnsetSurfaceAttr().

def 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 642 of file wxnviz.py.

References wxnviz.Nviz.UnsetSurfaceAttr().

def 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 654 of file wxnviz.py.

References wxnviz.Nviz.UnsetSurfaceAttr().

def wxnviz.Nviz.UnsetVectorLineSurface (   self,
  id,
  surf_id 
)

Unset 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 904 of file wxnviz.py.

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

def wxnviz.Nviz.UnsetVectorPointSurface (   self,
  id,
  surf_id 
)

Unset 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 1030 of file wxnviz.py.

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

def wxnviz.Nviz.VectorSurfaceSelected (   self,
  vid,
  sid 
)

Check if surface is selected (currently unused)

Parameters
vidvector id
sidsurface id
Returns
True if selected
False if not selected

Definition at line 449 of file wxnviz.py.

References GV_surf_is_selected().

Field Documentation

wxnviz.Nviz.color

Definition at line 103 of file wxnviz.py.

Referenced by wxnviz.Nviz.ReadVectorColors().

wxnviz.Nviz.color_obj

Definition at line 102 of file wxnviz.py.

wxnviz.Nviz.data_obj

Definition at line 100 of file wxnviz.py.

Referenced by wxnviz.Nviz.__del__().

wxnviz.Nviz.log

Definition at line 116 of file wxnviz.py.

Referenced by toolbars.VDigitToolbar.OnSelectMap().

wxnviz.Nviz.showLight

Definition at line 106 of file wxnviz.py.

Referenced by wxnviz.Nviz.DrawLightingModel().


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