本文整理汇总了Python中processing.gui.AlgorithmClassification.AlgorithmDecorator类的典型用法代码示例。如果您正苦于以下问题:Python AlgorithmDecorator类的具体用法?Python AlgorithmDecorator怎么用?Python AlgorithmDecorator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AlgorithmDecorator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
def initialize():
# Add the basic providers
Processing.addProvider(QGISAlgorithmProvider())
Processing.addProvider(ModelerOnlyAlgorithmProvider())
Processing.addProvider(GdalOgrAlgorithmProvider())
Processing.addProvider(LidarToolsAlgorithmProvider())
Processing.addProvider(OTBAlgorithmProvider())
Processing.addProvider(RAlgorithmProvider())
Processing.addProvider(SagaAlgorithmProvider())
Processing.addProvider(GrassAlgorithmProvider())
Processing.addProvider(Grass7AlgorithmProvider())
Processing.addProvider(ScriptAlgorithmProvider())
Processing.addProvider(TauDEMAlgorithmProvider())
Processing.addProvider(Processing.modeler)
Processing.modeler.initializeSettings()
# And initialize
AlgorithmDecorator.loadClassification()
ProcessingLog.startLogging()
ProcessingConfig.initialize()
ProcessingConfig.readSettings()
RenderingStyles.loadStyles()
Processing.loadFromProviders()
# Inform registered listeners that all providers' algorithms have been loaded
Processing.fireAlgsListHasChanged()
示例2: initialize
def initialize():
#add the basic providers
Processing.addProvider(QGISAlgorithmProvider())
Processing.addProvider(ModelerOnlyAlgorithmProvider())
Processing.addProvider(GdalOgrAlgorithmProvider())
Processing.addProvider(LidarToolsAlgorithmProvider())
Processing.addProvider(OTBAlgorithmProvider())
Processing.addProvider(RAlgorithmProvider())
Processing.addProvider(SagaAlgorithmProvider())
Processing.addProvider(GrassAlgorithmProvider())
Processing.addProvider(ScriptAlgorithmProvider())
Processing.addProvider(TauDEMAlgorithmProvider())
Processing.addProvider(AdminToolsAlgorithmProvider())
Processing.modeler.initializeSettings();
#and initialize
AlgorithmDecorator.loadClassification()
ProcessingLog.startLogging()
ProcessingConfig.initialize()
ProcessingConfig.loadSettings()
RenderingStyles.loadStyles()
Processing.loadFromProviders()
示例3: __init__
def __init__(self, alg):
settings = QSettings()
useCategories = settings.value(ProcessingToolbox.USE_CATEGORIES, type=bool)
QTreeWidgetItem.__init__(self)
self.alg = alg
icon = alg.getIcon()
name = alg.name
if useCategories:
icon = GeoAlgorithm.getDefaultIcon()
(group, subgroup, name) = AlgorithmDecorator.getGroupsAndName(alg)
self.setIcon(0, icon)
self.setToolTip(0, name)
self.setText(0, name)
示例4: fillTreeUsingCategories
def fillTreeUsingCategories(self):
providersToExclude = ["model", "script"]
self.algorithmTree.clear()
text = unicode(self.searchBox.text())
groups = {}
for providerName in Processing.algs.keys():
provider = Processing.algs[providerName]
name = "ACTIVATE_" + providerName.upper().replace(" ", "_")
if not ProcessingConfig.getSetting(name):
continue
if providerName in providersToExclude or len(ModelerUtils.providers[providerName].actions) != 0:
continue
algs = provider.values()
# add algorithms
for alg in algs:
if not alg.showInToolbox:
continue
(altgroup, altsubgroup, altname) = AlgorithmDecorator.getGroupsAndName(alg)
if altgroup is None:
continue
if text == "" or text.lower() in altname.lower():
if altgroup not in groups:
groups[altgroup] = {}
group = groups[altgroup]
if altsubgroup not in group:
groups[altgroup][altsubgroup] = []
subgroup = groups[altgroup][altsubgroup]
subgroup.append(alg)
if len(groups) > 0:
mainItem = QTreeWidgetItem()
mainItem.setText(0, "Geoalgorithms")
mainItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
mainItem.setToolTip(0, mainItem.text(0))
for (groupname, group) in groups.items():
groupItem = QTreeWidgetItem()
groupItem.setText(0, groupname)
groupItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
groupItem.setToolTip(0, groupItem.text(0))
mainItem.addChild(groupItem)
for (subgroupname, subgroup) in group.items():
subgroupItem = QTreeWidgetItem()
subgroupItem.setText(0, subgroupname)
subgroupItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
subgroupItem.setToolTip(0, subgroupItem.text(0))
groupItem.addChild(subgroupItem)
for alg in subgroup:
algItem = TreeAlgorithmItem(alg)
subgroupItem.addChild(algItem)
self.algorithmTree.addTopLevelItem(mainItem)
for providerName in Processing.algs.keys():
if providerName not in providersToExclude:
continue
name = "ACTIVATE_" + providerName.upper().replace(" ", "_")
if not ProcessingConfig.getSetting(name):
continue
providerItem = TreeProviderItem(providerName)
self.algorithmTree.addTopLevelItem(providerItem)
示例5: fillTreeUsingCategories
def fillTreeUsingCategories(self):
providersToExclude = ['model', 'script']
self.algorithmTree.clear()
text = unicode(self.searchBox.text())
groups = {}
for providerName in Processing.algs.keys():
provider = Processing.algs[providerName]
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
if not ProcessingConfig.getSetting(name):
continue
if providerName in providersToExclude \
or len(Providers.providers[providerName].actions) != 0:
continue
algs = provider.values()
# add algorithms
for alg in algs:
if not alg.showInToolbox:
continue
(altgroup, altsubgroup, altname) = \
AlgorithmDecorator.getGroupsAndName(alg)
if altgroup is None:
continue
if text == '' or text.lower() in altname.lower():
if altgroup not in groups:
groups[altgroup] = {}
group = groups[altgroup]
if altsubgroup not in group:
groups[altgroup][altsubgroup] = []
subgroup = groups[altgroup][altsubgroup]
subgroup.append(alg)
if len(groups) > 0:
mainItem = QTreeWidgetItem()
mainItem.setText(0, 'Geoalgorithms')
mainItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
mainItem.setToolTip(0, mainItem.text(0))
for (groupname, group) in groups.items():
groupItem = QTreeWidgetItem()
groupItem.setText(0, groupname)
groupItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
groupItem.setToolTip(0, groupItem.text(0))
mainItem.addChild(groupItem)
for (subgroupname, subgroup) in group.items():
subgroupItem = QTreeWidgetItem()
subgroupItem.setText(0, subgroupname)
subgroupItem.setIcon(0, GeoAlgorithm.getDefaultIcon())
subgroupItem.setToolTip(0, subgroupItem.text(0))
groupItem.addChild(subgroupItem)
for alg in subgroup:
algItem = TreeAlgorithmItem(alg)
subgroupItem.addChild(algItem)
self.algorithmTree.addTopLevelItem(mainItem)
for providerName in Processing.algs.keys():
groups = {}
provider = Processing.algs[providerName]
name = 'ACTIVATE_' + providerName.upper().replace(' ', '_')
if not ProcessingConfig.getSetting(name):
continue
if providerName not in providersToExclude:
continue
algs = provider.values()
# add algorithms
for alg in algs:
if not alg.showInToolbox:
continue
if text == '' or text.lower() in alg.name.lower():
if alg.group in groups:
groupItem = groups[alg.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0, alg.group)
groupItem.setToolTip(0, alg.group)
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
actions = Processing.actions[providerName]
for action in actions:
if text == '' or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0, action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)
if len(groups) > 0:
providerItem = QTreeWidgetItem()
providerItem.setText(0, Processing.getProviderFromName(
providerName).getDescription())
providerItem.setIcon(0, Processing.getProviderFromName(
providerName).getIcon())
#.........这里部分代码省略.........