Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
395 | KeyOz | 1 | /* |
2 | * |
||
3 | * This file is part of QMapControl, |
||
4 | * an open-source cross-platform map widget |
||
5 | * |
||
6 | * Copyright (C) 2007 - 2009 Kai Winter |
||
7 | * |
||
8 | * This program is free software: you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU Lesser General Public License as published by |
||
10 | * the Free Software Foundation, either version 3 of the License, or |
||
11 | * (at your option) any later version. |
||
12 | * |
||
13 | * This program is distributed in the hope that it will be useful, |
||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
16 | * GNU Lesser General Public License for more details. |
||
17 | * |
||
18 | * You should have received a copy of the GNU Lesser General Public License |
||
19 | * along with QMapControl. If not, see <http://www.gnu.org/licenses/>. |
||
20 | * |
||
21 | * Contact e-mail: kaiwinter@gmx.de |
||
22 | * Program URL : http://qmapcontrol.sourceforge.net/ |
||
23 | * |
||
24 | */ |
||
25 | |||
26 | #ifndef FIXEDIMAGEOVERLAY_H |
||
27 | #define FIXEDIMAGEOVERLAY_H |
||
28 | |||
29 | #include "imagepoint.h" |
||
30 | |||
31 | namespace qmapcontrol |
||
32 | { |
||
33 | |||
34 | //! Draws a fixed image into the map. |
||
35 | /*! |
||
36 | * This class draws a image overlay onto a map, whose upper left and lower |
||
37 | * right corners lay always on the given coordinates. The methods |
||
38 | * setBaselevel, setMaxsize and setMinsize have no effect for this class. |
||
39 | * |
||
40 | * @author Kai Winter <kaiwinter@gmx.de> |
||
41 | */ |
||
42 | class FixedImageOverlay : public ImagePoint |
||
43 | { |
||
44 | public: |
||
45 | //! Creates an image overlay which loads and displays the given image file |
||
46 | /*! |
||
47 | * Use this contructor to load the given image file and let the point |
||
48 | * display it. |
||
49 | * When you want multiple points to display the same image, use the |
||
50 | * other contructor and pass a pointer to that image. |
||
51 | * @param x_upperleft the coordinate of the upper left corner where the image should be aligned |
||
52 | * @param y_upperleft the coordinate of the upper left corner where the image should be aligned |
||
53 | * @param x_lowerright the coordinate of the lower right corner where the image should be aligned |
||
54 | * @param y_lowerright the coordinate of the lower right corner where the image should be aligned |
||
55 | * @param filename the file which should be loaded and displayed |
||
56 | * @param name the name of the image point |
||
57 | */ |
||
58 | FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QString filename, QString name = QString()); |
||
59 | |||
60 | //! Creates an image overlay which displays the given image |
||
61 | /*! |
||
62 | * Use this contructor to display the given image. |
||
63 | * @param x_upperleft the coordinate of the upper left corner where the image should be aligned |
||
64 | * @param y_upperleft the coordinate of the upper left corner where the image should be aligned |
||
65 | * @param x_lowerright the coordinate of the lower right corner where the image should be aligned |
||
66 | * @param y_lowerright the coordinate of the lower right corner where the image should be aligned |
||
67 | * @param pixmap pointer to the image pixmap |
||
68 | * @param name the name of the image point |
||
69 | */ |
||
70 | FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QPixmap* pixmap, QString name = QString()); |
||
71 | |||
72 | virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset); |
||
73 | virtual ~FixedImageOverlay(); |
||
74 | |||
75 | private: |
||
76 | qreal x_lowerright; |
||
77 | qreal y_lowerright; |
||
78 | }; |
||
79 | } |
||
80 | #endif |