File indexing completed on 2025-01-05 03:59:00
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com> 0004 // 0005 0006 #include "GeoDataScreenOverlay.h" 0007 #include "GeoDataScreenOverlay_p.h" 0008 #include "GeoDataTypes.h" 0009 0010 namespace Marble { 0011 0012 GeoDataScreenOverlay::GeoDataScreenOverlay() 0013 : GeoDataOverlay(new GeoDataScreenOverlayPrivate) 0014 { 0015 } 0016 0017 GeoDataScreenOverlay::GeoDataScreenOverlay( const Marble::GeoDataScreenOverlay &other ) 0018 : GeoDataOverlay(other, new GeoDataScreenOverlayPrivate(*other.d_func())) 0019 { 0020 } 0021 0022 GeoDataScreenOverlay::~GeoDataScreenOverlay() 0023 { 0024 } 0025 0026 GeoDataScreenOverlay &GeoDataScreenOverlay::operator=( const GeoDataScreenOverlay &other ) 0027 { 0028 if (this != &other) { 0029 Q_D(GeoDataScreenOverlay); 0030 *d = *other.d_func(); 0031 } 0032 0033 return *this; 0034 } 0035 0036 bool GeoDataScreenOverlay::operator==(const GeoDataScreenOverlay& other) const 0037 { 0038 Q_D(const GeoDataScreenOverlay); 0039 const GeoDataScreenOverlayPrivate* const other_d = other.d_func(); 0040 0041 return equals(other) && 0042 d->m_overlayXY == other_d->m_overlayXY && 0043 d->m_screenXY == other_d->m_screenXY && 0044 d->m_rotationXY == other_d->m_rotationXY && 0045 d->m_size == other_d->m_size && 0046 d->m_rotation == other_d->m_rotation; 0047 } 0048 0049 bool GeoDataScreenOverlay::operator!=(const GeoDataScreenOverlay& other) const 0050 { 0051 return !this->operator==(other); 0052 } 0053 0054 GeoDataFeature * GeoDataScreenOverlay::clone() const 0055 { 0056 return new GeoDataScreenOverlay(*this); 0057 } 0058 0059 const char *GeoDataScreenOverlay::nodeType() const 0060 { 0061 return GeoDataTypes::GeoDataScreenOverlayType; 0062 } 0063 0064 GeoDataVec2 GeoDataScreenOverlay::overlayXY() const 0065 { 0066 Q_D(const GeoDataScreenOverlay); 0067 return d->m_overlayXY; 0068 } 0069 0070 void GeoDataScreenOverlay::setOverlayXY(const GeoDataVec2 &vec2) 0071 { 0072 Q_D(GeoDataScreenOverlay); 0073 d->m_overlayXY = vec2; 0074 } 0075 0076 void GeoDataScreenOverlay::setOverlayXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit) 0077 { 0078 Q_D(GeoDataScreenOverlay); 0079 d->m_screenXY.setX(x); 0080 d->m_screenXY.setY(y); 0081 d->m_screenXY.setXunits(xunit); 0082 d->m_screenXY.setYunits(yunit); 0083 } 0084 0085 GeoDataVec2 GeoDataScreenOverlay::screenXY() const 0086 { 0087 Q_D(const GeoDataScreenOverlay); 0088 return d->m_screenXY; 0089 } 0090 0091 void GeoDataScreenOverlay::setScreenXY(const GeoDataVec2 &vec2) 0092 { 0093 Q_D(GeoDataScreenOverlay); 0094 d->m_screenXY = vec2; 0095 } 0096 0097 void GeoDataScreenOverlay::setScreenXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit) 0098 { 0099 Q_D(GeoDataScreenOverlay); 0100 d->m_screenXY.setX(x); 0101 d->m_screenXY.setY(y); 0102 d->m_screenXY.setXunits(xunit); 0103 d->m_screenXY.setYunits(yunit); 0104 } 0105 0106 GeoDataVec2 GeoDataScreenOverlay::rotationXY() const 0107 { 0108 Q_D(const GeoDataScreenOverlay); 0109 return d->m_rotationXY; 0110 } 0111 0112 void GeoDataScreenOverlay::setRotationXY(const GeoDataVec2 &vec2) 0113 { 0114 Q_D(GeoDataScreenOverlay); 0115 d->m_rotationXY = vec2; 0116 } 0117 0118 void GeoDataScreenOverlay::setRotationXY(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit) 0119 { 0120 Q_D(GeoDataScreenOverlay); 0121 d->m_rotationXY.setX(x); 0122 d->m_rotationXY.setY(y); 0123 d->m_rotationXY.setXunits(xunit); 0124 d->m_rotationXY.setYunits(yunit); 0125 } 0126 0127 GeoDataVec2 GeoDataScreenOverlay::size() const 0128 { 0129 Q_D(const GeoDataScreenOverlay); 0130 return d->m_size; 0131 } 0132 0133 void GeoDataScreenOverlay::setSize(const GeoDataVec2 &vec2) 0134 { 0135 Q_D(GeoDataScreenOverlay); 0136 d->m_size = vec2; 0137 } 0138 0139 void GeoDataScreenOverlay::setSize(qreal x, qreal y, GeoDataVec2::Unit xunit, GeoDataVec2::Unit yunit) 0140 { 0141 Q_D(GeoDataScreenOverlay); 0142 d->m_size.setX(x); 0143 d->m_size.setY(y); 0144 d->m_size.setXunits(xunit); 0145 d->m_size.setYunits(yunit); 0146 } 0147 0148 qreal GeoDataScreenOverlay::rotation() const 0149 { 0150 Q_D(const GeoDataScreenOverlay); 0151 return d->m_rotation; 0152 } 0153 0154 void GeoDataScreenOverlay::setRotation(qreal rotation) 0155 { 0156 Q_D(GeoDataScreenOverlay); 0157 d->m_rotation = rotation; 0158 } 0159 0160 }