[GRASS-SVN] r54382 - in grass/trunk/gui/wxpython: . docs mapdisp vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 24 05:02:37 PST 2012


Author: martinl
Date: 2012-12-24 05:02:36 -0800 (Mon, 24 Dec 2012)
New Revision: 54382

Added:
   grass/trunk/gui/wxpython/vdigit/Makefile
   grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.html
   grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
   grass/trunk/gui/wxpython/vdigit/vdigit_toolbar.jpg
Removed:
   grass/trunk/gui/wxpython/docs/wxGUI.Vector_Digitizer.html
   grass/trunk/gui/wxpython/docs/wxGUI_vector_digitizer_toolbar.jpg
Modified:
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/mapdisp/main.py
   grass/trunk/gui/wxpython/mapdisp/toolbars.py
   grass/trunk/gui/wxpython/vdigit/main.py
   grass/trunk/gui/wxpython/vdigit/mapwindow.py
   grass/trunk/gui/wxpython/vdigit/preferences.py
   grass/trunk/gui/wxpython/vdigit/toolbars.py
Log:
g.gui.vdigit added


Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/Makefile	2012-12-24 13:02:36 UTC (rev 54382)
@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-SUBDIRS = docs animation mapswipe gmodeler rlisetup psmap dbmgr
+SUBDIRS = docs animation mapswipe gmodeler rlisetup psmap dbmgr vdigit
 EXTRA_CLEAN_FILES = menustrings.py build_ext.pyc
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make

Deleted: grass/trunk/gui/wxpython/docs/wxGUI.Vector_Digitizer.html
===================================================================
--- grass/trunk/gui/wxpython/docs/wxGUI.Vector_Digitizer.html	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/docs/wxGUI.Vector_Digitizer.html	2012-12-24 13:02:36 UTC (rev 54382)
@@ -1,274 +0,0 @@
-<!-- meta page description: wxGUI Vector Digitizer -->
-<!-- meta page index: wxGUI -->
-<h2>DESCRIPTION</h2>
-
-The <b>vector digitizer</b> is
-a <em><a href="wxGUI.html">wxGUI</a></em> component intended for
-interactive editing vector maps
-(see <em><a href="v.edit.html">v.edit</a></em> for non-interactive
-vector editing GRASS capabilities).
-
-<p>
-The digitizer supports editing of 2D vector features (points, lines, centroids,
-boundaries, and area).
-
-Vector features can be selected using mouse or by query (e.g. minimal
-vector line length). Vector features can be selected by bounding box
-or simply by mouse click (based on 'Settings->General->Select
-threshold' value).
-
-<p>
-Vector digitizer can be activated from Main toolbar in Map Display by
-selecting "Digitize" from "Tools" combobox. Vector map to be edited
-can be afterwards selected from digitizer toolbar ("Select vector map"
-combobox, note that only vector maps from the current layer tree in Layer
-Manager are available).
-
-Vector digitizer can be alternatively also activated from contextual
-menu in Layer Manager by selecting "Start editing" on selected vector
-map in the layer tree.
-
-<p>
-New vector map can be easily created from digitizer toolbar by
-selecting "New vector map" in "Select vector map" combobox. A new
-vector map is created, added to the current layer tree in Layer
-Manager and opened for editing. "Select vector map" combobox in
-digitizer toolbar also allows switching easily between vector maps to be
-edited.
-<p>
-The wxGUI vector digitizer draws all maps in the Layer Manager in the Map 
-Display window; in addition, the digitizer also recognizes a special 
-"background" vector map. This map is selected from the Layer Manager by 
-right-clicking on the map and selecting "Use as Background Map" from the
-contextual menu. The features of the background map may then be copied into
-the currently edited vector map using the "Copy features from (background) 
-vector map" button in the "Additional Tools" menu on the Digitzer Toolbar.
-
-<h3>DIGITIZER TOOLBAR</h3>
-
-<center>
-<br>
-<img src="wxGUI_vector_digitizer_toolbar.jpg" border="1" alt="toolbar">
-<br><br>
-</center>
-
-<dl>
-  <dt><img src="icons/point-create.png" alt="icon"> 
-    <em>Digitize new point</em></dt>
-  <dd>Add new point to vector map and optionally define its
-    attributes.</dd>
-  
-  <dt><img src="icons/line-create.png" alt="icon"> 
-    <em>Digitize new line</em></dt>
-  <dd>Add new line to vector map and optionally define its
-    attributes.</dd>
-
-  <dt><img src="icons/boundary-create.png" alt="icon"> 
-    <em>Digitize new boundary</em></dt>
-  <dd>Add new boundary to vector map and optionally define its
-    attributes.</dd>
-  
-  <dt><img src="icons/centroid-create.png" alt="icon"> 
-    <em>Digitize new centroid</em></dt>
-  <dd>Add new centroid to vector map and optionally define its
-    attributes.</dd>
-
-  <dt><img src="icons/polygon-create.png" alt="icon"> 
-    <em>Digitize new area</em></dt>
-  <dd>Add new area (closed boundary and one centroid inside) to vector
-    map and optionally define its attributes.</dd>
-  
-  <dt><img src="icons/vertex-move.png" alt="icon"> 
-    <em>Move vertex</em></dt>
-  <dd>Move selected vertex of linear feature. Thus shape of linear
-    feature is changed.</dd>
-
-  <dt><img src="icons/vertex-create.png" alt="icon"> 
-    <em>Add vertex</em></dt>
-  <dd>Add new vertex to selected linear feature (shape not
-    changed).</dd>
-
-  <dt><img src="icons/vertex-delete.png" alt="icon"> 
-    <em>Remove vertex</em></dt>
-  <dd>Remove selected vertex from linear feature. Thus shape of selected
-  feature can be changed.</dd>
-  
-  <dt><img src="icons/line-edit.png" alt="icon"> 
-    <em>Edit line/boundary</em></dt>
-  <dd>Edit selected linear feature, add new segments or remove
-  existing segments of linear feature.</dd>
-
-  <dt><img src="icons/line-move.png" alt="icon"> 
-    <em>Move feature(s)</em></dt>
-  <dd>Move selected vector features. Selection can be done by mouse or
-    by query.</dd>
-
-  <dt><img src="icons/line-delete.png" alt="icon"> 
-    <em>Delete feature(s)</em></dt>
-  <dd>Delete selected vector features (point, line, centroid, or
-  boundary). Selection can be done by mouse or by query.</dd>
-
-  <dt><img src="icons/polygon-delete.png" alt="icon"> 
-    <em>Delete areas(s)</em></dt>
-  <dd>Delete selected vector areas. Selection can be done by mouse
-  or by query.</dd>
-
-  <dt><img src="icons/cats-display.png" alt="icon"> 
-    <em>Display/update categories</em></dt>
-  <dd>Display categories of selected vector feature. Category settings
-  can be modified, new layer/category pairs added or already defined pairs
-  removed.</dd>
-
-  <dt><img src="icons/attributes-display.png" alt="icon"> 
-    <em>Display/update attributes</em></dt>
-  <dd>Display attributes of selected vector feature (based on its
-    category settings).  Attributes can be also modified. Same
-    functionality is accessible from Main toolbar "Query vector map
-    (editable mode)".</dd>
-
-  <dt><img src="icons/tools.png" alt="icon"> 
-    <em>Additional tools</em></dt>
-  <dd>
-    <ul>
-      <li><em>Break selected lines/boundaries at intersection</em><br> Split
-	given vector line or boundary into two lines on given position
-	(based on <em><a href="v.clean.html">v.clean</a></em>,
-	<tt>tool=break</tt>).</li>
-
-      <li><em>Connect two selected lines/boundaries</em><br> Connect selected
-	lines or boundaries, the first given line is connected to the
-	second one. The second line is broken if necessary on each intersection.
-	The lines are connected only if distance between them is not greater
-	than snapping threshold value.</li>
-
-      <li><em>Copy categories</em><br>Copy category settings of
-	selected vector feature to other vector
-	features. Layer/category pairs of source vector features are
-	appended to the target feature category settings. Existing
-	layer/category pairs are not removed from category settings of
-	the target features.</li>
-
-      <li><em>Copy features from (background) map</em><br> Make identical copy of
-	selected vector features. If a background vector map has been 
-	selected from the Layer Manager, copy features from background 
-	vector map, not from the currently modified vector map.</li>
-
-      <li><em>Copy attributes</em><br>Duplicate attributes settings of
-	selected vector feature to other vector features. New
-	category(ies) is appended to the target feature category
-	settings and attributes duplicated based on category settings
-	of source vector features. Existing layer/category pairs are
-	not removed from category settings of the target
-	features.</li>
-
-      <li><em>Feature type conversion</em><br> Change feature type of selected
-	geometry features. Points are converted to centroids,
-	centroids to points, lines to boundaries and boundaries to
-	lines.</li>
-
-      <li><em>Flip selected lines/boundaries</em><br> Flip direction of
-	selected linear features (lines or boundaries).</li>
-
-      <li><em>Merge selected lines/boundaries</em><br> Merge (at least two)
-	selected vector lines or boundaries. The geometry of the
-	merged vector lines can be changed. If the second line from
-	two selected lines is in opposite direction to the first, it
-	will be flipped. See also
-	module <em><a href="v.build.polylines.html">v.build.polylines</a></em>.</li>
-
-      <li><em>Snap selected lines/boundaries (only to nodes)</em><br> Snap
-	vector features in given threshold. See also
-	module <em><a href="v.clean.html">v.clean</a></em>. Note that
-	this tool supports only snapping to nodes. Snapping to vector
-	features from background vector map is not currently
-	supported.</li>
-
-      <li><em>Split line/boundary</em><br>Split selected line or boundary on
-      given position.</li>
-
-      <li><em>Query tool</em><br>Select vector features by defining a threshold for
-        min/max length value (linear features or dangles).</li>
-
-      <li><em>Z-bulk labeling of 3D lines</em><br> Assign z coordinate values to 3D
-	vector lines in bounding box. This is useful for labeling contour lines.</li>
-    </ul>
-  </dd>
-
-  <dt><img src="icons/undo.png" alt="icon"> 
-    <em>Undo</em></dt>
-  <dd>Undo previous operations.</dd>
-
-  <dt><img src="icons/redo.png" alt="icon"> 
-    <em>Redo</em></dt>
-  <dd>Redo previous operations.</dd>
-
-  <dt><img src="icons/settings.png" alt="icon"> 
-    <em>Settings</em></dt>
-  <dd>Dialog for vector digitizer settings.</dd>
-
-  <dt><img src="icons/quit.png" alt="icon"> 
-    <em>Quit digitizing tool</em></dt>
-  <dd>Changes in vector map can be optionally discarded when
-  digitizing session is quited.</dd>
-
-</dl>
-
-<h2>NOTES</h2>
-
-<dl><dt><b>Mouse button Functions:</b><dd>
-	<dt><i>Left</i>   - select/deselect features</dt>
-	<dt><i>Control+Left</i> - cancel action/undo vertex</dt>
-	<dt><i>Right</i>  - confirm action</dt>
-</dl>
-
-<p>
-<i>Dead (deleted)</i> are internally only marked in the geometry file
-as 'dead' but it remains there and occupies space. Any vector module
-used afterwards on this vector map which really reads and writes
-vector geometry (so not <em><a href="g.copy.html">g.copy</a></em>)
-will writes only features which are 'alive'.
-
-<p>
-<i>Added or modified</i> vector features are <i>snapped</i> to
-existing vector features (Settings→General→Snapping). To
-disable snapping set the snapping threshold to '0'.
-
-<p>
-If the digitizer crashes for some reason you can repair the vector map
-which was left open with
-the <em><a href="v.build.html">v.build</a></em> module.
-
-<h2>REFERENCE</h2>
-
-<ul>
-  <li><a href="http://grass.osgeo.org/programming7/veditlib.html">GRASS Vedit Library</a></li>
-</ul>
-
-<h2>SEE ALSO</h2>
-
-<em>
-  <a href="wxGUI.html">wxGUI</a><br>
-  <a href="wxGUI.Components.html">wxGUI components</a>
-</em>
-
-<p>
-<em>
-<a href="v.edit.html">v.edit</a>,
-<a href="v.category.html">v.category</a>,
-<a href="v.build.html">v.build</a>
-</em>
-
-<p>
-See also
-the <a href="http://grass.osgeo.org/wiki/WxGUI_Vector_Digitizer">wiki
-page</a>
-including <a href="http://grasswiki.osgeo.org/wiki/WxGUI_Vector_Digitizer#Vector_tutorials">video
-tutorials</a>.
-
-<h2>AUTHOR</h2>
-
-Martin Landa, FBK-irst (2007-2008), Trento, Italy, and Czech Technical
-University in Prague, Czech Republic
-
-<p>
-<i>$Date$</i>

Deleted: grass/trunk/gui/wxpython/docs/wxGUI_vector_digitizer_toolbar.jpg
===================================================================
(Binary files differ)

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -35,7 +35,7 @@
 sys.path.append(os.path.join(globalvar.ETCDIR,   "python"))
 
 from core               import globalvar
-from core.render        import EVT_UPDATE_PRGBAR
+from core.render        import EVT_UPDATE_PRGBAR, Map
 from vdigit.toolbars    import VDigitToolbar
 from mapdisp.toolbars   import MapToolbar, NvizIcons
 from mapdisp.gprint     import PrintOptions
@@ -64,7 +64,7 @@
     """
     def __init__(self, parent, giface, title = _("GRASS GIS - Map display"),
                  toolbars = ["map"], tree = None, notebook = None, lmgr = None,
-                 page = None, Map = None, auimgr = None, name = 'MapWindow', **kwargs):
+                 page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
         """!Main map display window with toolbars, statusbar and
         BufferedWindow (map canvas)
         
@@ -360,13 +360,16 @@
         self.MapWindow.UpdateMap()
         self._mgr.Update()
         
-    def AddToolbar(self, name):
+    def AddToolbar(self, name, fixed = False):
         """!Add defined toolbar to the window
         
         Currently known toolbars are:
          - 'map'     - basic map toolbar
          - 'vdigit'  - vector digitizer
-         - 'gcpdisp' - GCP Manager Display
+         - 'gcpdisp' - GCP Manager 
+         
+        @param name toolbar to add
+        @param fixed fixed toolbar
         """
         # default toolbar
         if name == "map":
@@ -383,8 +386,12 @@
             
         # vector digitizer
         elif name == "vdigit":
+            self.toolbars['map'].combo.SetValue(_("Digitize"))
             self._addToolbarVDigit()
         
+        if fixed:
+            self.toolbars['map'].combo.Disable()
+         
         self._mgr.Update()
         
     def RemoveToolbar (self, name):

Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/mapdisp/main.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -292,6 +292,10 @@
             grass.warning("%s" % e)
             self.timer.Stop()
 
+    def GetMapFrame(self):
+        """!Get Map Frame instance"""
+        return self.mapFrm
+
 if __name__ == "__main__":
     # set command variable
     if len(sys.argv) < 5:

Modified: grass/trunk/gui/wxpython/mapdisp/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/toolbars.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/mapdisp/toolbars.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -261,7 +261,8 @@
     def ExitToolbars(self):
         if self.parent.GetToolbar('vdigit'):
             self.parent.toolbars['vdigit'].OnExit()
-        if self.parent.GetLayerManager().IsPaneShown('toolbarNviz'):
+        if self.parent.GetLayerManager() and \
+                self.parent.GetLayerManager().IsPaneShown('toolbarNviz'):
             self.parent.RemoveNviz()
         
     def Enable2D(self, enabled):

Added: grass/trunk/gui/wxpython/vdigit/Makefile
===================================================================
--- grass/trunk/gui/wxpython/vdigit/Makefile	                        (rev 0)
+++ grass/trunk/gui/wxpython/vdigit/Makefile	2012-12-24 13:02:36 UTC (rev 54382)
@@ -0,0 +1,5 @@
+MODULE_TOPDIR = ../../..
+
+include $(MODULE_TOPDIR)/include/Make/GuiScript.make
+
+default: guiscript


Property changes on: grass/trunk/gui/wxpython/vdigit/Makefile
___________________________________________________________________
Added: svn:mime-type
   + text/x-makefile
Added: svn:eol-style
   + native

Copied: grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.html (from rev 54378, grass/trunk/gui/wxpython/docs/wxGUI.Vector_Digitizer.html)
===================================================================
--- grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.html	                        (rev 0)
+++ grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.html	2012-12-24 13:02:36 UTC (rev 54382)
@@ -0,0 +1,273 @@
+<!-- meta page description: wxGUI Vector Digitizer -->
+<!-- meta page index: wxGUI -->
+<h2>DESCRIPTION</h2>
+
+<b>Vector digitizer</b> is a <em><a href="wxGUI.html">wxGUI</a></em>
+component intended for interactive editing vector maps
+(see <em><a href="v.edit.html">v.edit</a></em> for non-interactive
+vector editing GRASS capabilities).
+
+<p>
+The digitizer supports editing of 2D vector features (points, lines, centroids,
+boundaries, and area).
+
+Vector features can be selected using mouse or by query (e.g. minimal
+vector line length). Vector features can be selected by bounding box
+or simply by mouse click (based on 'Settings→General→Select
+threshold' value).
+
+<p>
+Vector digitizer can be activated from Main toolbar in Map Display by
+selecting "Digitize" from "Tools" combobox. Vector map to be edited
+can be afterwards selected from digitizer toolbar ("Select vector map"
+combobox, note that only vector maps from the current layer tree in Layer
+Manager are available).
+
+Vector digitizer can be alternatively also activated from contextual
+menu in Layer Manager by selecting "Start editing" on selected vector
+map in the layer tree.
+
+<p>
+New vector map can be easily created from digitizer toolbar by
+selecting "New vector map" in "Select vector map" combobox. A new
+vector map is created, added to the current layer tree in Layer
+Manager and opened for editing. "Select vector map" combobox in
+digitizer toolbar also allows switching easily between vector maps to be
+edited.
+<p>
+The wxGUI vector digitizer draws all maps in the Layer Manager in the Map 
+Display window; in addition, the digitizer also recognizes a special 
+"background" vector map. This map is selected from the Layer Manager by 
+right-clicking on the map and selecting "Use as Background Map" from the
+contextual menu. The features of the background map may then be copied into
+the currently edited vector map using the "Copy features from (background) 
+vector map" button in the "Additional Tools" menu on the Digitzer Toolbar.
+
+<h3>DIGITIZER TOOLBAR</h3>
+
+<center>
+<br>
+<img src="vdigit_toolbar.jpg" border="1" alt="Vector Digitizer Toolbar">
+<br><br>
+</center>
+
+<dl>
+  <dt><img src="icons/point-create.png" alt="icon"> 
+    <em>Digitize new point</em></dt>
+  <dd>Add new point to vector map and optionally define its
+    attributes.</dd>
+  
+  <dt><img src="icons/line-create.png" alt="icon"> 
+    <em>Digitize new line</em></dt>
+  <dd>Add new line to vector map and optionally define its
+    attributes.</dd>
+
+  <dt><img src="icons/boundary-create.png" alt="icon"> 
+    <em>Digitize new boundary</em></dt>
+  <dd>Add new boundary to vector map and optionally define its
+    attributes.</dd>
+  
+  <dt><img src="icons/centroid-create.png" alt="icon"> 
+    <em>Digitize new centroid</em></dt>
+  <dd>Add new centroid to vector map and optionally define its
+    attributes.</dd>
+
+  <dt><img src="icons/polygon-create.png" alt="icon"> 
+    <em>Digitize new area</em></dt>
+  <dd>Add new area (closed boundary and one centroid inside) to vector
+    map and optionally define its attributes.</dd>
+  
+  <dt><img src="icons/vertex-move.png" alt="icon"> 
+    <em>Move vertex</em></dt>
+  <dd>Move selected vertex of linear feature. Thus shape of linear
+    feature is changed.</dd>
+
+  <dt><img src="icons/vertex-create.png" alt="icon"> 
+    <em>Add vertex</em></dt>
+  <dd>Add new vertex to selected linear feature (shape not
+    changed).</dd>
+
+  <dt><img src="icons/vertex-delete.png" alt="icon"> 
+    <em>Remove vertex</em></dt>
+  <dd>Remove selected vertex from linear feature. Thus shape of selected
+  feature can be changed.</dd>
+  
+  <dt><img src="icons/line-edit.png" alt="icon"> 
+    <em>Edit line/boundary</em></dt>
+  <dd>Edit selected linear feature, add new segments or remove
+  existing segments of linear feature.</dd>
+
+  <dt><img src="icons/line-move.png" alt="icon"> 
+    <em>Move feature(s)</em></dt>
+  <dd>Move selected vector features. Selection can be done by mouse or
+    by query.</dd>
+
+  <dt><img src="icons/line-delete.png" alt="icon"> 
+    <em>Delete feature(s)</em></dt>
+  <dd>Delete selected vector features (point, line, centroid, or
+  boundary). Selection can be done by mouse or by query.</dd>
+
+  <dt><img src="icons/polygon-delete.png" alt="icon"> 
+    <em>Delete areas(s)</em></dt>
+  <dd>Delete selected vector areas. Selection can be done by mouse
+  or by query.</dd>
+
+  <dt><img src="icons/cats-display.png" alt="icon"> 
+    <em>Display/update categories</em></dt>
+  <dd>Display categories of selected vector feature. Category settings
+  can be modified, new layer/category pairs added or already defined pairs
+  removed.</dd>
+
+  <dt><img src="icons/attributes-display.png" alt="icon"> 
+    <em>Display/update attributes</em></dt>
+  <dd>Display attributes of selected vector feature (based on its
+    category settings).  Attributes can be also modified. Same
+    functionality is accessible from Main toolbar "Query vector map
+    (editable mode)".</dd>
+
+  <dt><img src="icons/tools.png" alt="icon"> 
+    <em>Additional tools</em></dt>
+  <dd>
+    <ul>
+      <li><em>Break selected lines/boundaries at intersection</em><br> Split
+	given vector line or boundary into two lines on given position
+	(based on <em><a href="v.clean.html">v.clean</a></em>,
+	<tt>tool=break</tt>).</li>
+
+      <li><em>Connect two selected lines/boundaries</em><br> Connect selected
+	lines or boundaries, the first given line is connected to the
+	second one. The second line is broken if necessary on each intersection.
+	The lines are connected only if distance between them is not greater
+	than snapping threshold value.</li>
+
+      <li><em>Copy categories</em><br>Copy category settings of
+	selected vector feature to other vector
+	features. Layer/category pairs of source vector features are
+	appended to the target feature category settings. Existing
+	layer/category pairs are not removed from category settings of
+	the target features.</li>
+
+      <li><em>Copy features from (background) map</em><br> Make identical copy of
+	selected vector features. If a background vector map has been 
+	selected from the Layer Manager, copy features from background 
+	vector map, not from the currently modified vector map.</li>
+
+      <li><em>Copy attributes</em><br>Duplicate attributes settings of
+	selected vector feature to other vector features. New
+	category(ies) is appended to the target feature category
+	settings and attributes duplicated based on category settings
+	of source vector features. Existing layer/category pairs are
+	not removed from category settings of the target
+	features.</li>
+
+      <li><em>Feature type conversion</em><br> Change feature type of selected
+	geometry features. Points are converted to centroids,
+	centroids to points, lines to boundaries and boundaries to
+	lines.</li>
+
+      <li><em>Flip selected lines/boundaries</em><br> Flip direction of
+	selected linear features (lines or boundaries).</li>
+
+      <li><em>Merge selected lines/boundaries</em><br> Merge (at least two)
+	selected vector lines or boundaries. The geometry of the
+	merged vector lines can be changed. If the second line from
+	two selected lines is in opposite direction to the first, it
+	will be flipped. See also
+	module <em><a href="v.build.polylines.html">v.build.polylines</a></em>.</li>
+
+      <li><em>Snap selected lines/boundaries (only to nodes)</em><br> Snap
+	vector features in given threshold. See also
+	module <em><a href="v.clean.html">v.clean</a></em>. Note that
+	this tool supports only snapping to nodes. Snapping to vector
+	features from background vector map is not currently
+	supported.</li>
+
+      <li><em>Split line/boundary</em><br>Split selected line or boundary on
+      given position.</li>
+
+      <li><em>Query tool</em><br>Select vector features by defining a threshold for
+        min/max length value (linear features or dangles).</li>
+
+      <li><em>Z-bulk labeling of 3D lines</em><br> Assign z coordinate values to 3D
+	vector lines in bounding box. This is useful for labeling contour lines.</li>
+    </ul>
+  </dd>
+
+  <dt><img src="icons/undo.png" alt="icon"> 
+    <em>Undo</em></dt>
+  <dd>Undo previous operations.</dd>
+
+  <dt><img src="icons/redo.png" alt="icon"> 
+    <em>Redo</em></dt>
+  <dd>Redo previous operations.</dd>
+
+  <dt><img src="icons/settings.png" alt="icon"> 
+    <em>Settings</em></dt>
+  <dd>Dialog for vector digitizer settings.</dd>
+
+  <dt><img src="icons/quit.png" alt="icon"> 
+    <em>Quit digitizing tool</em></dt>
+  <dd>Changes in vector map can be optionally discarded when
+  digitizing session is quited.</dd>
+
+</dl>
+
+<h2>NOTES</h2>
+
+<dl><dt><b>Mouse button Functions:</b><dd>
+	<dt><i>Left</i>   - select/deselect features</dt>
+	<dt><i>Control+Left</i> - cancel action/undo vertex</dt>
+	<dt><i>Right</i>  - confirm action</dt>
+</dl>
+
+<p>
+<i>Dead (deleted)</i> are internally only marked in the geometry file
+as 'dead' but it remains there and occupies space. Any vector module
+used afterwards on this vector map which really reads and writes
+vector geometry (so not <em><a href="g.copy.html">g.copy</a></em>)
+will writes only features which are 'alive'.
+
+<p>
+<i>Added or modified</i> vector features are <i>snapped</i> to
+existing vector features (Settings→General→Snapping). To
+disable snapping set the snapping threshold to '0'.
+
+<p>
+If the digitizer crashes for some reason you can repair the vector map
+which was left open with
+the <em><a href="v.build.html">v.build</a></em> module.
+
+<h2>REFERENCE</h2>
+
+<ul>
+  <li><a href="http://grass.osgeo.org/programming7/veditlib.html">GRASS Vedit Library</a></li>
+</ul>
+
+<h2>SEE ALSO</h2>
+
+<em>
+  <a href="wxGUI.html">wxGUI</a><br>
+  <a href="wxGUI.Components.html">wxGUI components</a>
+</em>
+
+<p>
+<em>
+<a href="v.edit.html">v.edit</a>,
+<a href="v.category.html">v.category</a>,
+<a href="v.build.html">v.build</a>
+</em>
+
+<p>
+See also
+the <a href="http://grass.osgeo.org/wiki/WxGUI_Vector_Digitizer">wiki
+page</a>
+including <a href="http://grasswiki.osgeo.org/wiki/WxGUI_Vector_Digitizer#Vector_tutorials">video
+tutorials</a>.
+
+<h2>AUTHOR</h2>
+
+Martin Landa, FBK-irst (2007-2008), Trento, Italy, and Czech Technical
+University in Prague, Czech Republic
+
+<p>
+<i>$Date$</i>

Copied: grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py (from rev 54378, grass/trunk/gui/wxpython/vdigit/main.py)
===================================================================
--- grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py	                        (rev 0)
+++ grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE:    g.gui.vdigit
+# AUTHOR(S): Martin Landa <landa.martin gmail.com>
+# PURPOSE:   wxGUI Vector Digitizer
+# COPYRIGHT: (C) 2007-2012 by Martin Landa, and the GRASS Development Team
+#
+#  This program is free software; you can 1redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of the
+#  License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details.
+#
+############################################################################
+
+#%module
+#% description: Interactive editing and digitization of vector maps.
+#% keywords: general
+#% keywords: gui
+#% keywords: vector
+#% keywords: editig
+#% keywords: digitization
+#%end
+#%option G_OPT_V_MAP
+#%label: Name of vector map to load
+#%end
+
+import os
+import sys
+import gettext
+
+import grass.script as grass
+
+import wx
+
+if __name__ == '__main__':
+    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+
+from mapdisp.frame import MapFrame
+from core.giface   import StandaloneGrassInterface
+from core.settings import UserSettings
+from vdigit.main   import haveVDigit, errorMsg
+
+class VDigitMapFrame(MapFrame):
+    def __init__(self, vectorMap):
+        MapFrame.__init__(self, parent = None,  giface = StandaloneGrassInterface(),
+                          size = (850, 600))
+
+        # load vector map
+        mapLayer = self.GetMap().AddLayer(type = 'vector',
+                                          command = ['d.vect', 'map=%s' % vectorMap],
+                                          l_active = True, name = vectorMap, l_hidden = False, l_opacity = 1.0,
+                                          l_render = True)
+        
+        # switch toolbar
+        self.AddToolbar('vdigit', fixed = True)
+        
+        # start editing
+        self.toolbars['vdigit'].StartEditing(mapLayer)
+
+def main():
+    if not haveVDigit:
+        grass.fatal(_("Vector digitizer not available. %s") % errorMsg)
+    
+    if not grass.find_file(name = options['map'], element = 'vector',
+                           mapset = grass.gisenv()['MAPSET'])['fullname']:
+        grass.fatal(_("Vector map <%s> not found in current mapset") % options['map'])
+
+    # allow immediate rendering
+    driver = UserSettings.Get(group = 'display', key = 'driver', subkey = 'type')
+    if driver == 'png':
+        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
+    else:
+        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
+    
+    app = wx.PySimpleApp()
+    wx.InitAllImageHandlers()
+    frame = VDigitMapFrame(options['map'])
+    frame.Show()
+
+    app.MainLoop()
+    
+if __name__ == "__main__":
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
+    grass.set_raise_on_error(False)
+    options, flags = grass.parser()
+    
+    main()

Modified: grass/trunk/gui/wxpython/vdigit/main.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/main.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/vdigit/main.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -6,7 +6,7 @@
 Classes:
  - main::VDigit
 
-(C) 2007-2011 by the GRASS Development Team
+(C) 2007-2012 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.

Modified: grass/trunk/gui/wxpython/vdigit/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/mapwindow.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/vdigit/mapwindow.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -276,6 +276,9 @@
         
         @todo: use AddDataRow() instead
         """
+        if not self.lmgr:
+            return
+        
         # update ATM
         digitVector = self.toolbar.GetLayer().GetName()
                             

Modified: grass/trunk/gui/wxpython/vdigit/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/preferences.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/vdigit/preferences.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -425,7 +425,10 @@
         layer = UserSettings.Get(group = 'vdigit', key = "layer", subkey = 'value')
         mapLayer = self.parent.toolbars['vdigit'].GetLayer()
         tree = self.parent.tree
-        item = tree.FindItemByData('maplayer', mapLayer)
+        if tree:
+            item = tree.FindItemByData('maplayer', mapLayer)
+        else:
+            item = None
         row = 0
         for attrb in ['length', 'area', 'perimeter']:
             # checkbox

Modified: grass/trunk/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/toolbars.py	2012-12-24 12:59:47 UTC (rev 54381)
+++ grass/trunk/gui/wxpython/vdigit/toolbars.py	2012-12-24 13:02:36 UTC (rev 54382)
@@ -23,7 +23,7 @@
 from vdigit.preferences import VDigitSettingsDialog
 from core.debug         import Debug
 from core.settings      import UserSettings
-from core.gcmd          import GError
+from core.gcmd          import GError, RunCommand
 from icons.icon         import MetaIcon
 from iclass.digit       import IClassVDigit
 
@@ -321,7 +321,7 @@
                         'id'   : self.addArea }
         self.MapWindow.mouse['box'] = 'line'
 
-    def OnExit (self, event=None):
+    def OnExit (self, event = None):
         """!Quit digitization tool"""
         # stop editing of the currently selected map layer
         if self.mapLayer:
@@ -330,15 +330,18 @@
         # close dialogs if still open
         if self.settingsDialog:
             self.settingsDialog.OnCancel(None)
-            
+        
         # set default mouse settings
         self.MapWindow.mouse['use'] = "pointer"
         self.MapWindow.mouse['box'] = "point"
         self.MapWindow.polycoords = []
         
-        # disable the toolbar
-        self.parent.RemoveToolbar("vdigit")
-        
+        if not self.parent.IsStandalone():
+            # disable the toolbar
+            self.parent.RemoveToolbar("vdigit")
+        else:
+            self.parent.Close()
+                
     def OnMoveVertex(self, event):
         """!Move line vertex"""
         Debug.msg(2, "Digittoolbar.OnMoveVertex():")
@@ -454,10 +457,18 @@
 
     def OnHelp(self, event):
         """!Show digitizer help page in web browser"""
-        log = self.parent.GetLayerManager().GetLogWindow()
-        log.RunCmd(['g.manual',
-                    'entry=wxGUI.Vector_Digitizer'])
-
+        try:
+            log = self.parent.GetLayerManager().GetLogWindow()
+        except:
+            log = None
+        
+        if log:
+            log.RunCmd(['g.manual',
+                        'entry = wxGUI.vdigit'])
+        else:
+            RunCommand('g.manual',
+                       entry = 'wxGUI.vdigit')
+        
     def OnAdditionalToolMenu(self, event):
         """!Menu for additional tools"""
         point = wx.GetMousePosition()
@@ -858,9 +869,10 @@
                 lmgr.GetLogWindow().WriteCmdLog(_("Editing of vector map <%s> successfully finished") % \
                                                     self.mapLayer.GetName())
             # re-active layer 
-            item = self.parent.tree.FindItemByData('maplayer', self.mapLayer)
-            if item and self.parent.tree.IsItemChecked(item):
-                self.Map.ChangeLayerActive(self.mapLayer, True)
+            if self.parent.tree:
+                item = self.parent.tree.FindItemByData('maplayer', self.mapLayer)
+                if item and self.parent.tree.IsItemChecked(item):
+                    self.Map.ChangeLayerActive(self.mapLayer, True)
         
         # change cursor
         self.MapWindow.SetCursor(self.parent.cursors["default"])

Copied: grass/trunk/gui/wxpython/vdigit/vdigit_toolbar.jpg (from rev 54378, grass/trunk/gui/wxpython/docs/wxGUI_vector_digitizer_toolbar.jpg)
===================================================================
(Binary files differ)



More information about the grass-commit mailing list