46
46
import doIntersectLines , doJoinAttributes , doSelectByLocation , doVectorSplit , doMeanCoords
47
47
import doPointDistance , doPointsInPolygon , doRandom , doRandPoints , doRegPoints , doDefineProj
48
48
import doReProject , doSpatialJoin , doSubsetSelect , doSumLines , doVectorGrid , doMergeShapes
49
- import doAbout , doValidate
49
+ import doAbout , doValidate , doSimplify
50
50
51
51
class fToolsPlugin :
52
52
def __init__ ( self ,iface ):
@@ -103,6 +103,7 @@ def updateThemeIcons( self, theme ):
103
103
self .checkGeom .setIcon ( QIcon ( self .getThemeIcon ( "check_geometry.png" ) ) )
104
104
self .centroids .setIcon ( QIcon ( self .getThemeIcon ( "centroids.png" ) ) )
105
105
self .delaunay .setIcon ( QIcon ( self .getThemeIcon ( "delaunay.png" ) ) )
106
+ self .voronoi .setIcon ( QIcon ( self .getThemeIcon ( "delaunay.png" ) ) )
106
107
self .extNodes .setIcon ( QIcon ( self .getThemeIcon ( "extract_nodes.png" ) ) )
107
108
self .simplify .setIcon ( QIcon ( self .getThemeIcon ( "simplify.png" ) ) )
108
109
self .multiToSingle .setIcon ( QIcon ( self .getThemeIcon ( "multi_to_single.png" ) ) )
@@ -126,7 +127,7 @@ def initGui( self ):
126
127
return None
127
128
QObject .connect ( self .iface , SIGNAL ( "currentThemeChanged ( QString )" ), self .updateThemeIcons )
128
129
self .menu = QMenu ()
129
- self .menu .setTitle ( QCoreApplication .translate ( "fTools" , "&Vector " ) )
130
+ self .menu .setTitle ( QCoreApplication .translate ( "fTools" , "V&ector " ) )
130
131
131
132
self .analysisMenu = QMenu ( QCoreApplication .translate ( "fTools" , "&Analysis Tools" ) )
132
133
self .distMatrix = QAction ( QCoreApplication .translate ( "fTools" , "Distance matrix" ),self .iface .mainWindow ( ) )
@@ -168,12 +169,13 @@ def initGui( self ):
168
169
self .checkGeom = QAction ( QCoreApplication .translate ( "fTools" , "Check geometry validity" ),self .iface .mainWindow () )
169
170
self .centroids = QAction ( QCoreApplication .translate ( "fTools" , "Polygon centroids" ),self .iface .mainWindow () )
170
171
self .delaunay = QAction ( QCoreApplication .translate ( "fTools" , "Delaunay triangulation" ),self .iface .mainWindow () )
172
+ self .voronoi = QAction ( QCoreApplication .translate ( "fTools" , "Voronoi Polygons" ),self .iface .mainWindow () )
171
173
self .extNodes = QAction ( QCoreApplication .translate ( "fTools" , "Extract nodes" ),self .iface .mainWindow () )
172
174
self .simplify = QAction ( QCoreApplication .translate ( "fTools" , "Simplify geometries" ),self .iface .mainWindow () )
173
175
self .multiToSingle = QAction ( QCoreApplication .translate ( "fTools" , "Multipart to singleparts" ),self .iface .mainWindow () )
174
176
self .singleToMulti = QAction ( QCoreApplication .translate ( "fTools" , "Singleparts to multipart" ),self .iface .mainWindow () )
175
177
self .polysToLines = QAction ( QCoreApplication .translate ( "fTools" , "Polygons to lines" ),self .iface .mainWindow () )
176
- self .conversionMenu .addActions ( [ self .checkGeom , self .compGeo , self .centroids , self .delaunay ,
178
+ self .conversionMenu .addActions ( [ self .checkGeom , self .compGeo , self .centroids , self .delaunay , self . voronoi ,
177
179
self .simplify , self .multiToSingle , self .singleToMulti , self .polysToLines , self .extNodes ] )
178
180
179
181
self .dataManageMenu = QMenu ( QCoreApplication .translate ( "fTools" , "&Data Management Tools" ) )
@@ -232,6 +234,7 @@ def initGui( self ):
232
234
QObject .connect ( self .simplify , SIGNAL ("triggered()" ), self .dosimplify )
233
235
QObject .connect ( self .centroids , SIGNAL ("triggered()" ), self .docentroids )
234
236
QObject .connect ( self .delaunay , SIGNAL ("triggered()" ), self .dodelaunay )
237
+ QObject .connect ( self .voronoi , SIGNAL ("triggered()" ), self .dovoronoi )
235
238
QObject .connect ( self .polysToLines , SIGNAL ("triggered()" ), self .dopolysToLines )
236
239
QObject .connect ( self .compGeo , SIGNAL ("triggered()" ), self .docompGeo )
237
240
QObject .connect ( self .extNodes , SIGNAL ("triggered()" ), self .doextNodes )
@@ -249,7 +252,7 @@ def unload( self ):
249
252
pass
250
253
251
254
def dosimplify ( self ):
252
- d = doGeometry . GeometryDialog ( self .iface , 6 )
255
+ d = doSimplify . Dialog ( self .iface )
253
256
d .exec_ ()
254
257
255
258
def dopolysToLines ( self ):
@@ -324,6 +327,10 @@ def docentroids( self ):
324
327
def dodelaunay ( self ):
325
328
d = doGeometry .GeometryDialog ( self .iface , 8 )
326
329
d .exec_ ()
330
+
331
+ def dovoronoi ( self ):
332
+ d = doGeometry .GeometryDialog ( self .iface , 10 )
333
+ d .exec_ ()
327
334
328
335
def doextent ( self ):
329
336
d = doGeometry .GeometryDialog ( self .iface , 9 )
0 commit comments