File indexing completed on 2025-01-05 03:58:58
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2009 Patrick Spendrin <ps_ml@gmx.de> 0004 // 0005 0006 #ifndef MARBLE_GEODATAMULTIGEOMETRYPRIVATE_H 0007 #define MARBLE_GEODATAMULTIGEOMETRYPRIVATE_H 0008 0009 #include "GeoDataGeometry_p.h" 0010 0011 #include "GeoDataPoint.h" 0012 #include "GeoDataPolygon.h" 0013 #include "GeoDataTrack.h" 0014 #include "GeoDataMultiTrack.h" 0015 #include "GeoDataLineString.h" 0016 #include "GeoDataLinearRing.h" 0017 #include "GeoDataModel.h" 0018 0019 0020 namespace Marble 0021 { 0022 0023 class GeoDataMultiGeometryPrivate : public GeoDataGeometryPrivate 0024 { 0025 public: 0026 GeoDataMultiGeometryPrivate() 0027 { 0028 } 0029 0030 ~GeoDataMultiGeometryPrivate() override 0031 { 0032 qDeleteAll(m_vector); 0033 } 0034 0035 GeoDataMultiGeometryPrivate& operator=( const GeoDataMultiGeometryPrivate &other) 0036 { 0037 GeoDataGeometryPrivate::operator=( other ); 0038 0039 qDeleteAll( m_vector ); 0040 m_vector.clear(); 0041 0042 m_vector.reserve(other.m_vector.size()); 0043 0044 for (const GeoDataGeometry *geometry: other.m_vector) { 0045 0046 m_vector.append(geometry->copy()); 0047 } 0048 return *this; 0049 } 0050 0051 GeoDataGeometryPrivate *copy() const override 0052 { 0053 GeoDataMultiGeometryPrivate* copy = new GeoDataMultiGeometryPrivate; 0054 *copy = *this; 0055 return copy; 0056 } 0057 0058 QVector<GeoDataGeometry*> m_vector; 0059 }; 0060 0061 } // namespace Marble 0062 0063 #endif