Exemplo n.º 1
0
	def initGui(self):
		# create action 
		self.action = QAction(QIcon(":/plugins/profiletool/icons/profileIcon.png"), "Terrain profile", self.iface.mainWindow())
		self.action.setWhatsThis("Plots terrain profiles")
		QObject.connect(self.action, SIGNAL("triggered()"), self.run)
		self.aboutAction = QAction("About", self.iface.mainWindow())
		QObject.connect(self.aboutAction, SIGNAL("triggered()"), self.about)

		# add toolbar button and menu item
		self.iface.addToolBarIcon(self.action)
		self.iface.addPluginToMenu("&Profile Tool", self.action)
		self.iface.addPluginToMenu("&Profile Tool", self.aboutAction)
		
		#Init classe variables
		self.tool = ProfiletoolMapTool(self.iface.mapCanvas(),self.action)		#the mouselistener
		self.dockOpened = False		#remember for not reopening dock if there's already one opened
		self.pointstoDraw = None	#Polyline in mapcanvas CRS analysed
		self.dblclktemp = None		#enable disctinction between leftclick and doubleclick
		self.mdl = None				#the model whitch in are saved layers analysed caracteristics
		self.selectionmethod = 0						#The selection method defined in option
		self.saveTool = self.canvas.mapTool()			#Save the standard mapttool for restoring it at the end
		self.layerindex = None							#for selection mode
		self.previousLayer = None						#for selection mode
		self.plotlibrary = None							#The plotting library to use
		self.textquit0 = "Click for polyline and double click to end (right click to cancel then quit)"
		self.textquit1 = "Select the polyline in a vector layer (Right click to quit)"
    def initGui(self):
        # create action
        self.action = QAction(
            QIcon(
                ":/plugins/temporalprofiletool/icons/temporalProfileIcon.png"),
            "Temporal/Spectral Profile", self.iface.mainWindow())
        self.action.setWhatsThis("Plots temporal/spectral profiles")
        QObject.connect(self.action, SIGNAL("triggered()"), self.run)
        self.aboutAction = QAction("About", self.iface.mainWindow())
        QObject.connect(self.aboutAction, SIGNAL("triggered()"), self.about)

        # add toolbar button and menu item
        self.iface.addToolBarIcon(self.action)
        self.iface.addPluginToMenu("&Profile Tool", self.action)
        self.iface.addPluginToMenu("&Profile Tool", self.aboutAction)

        #Init class variables
        self.pointTool = ProfiletoolMapTool(self.iface.mapCanvas(),
                                            self.action)  #the mouselistener
        self.dockOpened = False  #remember for not reopening dock if there's already one opened
        self.pointstoDraw = None  #Polyline in mapcanvas CRS analysed
        self.dblclktemp = None  #enable disctinction between leftclick and doubleclick
        self.mdl = None  #the model whitch in are saved layers analysed caracteristics
        self.selectionmethod = 0  #The selection method defined in option
        self.saveTool = self.canvas.mapTool(
        )  #Save the standard mapttool for restoring it at the end
        self.plotlibrary = None  #The plotting library to use
        self.pointSelectionInstructions = "Click on a raster for temporal/spectral profile (right click to cancel then quit)"
        self.selectedPolygonInstructions = 'Use "Select Features" tool to select polygon(s) designating AOI for which temporal/spectral profile should be calculated'