def test_mixed(self):
     sym = self.renderer.symbol()
     buffer_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'buffer($geometry, "value"/15)'})
     buffer_layer.setSymbolType(QgsSymbolV2.Fill)
     buffer_layer.subSymbol()
     sym.appendSymbolLayer(buffer_layer)
     marker_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'centroid($geometry)'})
     marker_layer.setSymbolType(QgsSymbolV2.Marker)
     sym.appendSymbolLayer(marker_layer)
     renderchecker = QgsMultiRenderChecker()
     renderchecker.setMapSettings(self.mapsettings)
     renderchecker.setControlName('expected_geometrygenerator_mixed')
     self.assertTrue(renderchecker.runTest('geometrygenerator_mixed'))
    def test_mixed(self):
        sym = self.polys_layer.rendererV2().symbol()

        buffer_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'buffer($geometry, "value"/15)'})
        buffer_layer.setSymbolType(QgsSymbolV2.Fill)
        self.assertIsNotNone(buffer_layer.subSymbol())
        sym.appendSymbolLayer(buffer_layer)
        marker_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'centroid($geometry)'})
        marker_layer.setSymbolType(QgsSymbolV2.Marker)
        sym.appendSymbolLayer(marker_layer)

        rendered_layers = [self.polys_layer.id()]
        self.mapsettings.setLayers(rendered_layers)

        renderchecker = QgsMultiRenderChecker()
        renderchecker.setMapSettings(self.mapsettings)
        renderchecker.setControlName('expected_geometrygenerator_mixed')
        self.assertTrue(renderchecker.runTest('geometrygenerator_mixed'))
 def test_marker(self):
     sym = self.renderer.symbol()
     sym_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'centroid($geometry)'})
     sym_layer.setSymbolType(QgsSymbolV2.Marker)
     sym.changeSymbolLayer(0, sym_layer)
     renderchecker = QgsMultiRenderChecker()
     renderchecker.setMapSettings(self.mapsettings)
     renderchecker.setControlName('expected_geometrygenerator_marker')
     self.assertTrue(renderchecker.runTest('geometrygenerator_marker'))
    def test_marker(self):
        sym = self.polys_layer.rendererV2().symbol()
        sym_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'centroid($geometry)'})
        sym_layer.setSymbolType(QgsSymbolV2.Marker)
        sym.changeSymbolLayer(0, sym_layer)

        rendered_layers = [self.polys_layer.id()]
        self.mapsettings.setLayers(rendered_layers)

        renderchecker = QgsMultiRenderChecker()
        renderchecker.setMapSettings(self.mapsettings)
        renderchecker.setControlName('expected_geometrygenerator_marker')
        self.assertTrue(renderchecker.runTest('geometrygenerator_marker'))
    def test_buffer_points(self):
        sym = self.points_layer.rendererV2().symbol()

        buffer_layer = QgsGeometryGeneratorSymbolLayerV2.create({'geometryModifier': 'buffer($geometry, "staff"/15)'})
        buffer_layer.setSymbolType(QgsSymbolV2.Fill)
        self.assertIsNotNone(buffer_layer.subSymbol())
        sym.appendSymbolLayer(buffer_layer)

        rendered_layers = [self.points_layer.id()]
        self.mapsettings.setLayers(rendered_layers)

        renderchecker = QgsMultiRenderChecker()
        renderchecker.setMapSettings(self.mapsettings)
        renderchecker.setControlName('expected_geometrygenerator_buffer_points')
        self.assertTrue(renderchecker.runTest('geometrygenerator_buffer_points'))