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

Public Member Functions

def __init__
 Base class for vector digitizer (ctypes interface)
def __del__
def CloseBackgroundMap
 Close background vector map.
def OpenBackgroundMap
 Open background vector map.
def AddFeature
 Add new feature.
def DeleteSelectedLines
 Delete selected features.
def MoveSelectedLines
 Move selected features.
def MoveSelectedVertex
 Move selected vertex of the line.
def AddVertex
 Add new vertex to the selected line/boundary on position 'coords'.
def RemoveVertex
 Remove vertex from the selected line/boundary on position 'coords'.
def SplitLine
 Split/break selected line/boundary on given position.
def EditLine
 Edit existing line/boundary.
def FlipLine
 Flip selected lines/boundaries.
def MergeLine
 Merge selected lines/boundaries.
def BreakLine
 Break selected lines/boundaries.
def SnapLine
 Snap selected lines/boundaries.
def ConnectLine
 Connect selected lines/boundaries.
def CopyLine
 Copy features from (background) vector map.
def CopyCats
 Copy given categories to objects with id listed in ids.
def SelectLinesByQuery
 Select features by query.
def IsVector3D
 Check if open vector map is 3D.
def GetLineLength
 Get line length.
def GetAreaSize
 Get area size.
def GetAreaPerimeter
 Get area perimeter.
def SetLineCats
 Set categories for given line and layer.
def TypeConvForSelectedLines
 Feature type conversion for selected objects.
def Undo
 Undo action.
def ZBulkLines
 Z-bulk labeling.
def GetDisplay
 Get display driver instance.
def OpenMap
 Open vector map for editing.
def CloseMap
 Close currently open vector map.
def InitCats
 Initialize categories information.
def GetLineCats
 Get list of layer/category(ies) for selected feature.
def GetLayers
 Get list of layers.
def UpdateSettings
 Update digit (and display) settings.
def SetCategory
 Update self.cats based on settings.
def SelectLinesFromBackgroundMap
 Select features from background map.
def GetUndoLevel
 Get undo level (number of active changesets)

Data Fields

 poMapInfo
 mapWindow
 bgMapInfo
 poBgMapInfo
 popoBgMapInfo
 toolbar
 poPoints
 poCats
 cats
 changesets
 changesetCurrent
 changesetEnd

Detailed Description

Definition at line 115 of file wxvdigit.py.


Constructor & Destructor Documentation

def gui_modules.wxvdigit.IVDigit.__init__ (   self,
  mapwindow 
)

Base class for vector digitizer (ctypes interface)

mapwindow reference for map window (BufferedWindow)

Definition at line 116 of file wxvdigit.py.


Member Function Documentation

def gui_modules.wxvdigit.IVDigit.AddFeature (   self,
  ftype,
  points 
)

Add new feature.

Parameters:
ftypefeature type (point, line, centroid, boundary)
pointstuple of points ((x, y), (x, y), ...)
Returns:
tuple (number of added features, feature ids)

Definition at line 429 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._addFeature(), gui_modules.wxvdigit.IVDigit._getSnapMode(), gui_modules.nviz_tools.NvizToolWindow.mapWindow, gui_modules.wxvdigit.IVDigit.mapWindow, gui_modules.nviz_tools.PositionWindow.mapWindow, and gui_modules.wxvdigit.IVDigit.SetCategory().

def gui_modules.wxvdigit.IVDigit.AddVertex (   self,
  coords 
)

Add new vertex to the selected line/boundary on position 'coords'.

Parameters:
coordscoordinates to add vertex
Returns:
id of new feature
0 nothing changed
-1 on failure

Definition at line 643 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._ModifyLineVertex().

def gui_modules.wxvdigit.IVDigit.BreakLine (   self)
def gui_modules.wxvdigit.IVDigit.CloseBackgroundMap (   self)

Close background vector map.

Definition at line 179 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit.poBgMapInfo, gui_modules.wxvdigit.IVDigit.popoBgMapInfo, and Vect_close().

def gui_modules.wxvdigit.IVDigit.CloseMap (   self)

Close currently open vector map.

Definition at line 1403 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._checkMap().

Referenced by gui_modules.wxvdriver.DisplayDriver.__del__().

def gui_modules.wxvdigit.IVDigit.ConnectLine (   self)
def gui_modules.wxvdigit.IVDigit.FlipLine (   self)
def gui_modules.wxvdigit.IVDigit.GetAreaPerimeter (   self,
  centroid 
)
def gui_modules.wxvdigit.IVDigit.GetAreaSize (   self,
  centroid 
)

Get area size.

Parameters:
centroidcentroid id
Returns:
area size
-1 on error

Definition at line 1160 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.poMapInfo, Vect_area_alive(), Vect_get_area_area(), Vect_get_centroid_area(), and Vect_read_line().

def gui_modules.wxvdigit.IVDigit.GetDisplay (   self)
def gui_modules.wxvdigit.IVDigit.GetLayers (   self)

Get list of layers.

Requires self.InitCats() to be called.

Returns:
list of layers

Definition at line 1674 of file wxvdigit.py.

def gui_modules.wxvdigit.IVDigit.GetLineCats (   self,
  line 
)

Get list of layer/category(ies) for selected feature.

Parameters:
linefeature id (-1 for first selected feature)
Returns:
list of layer/cats

Definition at line 1640 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.poCats, gui_modules.wxvdigit.IVDigit.poMapInfo, Vect_line_alive(), and Vect_read_line().

def gui_modules.wxvdigit.IVDigit.GetLineLength (   self,
  line 
)

Get line length.

Parameters:
linefeature id
Returns:
line length
-1 on error

Definition at line 1135 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.poMapInfo, gui_modules.wxvdigit.IVDigit.poPoints, Vect_line_alive(), Vect_line_length(), and Vect_read_line().

def gui_modules.wxvdigit.IVDigit.GetUndoLevel (   self)

Get undo level (number of active changesets)

Note: Changesets starts wiht 0

Definition at line 1734 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit.changesetCurrent.

def gui_modules.wxvdigit.IVDigit.InitCats (   self)
def gui_modules.wxvdigit.IVDigit.IsVector3D (   self)

Check if open vector map is 3D.

Definition at line 1127 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.poMapInfo, and Vect_is_3d().

def gui_modules.wxvdigit.IVDigit.MergeLine (   self)
def gui_modules.wxvdigit.IVDigit.OpenMap (   self,
  name 
)

Open vector map for editing.

Parameters:
mapname of vector map to be set up

Definition at line 1387 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit.InitCats(), and gui_modules.wxvdigit.IVDigit.poMapInfo.

def gui_modules.wxvdigit.IVDigit.RemoveVertex (   self,
  coords 
)

Remove vertex from the selected line/boundary on position 'coords'.

Parameters:
coordscoordinates to remove vertex
Returns:
id of new feature
0 nothing changed
-1 on failure

Definition at line 659 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._ModifyLineVertex().

def gui_modules.wxvdigit.IVDigit.SelectLinesByQuery (   self,
  bbox 
)
def gui_modules.wxvdigit.IVDigit.SelectLinesFromBackgroundMap (   self,
  bbox 
)

Select features from background map.

Parameters:
bboxbounding box definition
Returns:
list of selected feature ids

Definition at line 1721 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit.poBgMapInfo.

def gui_modules.wxvdigit.IVDigit.SetLineCats (   self,
  line,
  layer,
  cats,
  add = True 
)

Set categories for given line and layer.

Parameters:
linefeature id
layerlayer number (-1 for first selected line)
catslist of categories
addif True to add, otherwise do delete categories
Returns:
new feature id (feature need to be rewritten)
-1 on error

Definition at line 1219 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._addActionsAfter(), gui_modules.wxvdigit.IVDigit._addActionsBefore(), gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.poCats, gui_modules.wxvdigit.IVDigit.poMapInfo, gui_modules.wxvdigit.IVDigit.poPoints, Vect_cat_set(), Vect_field_cat_del(), Vect_get_num_lines(), Vect_line_alive(), Vect_read_line(), and Vect_rewrite_line().

def gui_modules.wxvdigit.IVDigit.SplitLine (   self,
  point 
)
def gui_modules.wxvdigit.IVDigit.TypeConvForSelectedLines (   self)

Feature type conversion for selected objects.

Supported conversions:

  • point <-> centroid
  • line <-> boundary
Returns:
number of modified features
-1 on error

Definition at line 1270 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._addActionsAfter(), gui_modules.wxvdigit.IVDigit._addActionsBefore(), gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.changesets, gui_modules.wxvdigit.IVDigit.poMapInfo, Vect_destroy_list(), Vect_get_num_lines(), and Vedit_chtype_lines().

def gui_modules.wxvdigit.IVDigit.Undo (   self,
  level = -1 
)

Undo action.

Parameters:
levellevels to undo (0 to revert all)
Returns:
id of current changeset

Definition at line 1300 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._applyChangeset(), gui_modules.wxvdigit.IVDigit.changesetCurrent, and gui_modules.wxvdigit.IVDigit.changesetEnd.

def gui_modules.wxvdigit.IVDigit.UpdateSettings (   self)

Update digit (and display) settings.

Definition at line 1683 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._settings, and gui_modules.gselect.GdalSelect._settings.

def gui_modules.wxvdigit.IVDigit.ZBulkLines (   self,
  pos1,
  pos2,
  start,
  step 
)

Z-bulk labeling.

Parameters:
pos1reference line (start point)
pos1reference line (end point)
startstarting value
stepstep value
Returns:
number of modified lines
-1 on error

Definition at line 1350 of file wxvdigit.py.

References gui_modules.wxvdigit.IVDigit._addActionsAfter(), gui_modules.wxvdigit.IVDigit._addActionsBefore(), gui_modules.wxvdigit.IVDigit._checkMap(), gui_modules.wxvdigit.IVDigit.changesets, gui_modules.wxvdigit.IVDigit.poMapInfo, Vect_destroy_list(), Vect_get_num_lines(), and Vedit_bulk_labeling().


Field Documentation

gui_modules.wxvdigit.IVDigit.bgMapInfo
gui_modules.wxvdigit.IVDigit.changesetCurrent
gui_modules.wxvdigit.IVDigit.changesetEnd
gui_modules.wxvdigit.IVDigit.mapWindow

Definition at line 122 of file wxvdigit.py.

Referenced by gui_modules.wxvdigit.IVDigit.AddFeature().

gui_modules.wxvdigit.IVDigit.poMapInfo

Definition at line 121 of file wxvdigit.py.

Referenced by gui_modules.wxvdriver.DisplayDriver.__del__(), gui_modules.wxvdigit.IVDigit.BreakLine(), gui_modules.wxvdriver.DisplayDriver.CloseMap(), gui_modules.wxvdigit.IVDigit.ConnectLine(), gui_modules.wxvdigit.IVDigit.CopyCats(), gui_modules.wxvdigit.IVDigit.CopyLine(), gui_modules.wxvdigit.IVDigit.DeleteSelectedLines(), gui_modules.wxvdriver.DisplayDriver.DrawMap(), gui_modules.wxvdigit.IVDigit.EditLine(), gui_modules.wxvdigit.IVDigit.FlipLine(), gui_modules.wxvdigit.IVDigit.GetAreaPerimeter(), gui_modules.wxvdigit.IVDigit.GetAreaSize(), gui_modules.wxvdriver.DisplayDriver.GetDuplicates(), gui_modules.wxvdigit.IVDigit.GetLineCats(), gui_modules.wxvdigit.IVDigit.GetLineLength(), gui_modules.wxvdriver.DisplayDriver.GetMapBoundingBox(), gui_modules.wxvdriver.DisplayDriver.GetSelected(), gui_modules.wxvdriver.DisplayDriver.GetSelectedVertex(), gui_modules.wxvdigit.IVDigit.InitCats(), gui_modules.wxvdigit.IVDigit.IsVector3D(), gui_modules.wxvdigit.IVDigit.MergeLine(), gui_modules.wxvdigit.IVDigit.MoveSelectedLines(), gui_modules.wxvdigit.IVDigit.MoveSelectedVertex(), gui_modules.wxvdigit.IVDigit.OpenBackgroundMap(), gui_modules.wxvdriver.DisplayDriver.OpenMap(), gui_modules.wxvdigit.IVDigit.OpenMap(), gui_modules.wxvdriver.DisplayDriver.SelectLineByPoint(), gui_modules.wxvdriver.DisplayDriver.SelectLinesByBox(), gui_modules.wxvdigit.IVDigit.SelectLinesByQuery(), gui_modules.wxvdigit.IVDigit.SetLineCats(), gui_modules.wxvdigit.IVDigit.SnapLine(), gui_modules.wxvdigit.IVDigit.SplitLine(), gui_modules.wxvdigit.IVDigit.TypeConvForSelectedLines(), and gui_modules.wxvdigit.IVDigit.ZBulkLines().

gui_modules.wxvdigit.IVDigit.toolbar

Definition at line 136 of file wxvdigit.py.

Referenced by gui_modules.mapdisp_window.BufferedWindow.OnDragging().


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