QGIS API Documentation
2.4.0-Chugiak
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
protected
:
72
virtual
void
paint
( QPainter* p );
73
75
void
updateRect();
76
77
private
:
78
void
init();
79
void
setSymbol(
QgsSymbolV2
* symbol,
const
QgsRenderContext
& context,
const
QColor & color,
const
QColor & fillColor );
80
double
getSymbolWidth(
const
QgsRenderContext
& context,
double
width,
QgsSymbolV2::OutputUnit
unit );
82
QgsFeatureRendererV2
* getRenderer(
const
QgsRenderContext
& context,
const
QColor & color,
const
QColor & fillColor );
83
void
paintPoint( QPainter *p,
QgsPoint
point );
84
void
paintLine( QPainter *p,
QgsPolyline
line );
85
void
paintPolygon( QPainter *p,
QgsPolygon
polygon );
86
87
QBrush
mBrush
;
88
QPen
mPen
;
89
QgsGeometry
*
mGeometry
;
90
QgsMapLayer
*
mLayer
;
91
QgsFeature
mFeature
;
92
double
mBuffer
;
// line / outline buffer in pixels
93
double
mMinWidth
;
// line / outline minimum width in pixels
94
};
95
96
#endif
QgsMapLayer
Base class for all map layer types.
Definition:
qgsmaplayer.h:47
QgsSymbolV2::OutputUnit
OutputUnit
Definition:
qgssymbolv2.h:47
qgsfeaturestore.h
QgsPolyline
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
Definition:
qgsgeometry.h:38
QgsMapCanvasItem
An abstract class for items that can be placed on the map canvas.
Definition:
qgsmapcanvasitem.h:30
QgsHighlight::mLayer
QgsMapLayer * mLayer
Definition:
qgshighlight.h:90
QgsGeometry
Definition:
qgsgeometry.h:74
qgssymbolv2.h
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:113
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition:
qgsmapcanvas.h:104
QgsHighlight::setBuffer
void setBuffer(double buffer)
Set line / outline buffer in millimeters.
Definition:
qgshighlight.h:63
QgsHighlight::mFeature
QgsFeature mFeature
Definition:
qgshighlight.h:91
QgsHighlight::mGeometry
QgsGeometry * mGeometry
Definition:
qgshighlight.h:89
QgsHighlight
A class for highlight features on the map.
Definition:
qgshighlight.h:36
qgsrendererv2.h
QgsPolygon
QVector< QgsPolyline > QgsPolygon
polygon: first item of the list is outer ring, inner rings (if any) start from second item ...
Definition:
qgsgeometry.h:44
QgsHighlight::layer
const QgsMapLayer * layer() const
Definition:
qgshighlight.h:69
QgsSymbolV2
Definition:
qgssymbolv2.h:43
QgsPoint
A class to represent a point geometry.
Definition:
qgspoint.h:63
qgsgeometry.h
QgsHighlight::mBuffer
double mBuffer
Definition:
qgshighlight.h:92
QgsMapCanvasItem::paint
virtual void paint(QPainter *painter)=0
function to be implemented by derived classes
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:39
QgsHighlight::mMinWidth
double mMinWidth
Definition:
qgshighlight.h:93
QgsHighlight::mPen
QPen mPen
Definition:
qgshighlight.h:88
QgsFeatureRendererV2
Definition:
qgsrendererv2.h:69
QgsHighlight::mBrush
QBrush mBrush
Definition:
qgshighlight.h:87
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:455
qgsmapcanvasitem.h
QgsHighlight::setMinWidth
void setMinWidth(double width)
Set minimum line / outline width in millimeters.
Definition:
qgshighlight.h:67
Generated on Wed Mar 18 2015 11:40:14 for QGIS API Documentation by
1.8.9.1