QGIS API Documentation
2.8.2-Wien
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
src
core
qgspluginlayer.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgspluginlayer.cpp
3
---------------------
4
begin : January 2010
5
copyright : (C) 2010 by Martin Dobias
6
email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
#include "
qgspluginlayer.h
"
16
17
#include "
qgsmaplayerlegend.h
"
18
#include "
qgsmaplayerrenderer.h
"
19
20
QgsPluginLayer::QgsPluginLayer
( QString layerType, QString layerName )
21
:
QgsMapLayer
( PluginLayer, layerName ), mPluginLayerType( layerType )
22
{
23
setLegend
(
QgsMapLayerLegend::defaultPluginLegend
(
this
) );
24
}
25
26
QString
QgsPluginLayer::pluginLayerType
()
27
{
28
return
mPluginLayerType
;
29
}
30
31
void
QgsPluginLayer::setExtent
(
const
QgsRectangle
&extent )
32
{
33
mExtent
=
extent
;
34
}
35
36
QgsLegendSymbologyList
QgsPluginLayer::legendSymbologyItems
(
const
QSize& iconSize )
37
{
38
Q_UNUSED( iconSize );
39
return
QgsLegendSymbologyList
();
40
}
41
46
class
QgsPluginLayerRenderer
:
public
QgsMapLayerRenderer
47
{
48
public
:
49
QgsPluginLayerRenderer
(
QgsPluginLayer
* layer,
QgsRenderContext
& rendererContext )
50
:
QgsMapLayerRenderer
( layer->id() )
51
,
mLayer
( layer )
52
,
mRendererContext
( rendererContext )
53
{}
54
55
virtual
bool
render
()
override
56
{
57
return
mLayer
->
draw
(
mRendererContext
);
58
}
59
60
protected
:
61
QgsPluginLayer
*
mLayer
;
62
QgsRenderContext
&
mRendererContext
;
63
};
64
65
QgsMapLayerRenderer
*
QgsPluginLayer::createMapRenderer
(
QgsRenderContext
& rendererContext )
66
{
67
return
new
QgsPluginLayerRenderer
(
this
, rendererContext );
68
}
Generated on Sun May 10 2015 16:33:24 for QGIS API Documentation by
1.8.1.2