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

Public Member Functions

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

Data Fields

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

Detailed Description

Definition at line 126 of file wxdigit.py.

Constructor & Destructor Documentation

def wxdigit.IVDigit.__init__ (   self,
  mapwindow 
)

Base class for vector digitizer (ctypes interface)

mapwindow reference for map window (BufferedWindow)

Definition at line 127 of file wxdigit.py.

Member Function Documentation

def wxdigit.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 440 of file wxdigit.py.

References wxdigit.IVDigit._addFeature(), wxdigit.IVDigit._getSnapMode(), animation.Animation.mapWindow, tools.NvizToolWindow.mapWindow, wxdigit.IVDigit.mapWindow, tools.PositionWindow.mapWindow, and wxdigit.IVDigit.SetCategory().

def wxdigit.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 651 of file wxdigit.py.

References wxdigit.IVDigit._ModifyLineVertex().

def wxdigit.IVDigit.BreakLine (   self)
def wxdigit.IVDigit.CloseBackgroundMap (   self)

Close background vector map.

Definition at line 190 of file wxdigit.py.

References wxdigit.IVDigit.poBgMapInfo, wxdigit.IVDigit.popoBgMapInfo, and Vect_close().

def wxdigit.IVDigit.CloseMap (   self)

Close currently open vector map.

Definition at line 1411 of file wxdigit.py.

References wxdigit.IVDigit._checkMap().

Referenced by wxdisplay.DisplayDriver.__del__().

def wxdigit.IVDigit.ConnectLine (   self)

Connect selected lines/boundaries.

Returns
1 lines connected
0 lines not connected
-1 on error

Definition at line 873 of file wxdigit.py.

References wxdigit.IVDigit._addActionsAfter(), wxdigit.IVDigit._addActionsBefore(), wxdigit.IVDigit._checkMap(), wxdigit.IVDigit.changesets, wxdigit.IVDigit.poMapInfo, Vect_destroy_list(), Vect_get_num_lines(), and Vedit_connect_lines().

def wxdigit.IVDigit.CopyLine (   self,
  ids = [] 
)
def wxdigit.IVDigit.FlipLine (   self)
def wxdigit.IVDigit.GetAreaPerimeter (   self,
  centroid 
)

Get area perimeter.

Parameters
centroidcentroid id
Returns
area size
-1 on error

Definition at line 1197 of file wxdigit.py.

References wxdigit.IVDigit._checkMap(), wxdigit.IVDigit.poMapInfo, wxdigit.IVDigit.poPoints, Vect_area_alive(), Vect_area_perimeter(), Vect_get_area_points(), Vect_get_centroid_area(), and Vect_read_line().

def wxdigit.IVDigit.GetAreaSize (   self,
  centroid 
)

Get area size.

Parameters
centroidcentroid id
Returns
area size
-1 on error

Definition at line 1168 of file wxdigit.py.

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

def wxdigit.IVDigit.GetDisplay (   self)

Get display driver instance.

Definition at line 1391 of file wxdigit.py.

References mapwindow.NvizThread._display, tools.NvizToolWindow._display, wxdigit.IVDigit._display, and mapwindow.GLWindow._display.

def wxdigit.IVDigit.GetLayers (   self)

Get list of layers.

Requires self.InitCats() to be called.

Returns
list of layers

Definition at line 1682 of file wxdigit.py.

def wxdigit.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 1648 of file wxdigit.py.

References wxdigit.IVDigit._checkMap(), wxdigit.IVDigit.poCats, wxdigit.IVDigit.poMapInfo, tools.range, Vect_line_alive(), and Vect_read_line().

def wxdigit.IVDigit.GetLineLength (   self,
  line 
)

Get line length.

Parameters
linefeature id
Returns
line length
-1 on error

Definition at line 1143 of file wxdigit.py.

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

def wxdigit.IVDigit.GetUndoLevel (   self)

Get undo level (number of active changesets)

Note: Changesets starts wiht 0

Definition at line 1742 of file wxdigit.py.

References wxdigit.IVDigit.changesetCurrent.

def wxdigit.IVDigit.IsVector3D (   self)

Check if open vector map is 3D.

Definition at line 1135 of file wxdigit.py.

References wxdigit.IVDigit._checkMap(), wxdigit.IVDigit.poMapInfo, and Vect_is_3d().

def wxdigit.IVDigit.MergeLine (   self)
def wxdigit.IVDigit.MoveSelectedVertex (   self,
  point,
  move 
)
def wxdigit.IVDigit.OpenMap (   self,
  name 
)

Open vector map for editing.

Parameters
mapname of vector map to be set up

Definition at line 1395 of file wxdigit.py.

References wxdigit.IVDigit.InitCats(), and wxdigit.IVDigit.poMapInfo.

def wxdigit.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 667 of file wxdigit.py.

References wxdigit.IVDigit._ModifyLineVertex().

def wxdigit.IVDigit.SelectLinesByQuery (   self,
  bbox 
)
def wxdigit.IVDigit.SelectLinesFromBackgroundMap (   self,
  bbox 
)

Select features from background map.

Parameters
bboxbounding box definition
Returns
list of selected feature ids

Definition at line 1729 of file wxdigit.py.

References wxdigit.IVDigit.poBgMapInfo.

def wxdigit.IVDigit.SetCategory (   self)
def wxdigit.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 1227 of file wxdigit.py.

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

def wxdigit.IVDigit.SnapLine (   self)
def wxdigit.IVDigit.SplitLine (   self,
  point 
)

Split/break selected line/boundary on given position.

Parameters
pointpoint where to split line
Returns
1 line modified
0 nothing changed
-1 error

Definition at line 684 of file wxdigit.py.

References wxdigit.IVDigit._addActionsAfter(), wxdigit.IVDigit._addActionsBefore(), wxdigit.IVDigit._checkMap(), wxdigit.IVDigit.changesets, wxdigit.IVDigit.poMapInfo, wxdigit.IVDigit.poPoints, Vect_append_point(), Vect_destroy_list(), Vect_get_num_lines(), Vect_reset_line(), and Vedit_split_lines().

def wxdigit.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 1278 of file wxdigit.py.

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

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

Undo action.

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

Definition at line 1308 of file wxdigit.py.

References wxdigit.IVDigit._applyChangeset(), wxdigit.IVDigit.changesetCurrent, wxdigit.IVDigit.changesetEnd, and tools.range.

def wxdigit.IVDigit.UpdateSettings (   self)
def wxdigit.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 1358 of file wxdigit.py.

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

Field Documentation

wxdigit.IVDigit.bgMapInfo

Definition at line 136 of file wxdigit.py.

Referenced by wxdigit.IVDigit.__del__(), and wxdigit.IVDigit.OpenBackgroundMap().

wxdigit.IVDigit.cats
wxdigit.IVDigit.changesetCurrent
wxdigit.IVDigit.changesetEnd

Definition at line 173 of file wxdigit.py.

Referenced by wxdigit.IVDigit.OpenBackgroundMap(), and wxdigit.IVDigit.Undo().

wxdigit.IVDigit.mapWindow

Definition at line 133 of file wxdigit.py.

Referenced by wxdigit.IVDigit.AddFeature().

wxdigit.IVDigit.toolbar

Definition at line 147 of file wxdigit.py.

Referenced by mapwindow.BufferedWindow.OnDragging().


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