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.

99 lines
2.0 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 - 2008 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. #include "geometry.h"
  26. Geometry::Geometry(QString name)
  27. : GeometryType("Geometry"), myparentGeometry(0), mypen(0), visible(true), myname(name)
  28. {
  29. }
  30. Geometry::~Geometry()
  31. {
  32. }
  33. QString Geometry::name() const
  34. {
  35. return myname;
  36. }
  37. Geometry* Geometry::parentGeometry() const
  38. {
  39. return myparentGeometry;
  40. }
  41. void Geometry::setParentGeometry(Geometry* geom)
  42. {
  43. myparentGeometry = geom;
  44. }
  45. bool Geometry::hasPoints() const
  46. {
  47. return false;
  48. }
  49. bool Geometry::hasClickedPoints() const
  50. {
  51. return false;
  52. }
  53. QList<Geometry*>& Geometry::clickedPoints()
  54. {
  55. return touchedPoints;
  56. }
  57. bool Geometry::isVisible() const
  58. {
  59. return visible;
  60. }
  61. void Geometry::setVisible(bool visible)
  62. {
  63. this->visible = visible;
  64. emit(updateRequest(boundingBox()));
  65. }
  66. void Geometry::setName(QString name)
  67. {
  68. myname = name;
  69. }
  70. void Geometry::setPen(QPen* pen)
  71. {
  72. mypen = pen;
  73. }
  74. QPen* Geometry::pen() const
  75. {
  76. return mypen;
  77. }
  78. void Geometry::geometryClicked(Geometry* geometry, QPoint point){
  79. }
  80. void Geometry::updateRequest(Geometry* geom){
  81. }
  82. void Geometry::updateRequest(QRectF rect){
  83. }
  84. void Geometry::positionChanged(Geometry* geom){
  85. }