You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.3 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. #ifndef FIXEDIMAGEOVERLAY_H
  26. #define FIXEDIMAGEOVERLAY_H
  27. #include "qmapcontrol_global.h"
  28. #include "imagepoint.h"
  29. //! Draws a fixed image into the map.
  30. /*!
  31. * This class draws a image overlay onto a map, whose upper left and lower
  32. * right corners lay always on the given coordinates. The methods
  33. * setBaselevel, setMaxsize and setMinsize have no effect for this class.
  34. *
  35. * @author Kai Winter <kaiwinter@gmx.de>
  36. */
  37. class FixedImageOverlay : public ImagePoint {
  38. public:
  39. //! Creates an image overlay which loads and displays the given image file
  40. /*!
  41. * Use this contructor to load the given image file and let the point
  42. * display it.
  43. * When you want multiple points to display the same image, use the
  44. * other contructor and pass a pointer to that image.
  45. * @param x_upperleft the coordinate of the upper left corner where the image should be aligned
  46. * @param y_upperleft the coordinate of the upper left corner where the image should be aligned
  47. * @param x_lowerright the coordinate of the lower right corner where the image should be aligned
  48. * @param y_lowerright the coordinate of the lower right corner where the image should be aligned
  49. * @param filename the file which should be loaded and displayed
  50. * @param name the name of the image point
  51. */
  52. FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QString filename, QString name = QString());
  53. //! Creates an image overlay which displays the given image
  54. /*!
  55. * Use this contructor to display the given image.
  56. * @param x_upperleft the coordinate of the upper left corner where the image should be aligned
  57. * @param y_upperleft the coordinate of the upper left corner where the image should be aligned
  58. * @param x_lowerright the coordinate of the lower right corner where the image should be aligned
  59. * @param y_lowerright the coordinate of the lower right corner where the image should be aligned
  60. * @param pixmap pointer to the image pixmap
  61. * @param name the name of the image point
  62. */
  63. FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QPixmap pixmap, QString name = QString());
  64. virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset);
  65. virtual ~FixedImageOverlay();
  66. private:
  67. qreal x_lowerright;
  68. qreal y_lowerright;
  69. };
  70. #endif