File indexing completed on 2024-05-12 03:50:17

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2009 Torsten Rahn <rahn@kde.org>
0004 //
0005 
0006 #ifndef MARBLE_GEODATAREGIONPRIVATE_H
0007 #define MARBLE_GEODATAREGIONPRIVATE_H
0008 
0009 #include "GeoDataRegion.h"
0010 
0011 #include "GeoDataLatLonAltBox.h"
0012 #include "GeoDataTypes.h"
0013 #include "GeoDataLod.h"
0014 
0015 namespace Marble
0016 {
0017 
0018 class GeoDataRegionPrivate
0019 {
0020   public:
0021     GeoDataRegionPrivate()
0022          : m_parent( nullptr ),
0023            m_latLonAltBox( nullptr ),
0024            m_lod( nullptr )
0025     {
0026     }
0027 
0028     GeoDataRegionPrivate( const GeoDataRegionPrivate& other )
0029          : m_parent( other.m_parent )
0030     {
0031         if ( other.m_latLonAltBox ) {
0032             m_latLonAltBox = new GeoDataLatLonAltBox( *other.m_latLonAltBox );
0033         }
0034         else {
0035             m_latLonAltBox = nullptr;
0036         }
0037 
0038         if ( other.m_lod ) {
0039             m_lod = new GeoDataLod( *other.m_lod );
0040         }
0041         else {
0042             m_lod = nullptr;
0043         }
0044     }
0045 
0046 
0047     explicit GeoDataRegionPrivate( GeoDataFeature * feature )
0048          : m_parent( feature ),
0049            m_latLonAltBox( nullptr ),
0050            m_lod( nullptr )
0051     {
0052     }
0053 
0054     ~GeoDataRegionPrivate()
0055     {
0056         delete m_latLonAltBox;
0057         delete m_lod;
0058     }
0059 
0060     GeoDataFeature * m_parent;
0061     GeoDataLatLonAltBox * m_latLonAltBox;
0062     GeoDataLod * m_lod;
0063 
0064   private:
0065     // Preventing usage of operator=
0066     GeoDataRegionPrivate &operator=( const GeoDataRegionPrivate& ) = delete;
0067 };
0068 
0069 } // namespace Marble
0070 
0071 #endif