示例#1
0
    def layerAdded(self, layer):
        if layer.type() == QgsMapLayer.VectorLayer:
            for param in self.alg.parameters:
                if param.hidden:
                    continue
                if isinstance(param, ParameterVector):
                    if dataobjects.canUseVectorLayer(layer, param.shapetype):
                        widget = self.valueItems[param.name]
                        if isinstance(widget, InputLayerSelectorPanel):
                            widget = widget.cmbText
                        widget.addItem(self.getExtendedLayerName(layer), layer)
        elif layer.type() == QgsMapLayer.RasterLayer and dataobjects.canUseRasterLayer(layer):
            for param in self.alg.parameters:
                if param.hidden:
                    continue
                if isinstance(param, ParameterRaster):
                    widget = self.valueItems[param.name].cmbText
                    widget.addItem(self.getExtendedLayerName(layer), layer)

        self.updateMultipleInputs()
示例#2
0
    def layerAdded(self, layer):
        if layer.type() == QgsMapLayer.VectorLayer:
            for param in self.alg.parameters:
                if param.hidden:
                    continue
                if isinstance(param, ParameterVector):
                    if dataobjects.canUseVectorLayer(layer, param.datatype):
                        widget = self.valueItems[param.name]
                        if isinstance(widget, InputLayerSelectorPanel):
                            widget = widget.cmbText
                        widget.addItem(self.getExtendedLayerName(layer), layer)
        elif layer.type() == QgsMapLayer.RasterLayer and dataobjects.canUseRasterLayer(layer):
            for param in self.alg.parameters:
                if param.hidden:
                    continue
                if isinstance(param, ParameterRaster):
                    widget = self.valueItems[param.name].cmbText
                    widget.addItem(self.getExtendedLayerName(layer), layer)

        self.updateMultipleInputs()
示例#3
0
文件: outputs.py 项目: spono/QGIS
 def hasGeometry(self):
     if self.base_layer is None:
         return True
     return dataobjects.canUseVectorLayer(self.base_layer, [-1])
示例#4
0
 def hasGeometry(self):
     if self.base_layer is None:
         return True
     return dataobjects.canUseVectorLayer(self.base_layer, [-1])