~ubuntu-branches/ubuntu/hardy/qgis/hardy

« back to all changes in this revision

Viewing changes to src/qgsacetateobject.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
 
                               qgsacetateobject.h
3
 
  An object 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: qgsacetateobject.h,v 1.6 2004/12/30 02:52:35 timlinux Exp $ */
19
 
 
20
 
#ifndef QGSACETATEOBJECT_H
21
 
#define QGSACETATEOBJECT_H
22
 
class QgsPoint;
23
 
class QPainter;
24
 
class QgsMapToPixel;
25
 
 
26
 
/*! \class QgsAcetateObject
27
 
* \brief Base class for all objects that are drawn on the acetate layer of a map canvas.
28
 
*
29
 
* An acetate object is a graphic or text object that is drawn on top of the map canvas 
30
 
* after rendering of all map elements is completed. Acetate objects can be drawn in
31
 
* device coordinates or map coordinates. Drawing in map coordinates requires passing
32
 
* a QgsMapToPixel object to the draw function.
33
 
*
34
 
* The draw function must be overridden in a subclass to provide the specfic logic for
35
 
* drawing the object.
36
 
*/ 
37
 
class QgsAcetateObject 
38
 
{
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
 
  QgsAcetateObject(QgsPoint &origin);
45
 
 
46
 
  /** Constructs an acetate object without an origin point. This is appropriate for
47
 
   * objects that are not point-centric, such as polygons or collections of acetate
48
 
   * objects.
49
 
   */
50
 
  QgsAcetateObject();
51
 
 
52
 
  /** 
53
 
   * Destructor
54
 
   */
55
 
  virtual ~QgsAcetateObject();
56
 
 
57
 
  /**
58
 
   * Draw the object using the Qpainter and applying a coordinate transform if
59
 
   * specified.
60
 
   * @param painter Painter to use for drawing
61
 
   * @param cXf Coordinate transform to use in drawing map coordinate on the device. If 
62
 
   * this parameter is not specified, coordinates are assumed to be device coordinates
63
 
   * rather than map coordinates.
64
 
   */
65
 
  virtual void  draw (QPainter * painter, QgsMapToPixel * cXf=0)=0;
66
 
   /** 
67
 
    * Set the origin point
68
 
    * @param value Point of origin
69
 
    */
70
 
  void setOrigin (QgsPoint value );
71
 
 /**
72
 
  * Returns the point of origin
73
 
  */
74
 
  QgsPoint origin();
75
 
 
76
 
private:
77
 
  //! Origin of the object in device or map coordinates 
78
 
   QgsPoint mOrigin;
79
 
};
80
 
#endif //QGSACETATEOBJECT_H
81