1
/***************************************************************************
3
A rectangle that can be drawn on the acetate layer of a QgsMapCanvas
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
18
/* $Id: qgsacetaterectangle.h,v 1.4 2004/12/30 02:52:35 timlinux Exp $ */
20
#ifndef QGSACETATERECTANGLE_H
21
#define QGSACETATERECTANGLE_H
27
#include "qgsacetateobject.h"
29
/** \class QgsAcetateRectangle
30
* \brief A rectangle drawn on the acetate layer of a map canvas
32
* An acetate object is a graphic or text object that is drawn on top of the map canvas
33
* after rendering of all map elements is completed. Acetate objects can be drawn in
34
* device coordinates or map coordinates. Drawing in map coordinates requires passing
35
* a QgsMapToPixel object to the draw function.
38
class QgsAcetateRectangle : public QgsAcetateObject {
41
* Constructor. Constructs an object with the specified origin. If the object is
42
* spatially referenced, the origin should be in map coordinates.
44
QgsAcetateRectangle(QgsPoint &origin, const QgsRect &rectangle);
48
~QgsAcetateRectangle();
50
* Draw the rectangle using the Qpainter and applying a coordinate transform if
52
* @param painter Painter to use for drawing
53
* @param cXf Coordinate transform to use in drawing map coordinate on the device. If
54
* this parameter is not specified, coordinates are assumed to be device coordinates
55
* rather than map coordinates.
57
void draw (QPainter * painter, QgsMapToPixel * cXf=0);
59
* Set the origin point
60
* @param value Point of origin
62
void setOrigin (QgsPoint value );
64
* Returns the point of origin
68
* Returns the current rectangle
71
/** Sets the rectangle
72
* @param rect The rectanlge
74
void setRectangle(QgsRect value);
76
//! Origin of the object in device or map coordinates
81
#endif //QGSACETATERECTANGLE_H