QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
QgsHighlight Class Reference

A class for highlight features on the map. More...

#include <qgshighlight.h>

Inheritance diagram for QgsHighlight:
Inheritance graph
[legend]
Collaboration diagram for QgsHighlight:
Collaboration graph
[legend]

Public Member Functions

 QgsHighlight (QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer)
 ~QgsHighlight ()
void setColor (const QColor &color)
void setWidth (int width)
- Public Member Functions inherited from QgsMapCanvasItem
virtual void updatePosition ()
 called on changed extent or resize event to update position of the item
virtual QRectF boundingRect () const
 default implementation for canvas items
void setPanningOffset (const QPoint &point)
 sets current offset, to be called from QgsMapCanvas
QgsRectangle rect () const
 returns canvas item rectangle
void setRect (const QgsRectangle &r)
 sets canvas item rectangle
QgsPoint toMapCoordinates (const QPoint &point)
 transformation from screen coordinates to map coordinates
QPointF toCanvasCoordinates (const QgsPoint &point)
 transformation from map coordinates to screen coordinates

Protected Member Functions

virtual void paint (QPainter *p)
void updateRect ()
 recalculates needed rectangle
- Protected Member Functions inherited from QgsMapCanvasItem
 QgsMapCanvasItem (QgsMapCanvas *mapCanvas)
 protected constructor: cannot be constructed directly
virtual ~QgsMapCanvasItem ()
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 paint function called by map canvas
void updateCanvas ()
 schedules map canvas for repaint
bool setRenderContextVariables (QPainter *p, QgsRenderContext &context) const
 Sets render context parameters.

Private Member Functions

void paintPoint (QPainter *p, QgsPoint point)
void paintLine (QPainter *p, QgsPolyline line)
void paintPolygon (QPainter *p, QgsPolygon polygon)
 QgsHighlight ()

Private Attributes

QBrush mBrush
QPen mPen
QgsGeometrymGeometry
QgsVectorLayermLayer

Additional Inherited Members

- Protected Attributes inherited from QgsMapCanvasItem
QgsMapCanvasmMapCanvas
 pointer to map canvas
QgsRectangle mRect
 canvas item rectangle (in map coordinates)
QPoint mPanningOffset
 offset from normal position due current panning operation, used when converting map coordinates to move map canvas items
QSizeF mItemSize
 cached size of the item (to return in boundingRect())

Detailed Description

A class for highlight features on the map.

The QgsHighlight class provides a transparent overlay widget for highlightng features on the map.

Definition at line 30 of file qgshighlight.h.

Constructor & Destructor Documentation

QgsHighlight::QgsHighlight ( QgsMapCanvas mapCanvas,
QgsGeometry geom,
QgsVectorLayer layer 
)
QgsHighlight::~QgsHighlight ( )

Definition at line 43 of file qgshighlight.cpp.

References mGeometry.

QgsHighlight::QgsHighlight ( )
private

Member Function Documentation

void QgsHighlight::paint ( QPainter *  p)
protectedvirtual
void QgsHighlight::paintLine ( QPainter *  p,
QgsPolyline  line 
)
private

Definition at line 81 of file qgshighlight.cpp.

References QgsMapCanvasItem::toCanvasCoordinates().

Referenced by paint().

void QgsHighlight::paintPoint ( QPainter *  p,
QgsPoint  point 
)
private
void QgsHighlight::paintPolygon ( QPainter *  p,
QgsPolygon  polygon 
)
private

Definition at line 93 of file qgshighlight.cpp.

References mBrush, mPen, size, and QgsMapCanvasItem::toCanvasCoordinates().

Referenced by paint().

void QgsHighlight::setColor ( const QColor &  color)

Set the outline and fill color.

Definition at line 51 of file qgshighlight.cpp.

References mBrush, and mPen.

Referenced by QgsHighlight().

void QgsHighlight::setWidth ( int  width)

Set the outline width.

Definition at line 62 of file qgshighlight.cpp.

References mPen.

void QgsHighlight::updateRect ( )
protected

Member Data Documentation

QBrush QgsHighlight::mBrush
private

Definition at line 52 of file qgshighlight.h.

Referenced by paint(), paintPolygon(), and setColor().

QgsGeometry* QgsHighlight::mGeometry
private

Definition at line 54 of file qgshighlight.h.

Referenced by paint(), QgsHighlight(), updateRect(), and ~QgsHighlight().

QgsVectorLayer* QgsHighlight::mLayer
private

Definition at line 55 of file qgshighlight.h.

Referenced by QgsHighlight().

QPen QgsHighlight::mPen
private

Definition at line 53 of file qgshighlight.h.

Referenced by paint(), paintPolygon(), setColor(), and setWidth().


The documentation for this class was generated from the following files: