Skip to content
Permalink
Browse files

add two new tools - polygon from layer extent - delaunay triangulaltion

changes to menu item - sampling tools -> research tools


git-svn-id: http://svn.osgeo.org/qgis/trunk@10265 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Mar 9, 2009
1 parent 86adf97 commit f882040718b5e484e15c250575bb443d350263ad
@@ -97,8 +97,8 @@ def initGui( self ):
self.analysisMenu.addActions( [ self.distMatrix, self.sumLines, self.pointsPoly,
self.listUnique, self.compStats, self.nearestNeigh, self.meanCoords, self.intLines ] )

self.samplingMenu = QMenu( QCoreApplication.translate( "fTools", "&Sampling Tools" ) )
self.samplingMenu.setIcon( QIcon( self.getThemeIcon( "sampling.png" ) ) )
self.researchMenu = QMenu( QCoreApplication.translate( "fTools", "&Research Tools" ) )
self.researchMenu.setIcon( QIcon( self.getThemeIcon( "sampling.png" ) ) )
self.randSel = QAction( QIcon( self.getThemeIcon( "random_selection.png" ) ),
QCoreApplication.translate( "fTools", "Random selection" ),self.iface.mainWindow() )
self.randSub = QAction( QIcon( self.getThemeIcon( "sub_selection.png" ) ),
@@ -111,8 +111,10 @@ def initGui( self ):
QCoreApplication.translate( "fTools", "Vector grid" ), self.iface.mainWindow() )
self.selectLocation = QAction( QIcon( self.getThemeIcon( "select_location.png" ) ),
QCoreApplication.translate( "fTools", "Select by location" ), self.iface.mainWindow() )
self.samplingMenu.addActions( [ self.randSel, self.randSub, self.randPoints,
self.regPoints, self.vectGrid, self.selectLocation ] )
self.layerExtent = QAction( QIcon( self.getThemeIcon( "layer_extent.png" ) ),
QCoreApplication.translate( "fTools", "Polygon from layer extent" ), self.iface.mainWindow() )
self.researchMenu.addActions( [ self.randSel, self.randSub, self.randPoints,
self.regPoints, self.vectGrid, self.selectLocation, self.layerExtent ] )

self.geoMenu = QMenu( QCoreApplication.translate( "fTools", "&Geoprocessing Tools" ) )
self.geoMenu.setIcon( QIcon( self.getThemeIcon( "geoprocessing.png" ) ) )
@@ -143,6 +145,8 @@ def initGui( self ):
QCoreApplication.translate( "fTools", "Check geometry validity" ),self.iface.mainWindow() )
self.centroids = QAction( QIcon( self.getThemeIcon( "centroids.png") ),
QCoreApplication.translate( "fTools", "Polygon centroids" ),self.iface.mainWindow() )
self.delaunay = QAction( QIcon( self.getThemeIcon( "delaunay.png") ),
QCoreApplication.translate( "fTools", "Delaunay triangulation" ),self.iface.mainWindow() )
self.extNodes = QAction( QIcon( self.getThemeIcon( "extract_nodes.png") ),
QCoreApplication.translate( "fTools", "Extract nodes" ),self.iface.mainWindow() )
self.simplify = QAction( QIcon( self.getThemeIcon( "simplify.png") ),
@@ -153,8 +157,8 @@ def initGui( self ):
QCoreApplication.translate( "fTools", "Singleparts to multipart" ),self.iface.mainWindow() )
self.polysToLines = QAction( QIcon( self.getThemeIcon( "to_lines.png") ),
QCoreApplication.translate( "fTools", "Polygons to lines" ),self.iface.mainWindow() )
self.conversionMenu.addActions( [ self.checkGeom, self.compGeo, self.centroids, self.simplify,
self.multiToSingle, self.singleToMulti, self.polysToLines, self.extNodes ] )
self.conversionMenu.addActions( [ self.checkGeom, self.compGeo, self.centroids, self.delaunay,
self.simplify, self.multiToSingle, self.singleToMulti, self.polysToLines, self.extNodes] )

self.dataManageMenu = QMenu( QCoreApplication.translate( "fTools", "&Data Management Tools") )
self.dataManageMenu.setIcon( QIcon( self.getThemeIcon( "management.png") ) )
@@ -170,21 +174,21 @@ def initGui( self ):
QCoreApplication.translate( "fTools", "Split vector layer" ), self.iface.mainWindow() )
self.dataManageMenu.addActions( [ self.project, self.define, self.joinAttr, self.spatJoin, self.splitVect ] )

self.ftools_about = QAction( QIcon( self.getThemeIcon( "ftools_logo.png" ) ),
QCoreApplication.translate( "fTools", "About fTools" ), self.iface.mainWindow() )
self.ftools_aboot = QAction( QIcon( self.getThemeIcon( "ftools_logo.png" ) ),
QCoreApplication.translate( "fTools", "fTools About" ), self.iface.mainWindow() )

self.menu.addMenu( self.analysisMenu )
self.menu.addMenu( self.samplingMenu )
self.menu.addMenu( self.researchMenu )
self.menu.addMenu( self.geoMenu )
self.menu.addMenu( self.conversionMenu )
self.menu.addMenu( self.dataManageMenu )
self.menu.addSeparator()
self.menu.addAction( self.ftools_about )
self.menu.addAction( self.ftools_aboot )

menuBar = self.iface.mainWindow().menuBar()
actions = menuBar.actions()
helpAction = actions[ len( actions ) - 1 ]
menuBar.insertMenu( helpAction, self.menu )
lastAction = actions[ len( actions ) - 1 ]
menuBar.insertMenu( lastAction, self.menu )

QObject.connect( self.distMatrix, SIGNAL("triggered()"), self.dodistMatrix )
QObject.connect( self.sumLines, SIGNAL("triggered()"), self.dosumLines )
@@ -201,6 +205,7 @@ def initGui( self ):
QObject.connect( self.regPoints, SIGNAL("triggered()"), self.doregPoints )
QObject.connect( self.vectGrid, SIGNAL("triggered()"), self.dovectGrid )
QObject.connect( self.selectLocation, SIGNAL("triggered()"), self.doselectLocation )
QObject.connect( self.layerExtent, SIGNAL("triggered()"), self.doextent )

QObject.connect( self.minConvex, SIGNAL("triggered()"), self.dominConvex )
QObject.connect( self.intersect, SIGNAL("triggered()"), self.dointersect )
@@ -216,6 +221,7 @@ def initGui( self ):
QObject.connect( self.checkGeom, SIGNAL("triggered()"), self.docheckGeom )
QObject.connect( self.simplify, SIGNAL("triggered()"), self.dosimplify )
QObject.connect( self.centroids, SIGNAL("triggered()"), self.docentroids )
QObject.connect( self.delaunay, SIGNAL("triggered()"), self.dodelaunay )
QObject.connect( self.polysToLines, SIGNAL("triggered()"), self.dopolysToLines )
QObject.connect( self.compGeo, SIGNAL("triggered()"), self.docompGeo )
QObject.connect( self.extNodes, SIGNAL("triggered()"), self.doextNodes )
@@ -226,7 +232,7 @@ def initGui( self ):
QObject.connect( self.spatJoin, SIGNAL("triggered()"), self.dospatJoin )
QObject.connect( self.splitVect, SIGNAL("triggered()"), self.dosplitVect )

QObject.connect( self.ftools_about, SIGNAL("triggered()"), self.doabout )
QObject.connect( self.ftools_aboot, SIGNAL("triggered()"), self.doaboot )

def unload( self ):
pass
@@ -302,6 +308,14 @@ def dodistMatrix( self ):
def docentroids( self ):
d = doGeometry.GeometryDialog( self.iface, 7 )
d.exec_()

def dodelaunay( self ):
d = doGeometry.GeometryDialog( self.iface, 8 )
d.exec_()

def doextent( self ):
d = doGeometry.GeometryDialog( self.iface, 9 )
d.exec_()

def dosumLines(self):
d = doSumLines.Dialog(self.iface)
@@ -371,6 +385,6 @@ def dospatJoin( self ):
d = doSpatialJoin.Dialog( self.iface )
d.exec_()

def doabout( self ):
def doaboot( self ):
d = doAbout.Dialog( self.iface )
d.exec_()
@@ -43,5 +43,7 @@ vector_grid.png
random_selection.png
ftools_logo.png
regular_points.png
delaunay.png
layer_extent.png
)
INSTALL(FILES ${ICON_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/fTools/icons/default)
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@
version="1.0"
sodipodi:docname="gis-0.1.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/cfarmer/.qgis/python/plugins/fTools/gis_icons/matrix.png"
inkscape:export-filename="/home/cfarmer/dev/cpp/qgis/python/plugins/fTools/icons/gis/layer_extent.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
style="display:inline;enable-background:new">
@@ -32,15 +32,15 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="16"
inkscape:cx="9.0201001"
inkscape:cy="8.9456096"
inkscape:cx="9.2319959"
inkscape:cy="11.794933"
inkscape:document-units="px"
inkscape:current-layer="layer129"
inkscape:current-layer="layer155"
showgrid="true"
inkscape:window-width="1159"
inkscape:window-height="700"
inkscape:window-x="86"
inkscape:window-y="72"
inkscape:window-y="48"
inkscape:snap-global="false"
showguides="true"
inkscape:guide-bbox="true"
@@ -2370,6 +2370,28 @@
style="fill:#82a0b4;fill-opacity:1;fill-rule:nonzero;stroke:#3c5a6e;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:2.4;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer134"
inkscape:label="delaunay"
style="display:none"
sodipodi:insensitive="true">
<path
style="fill:none;fill-rule:evenodd;stroke:#3c5a6e;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5.5,15.9375 L 12.5,9.5625 L 0.625,6.125"
id="path3778"
sodipodi:nodetypes="ccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#3c5a6e;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 8.0625,0.9375 L 12.4375,9.5 L 17.3125,0.8125"
id="path3780"
sodipodi:nodetypes="ccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#3c5a6e;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 23.25,14 L 12.5625,9.4375 L 16.9375,23.0625"
id="path3782"
sodipodi:nodetypes="ccc" />
</g>
</g>
<g
style="display:none"
@@ -6099,25 +6121,34 @@
inkscape:groupmode="layer"
id="layer129"
inkscape:label="matrix"
style="display:inline">
<g
id="g4571">
<path
id="path3756"
d="M 5.499146,0.50519709 L 5.499146,23.480886"
style="fill:none;fill-rule:evenodd;stroke:#969696;stroke-width:0.97941929px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
<path
id="path3761"
d="M 0.51176719,5.499146 L 23.528038,5.499146"
style="fill:none;fill-rule:evenodd;stroke:#969696;stroke-width:0.98028392px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
<rect
y="6.4966083"
x="6.4907565"
height="17.023754"
width="17.035219"
id="rect4569"
style="opacity:1;fill:#82a0b4;fill-opacity:0.99215686;fill-rule:nonzero;stroke:#3c5a6e;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.9;stroke-opacity:0.99215686;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
style="display:none">
<path
style="fill:none;fill-rule:evenodd;stroke:#969696;stroke-width:0.97941929px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 5.499146,0.50519709 L 5.499146,23.480886"
id="path3756" />
<path
style="fill:none;fill-rule:evenodd;stroke:#969696;stroke-width:0.98028392px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 0.51176719,5.499146 L 23.528038,5.499146"
id="path3761" />
<rect
style="fill:#82a0b4;fill-opacity:0.99215686;fill-rule:nonzero;stroke:#3c5a6e;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.9;stroke-opacity:0.99215686;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect4569"
width="17.035219"
height="17.023754"
x="6.4907565"
y="6.4966083" />
</g>
<g
inkscape:groupmode="layer"
id="layer155"
inkscape:label="extent">
<rect
style="fill:#82a0b4;fill-opacity:0.99215686;fill-rule:nonzero;stroke:#3c5a6e;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.9;stroke-opacity:0.99215686;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3768"
width="17.035219"
height="17.023754"
x="0.5448904"
y="0.55062294" />
</g>
</g>
<g
@@ -7097,7 +7128,7 @@
id="layer39"
inkscape:groupmode="layer">
<g
style="display:inline"
style="display:none"
inkscape:label="print composer"
id="layer43"
inkscape:groupmode="layer">
@@ -8017,7 +8048,7 @@
</g>
</g>
<g
style="display:none"
style="display:inline"
inkscape:label="actions"
id="layer11"
inkscape:groupmode="layer">
@@ -8267,7 +8298,7 @@
</g>
<g
sodipodi:insensitive="true"
style="display:none"
style="display:inline"
inkscape:label="create [yellow]"
id="layer15"
inkscape:groupmode="layer">
@@ -43,5 +43,7 @@ vector_grid.png
random_selection.png
ftools_logo.png
regular_points.png
delaunay.png
layer_extent.png
)
INSTALL(FILES ${ICON_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/fTools/icons/gis)
Binary file not shown.
Binary file not shown.

0 comments on commit f882040

Please sign in to comment.
You can’t perform that action at this time.