File indexing completed on 2025-01-05 03:58:58
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com> 0004 // 0005 0006 #include "GeoDataOrientation.h" 0007 #include "GeoDataTypes.h" 0008 0009 namespace Marble { 0010 0011 class GeoDataOrientationPrivate 0012 { 0013 public: 0014 double m_heading; 0015 0016 double m_tilt; 0017 0018 double m_roll; 0019 0020 GeoDataOrientationPrivate(); 0021 }; 0022 0023 GeoDataOrientationPrivate::GeoDataOrientationPrivate() : 0024 m_heading(0), m_tilt(0), m_roll(0) 0025 { 0026 // nothing to do 0027 } 0028 0029 GeoDataOrientation::GeoDataOrientation() : d( new GeoDataOrientationPrivate ) 0030 { 0031 // nothing to do 0032 } 0033 0034 GeoDataOrientation::GeoDataOrientation( const Marble::GeoDataOrientation &other ) : 0035 GeoDataObject( other ), d( new GeoDataOrientationPrivate( *other.d ) ) 0036 { 0037 // nothing to do 0038 } 0039 0040 GeoDataOrientation &GeoDataOrientation::operator=( const GeoDataOrientation &other ) 0041 { 0042 GeoDataObject::operator=( other ); 0043 *d = *other.d; 0044 return *this; 0045 } 0046 0047 0048 bool GeoDataOrientation::operator==( const GeoDataOrientation &other ) const 0049 { 0050 return equals(other) && 0051 d->m_heading == other.d->m_heading && 0052 d->m_roll == other.d->m_roll && 0053 d->m_tilt == other.d->m_tilt; 0054 } 0055 0056 bool GeoDataOrientation::operator!=( const GeoDataOrientation &other ) const 0057 { 0058 return !this->operator==( other ); 0059 } 0060 0061 GeoDataOrientation::~GeoDataOrientation() 0062 { 0063 delete d; 0064 } 0065 0066 const char *GeoDataOrientation::nodeType() const 0067 { 0068 return GeoDataTypes::GeoDataOrientationType; 0069 } 0070 0071 double GeoDataOrientation::heading() const 0072 { 0073 return d->m_heading; 0074 } 0075 0076 void GeoDataOrientation::setHeading( double heading ) 0077 { 0078 d->m_heading = heading; 0079 } 0080 0081 double GeoDataOrientation::tilt() const 0082 { 0083 return d->m_tilt; 0084 } 0085 0086 void GeoDataOrientation::setTilt( double tilt ) 0087 { 0088 d->m_tilt = tilt; 0089 } 0090 0091 double GeoDataOrientation::roll() const 0092 { 0093 return d->m_roll; 0094 } 0095 0096 void GeoDataOrientation::setRoll( double roll ) 0097 { 0098 d->m_roll = roll; 0099 } 0100 0101 }