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
gui
qgshighlight.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgshighlight.h - widget to highlight geometries
3
--------------------------------------
4
Date : 02-Mar-2011
5
Copyright : (C) 2011 by Juergen E. Fischer, norBIT GmbH
6
Email : jef at norbit dot de
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
#ifndef QGSHIGHLIGHT_H
16
#define QGSHIGHLIGHT_H
17
18
#include "
qgsmapcanvasitem.h
"
19
#include "
qgsfeaturestore.h
"
20
#include "
qgsgeometry.h
"
21
#include "
qgsrendererv2.h
"
22
#include "
qgssymbolv2.h
"
23
#include <QBrush>
24
#include <QColor>
25
#include <QList>
26
#include <QPen>
27
#include <QPainter>
28
#include <QPainterPath>
29
30
class
QgsMapLayer
;
31
class
QgsVectorLayer
;
32
class
QgsSymbolV2
;
33
36
class
GUI_EXPORT
QgsHighlight
:
public
QgsMapCanvasItem
37
{
38
public
:
39
QgsHighlight
(
QgsMapCanvas
*mapCanvas,
QgsGeometry
*geom,
QgsMapLayer
*layer );
40
QgsHighlight
(
QgsMapCanvas
*mapCanvas,
QgsGeometry
*geom,
QgsVectorLayer
*layer );
47
QgsHighlight
(
QgsMapCanvas
*mapCanvas,
const
QgsFeature
& feature,
QgsVectorLayer
*layer );
48
~
QgsHighlight
();
49
52
void
setColor(
const
QColor & color );
53
56
void
setFillColor(
const
QColor & fillColor );
57
59
void
setWidth(
int
width );
60
63
void
setBuffer
(
double
buffer ) { mBuffer = buffer; }
64
67
void
setMinWidth
(
double
width ) { mMinWidth = width; }
68
69
const
QgsMapLayer
*
layer
()
const
{
return
mLayer; }
70
71
virtual
void
updatePosition
()
override
;
72
73
protected
:
74
virtual
void
paint
( QPainter* p )
override
;
75
77
void
updateRect();
78
79
private
:
80
void
init();
81
void
setSymbol(
QgsSymbolV2
* symbol,
const
QgsRenderContext
& context,
const
QColor & color,
const
QColor & fillColor );
82
double
getSymbolWidth(
const
QgsRenderContext
& context,
double
width,
QgsSymbolV2::OutputUnit
unit );
84
QgsFeatureRendererV2
* getRenderer(
const
QgsRenderContext
& context,
const
QColor & color,
const
QColor & fillColor );
85
void
paintPoint( QPainter *p,
QgsPoint
point );
86
void
paintLine( QPainter *p,
QgsPolyline
line );
87
void
paintPolygon( QPainter *p,
QgsPolygon
polygon );
88
89
QBrush mBrush;
90
QPen mPen;
91
QgsGeometry
*mGeometry;
92
QgsMapLayer
*mLayer;
93
QgsFeature
mFeature;
94
double
mBuffer;
// line / outline buffer in pixels
95
double
mMinWidth;
// line / outline minimum width in pixels
96
};
97
98
#endif
Generated on Sun May 10 2015 16:33:26 for QGIS API Documentation by
1.8.1.2