~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/qgsacetaterectangle.h

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                             qgsacetaterectangle.h
3
 
  A rectangle that can be drawn on the acetate layer of a QgsMapCanvas
4
 
                              -------------------
5
 
  begin                : June 10, 2004
6
 
  copyright            : (C) 2004 by Gary E.Sherman
7
 
  email                : sherman at mrcc.com
8
 
 ***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
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.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
/* $Id: qgsacetaterectangle.h,v 1.4 2004/12/30 02:52:35 timlinux Exp $ */
19
 
 
20
 
#ifndef QGSACETATERECTANGLE_H
21
 
#define QGSACETATERECTANGLE_H
22
 
 
23
 
class QgsPoint;
24
 
class QPainter;
25
 
class QgsMapToPixel;
26
 
#include <qgsrect.h>
27
 
#include "qgsacetateobject.h"
28
 
 
29
 
/** \class QgsAcetateRectangle
30
 
 * \brief A rectangle drawn on the acetate layer of a map canvas
31
 
 *
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.
36
 
 *
37
 
 */ 
38
 
class QgsAcetateRectangle : public QgsAcetateObject {
39
 
  public:
40
 
    /**
41
 
     * Constructor. Constructs an object with the specified origin. If the object is
42
 
     * spatially referenced, the origin should be in map coordinates.
43
 
     */
44
 
    QgsAcetateRectangle(QgsPoint &origin, const QgsRect &rectangle);
45
 
    /** 
46
 
     * Destructor
47
 
     */
48
 
    ~QgsAcetateRectangle();
49
 
    /**
50
 
     * Draw the rectangle using the Qpainter and applying a coordinate transform if
51
 
     * specified.
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.
56
 
     */
57
 
    void  draw (QPainter * painter, QgsMapToPixel * cXf=0);
58
 
    /** 
59
 
     * Set the origin point
60
 
     * @param value Point of origin
61
 
     */
62
 
    void setOrigin (QgsPoint value );
63
 
    /**
64
 
     * Returns the point of origin
65
 
     */
66
 
    QgsPoint origin();
67
 
    /**
68
 
     * Returns the current rectangle
69
 
     */
70
 
    QgsRect rectangle();
71
 
    /** Sets the rectangle
72
 
     * @param rect The rectanlge
73
 
     */
74
 
    void setRectangle(QgsRect value);
75
 
  private:
76
 
    //! Origin of the object in device or map coordinates 
77
 
    QgsPoint mOrigin;
78
 
    //! Rectangle
79
 
    QgsRect mRectangle;
80
 
};
81
 
#endif //QGSACETATERECTANGLE_H
82