Browse Source

wxGUI/vdigit: break lines before adding centroids (add new area)
enable snapping to verteces by default
enable 'break lines on intersection' by default
(merge r61472-4 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61509 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 10 years ago
parent
commit
b7e6095ac6
2 changed files with 9 additions and 9 deletions
  1. 2 2
      gui/wxpython/core/settings.py
  2. 7 7
      gui/wxpython/vdigit/wxdigit.py

+ 2 - 2
gui/wxpython/core/settings.py

@@ -392,7 +392,7 @@ class Settings:
                     'units' : 'screen pixels'
                     },
                 'snapToVertex' : {
-                    'enabled' : False
+                    'enabled' : True
                     },
                 # digitize new record
                 'addRecord' : {
@@ -455,7 +455,7 @@ class Settings:
                     },
                 # break lines on intersection
                 'breakLines' : {
-                    'enabled' : False,
+                    'enabled' : True,
                     },
                 # close boundary (snap to the first node)
                 'closeBoundary' : {

+ 7 - 7
gui/wxpython/vdigit/wxdigit.py

@@ -17,7 +17,7 @@ data processing with NumPy is much faster than iterating in Python
 (and NumPy would be an excellent candidate for acceleration via
 e.g. OpenCL or CUDA; I'm surprised it hasn't happened already).
 
-(C) 2007-2011, 2013 by the GRASS Development Team
+(C) 2007-2014 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.
@@ -1762,9 +1762,13 @@ class IVDigit:
         else:
             fids.append(newline)
         
-        left = right = -1
+        # break at intersection
+        if self._settings['breakLines']:
+            self._breakLineAtIntersection(newline, self.poPoints)
+            
+        # add centroids for left/right area
         if ftype & GV_AREA:
-            # add centroids for left/right area
+            left = right = -1
             bpoints = Vect_new_line_struct()
             cleft = c_int()
             cright = c_int()
@@ -1816,10 +1820,6 @@ class IVDigit:
                     
             Vect_destroy_line_struct(bpoints)
         
-        # break at intersection
-        if self._settings['breakLines']:
-            self._breakLineAtIntersection(newline, self.poPoints)
-
         self._addChangeset()
         
         if ftype & GV_AREA: