def __init__(self, iface, toolBar): # Save reference to the QGIS interface self.iface = iface self.canvas = self.iface.mapCanvas() self.gui = None # Points and Markers self.p1 = None self.p2 = None self.m1 = None self.m2 = None self.selected_feature = None #create action self.node_mover = QtGui.QAction( QtGui.QIcon(":/MovePolygonNodeByArea.png"), QtCore.QCoreApplication.translate( "digitizingtools", "Automatically modify polygon to target area moving one node"), self.iface.mainWindow()) self.node_mover.triggered.connect(self.run) self.iface.currentLayerChanged.connect(self.enable) toolBar.addAction(self.node_mover) self.enable() self.tool = DtSelectVertexTool(self.canvas)
def __init__(self, iface, toolBar, icon, tooltip, iconBatch, tooltipBatch, geometryTypes=[0, 1, 2], numVertices=1, dtName=None): DtDualTool.__init__(self, iface, toolBar, icon, tooltip, iconBatch, tooltipBatch, geometryTypes, dtName) self.tool = DtSelectVertexTool(self.canvas, numVertices)