File indexing completed on 2024-05-12 15:29:52

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2015 Stanciu Marius-Valeriu <stanciumarius94@gmail.com>
0004 //
0005 
0006 #ifndef MARBLE_OSMOBJECTMANAGER_H
0007 #define MARBLE_OSMOBJECTMANAGER_H
0008 
0009 #include <marble_export.h>
0010 #include <QtGlobal>
0011 
0012 namespace Marble
0013 {
0014 
0015 class GeoDataPlacemark;
0016 
0017 /**
0018  * @brief The OsmObjectManager class is used to assign osmData to placemarks that
0019  * do not have them at write time. Objects with no osmData usually consist of
0020  * new placemarks created in the editor and placemarks loaded from KML files.
0021  */
0022 class MARBLE_EXPORT OsmObjectManager
0023 {
0024 public:
0025 
0026     /**
0027      * @brief initializeOsmData assigns valid osmData
0028      * to a placemark that does not have it.
0029      */
0030     static void initializeOsmData( GeoDataPlacemark *placemark );
0031 
0032     /**
0033      * @brief registerId is used to keep track of the minimum id @see m_minId
0034      */
0035     static void registerId( qint64 id );
0036 
0037 private:
0038     /**
0039      * @brief newly created placemarks are assigned negative unique IDs.
0040      * In order to assure there are no duplicate IDs, they are assigned the
0041      * minId - 1 id.
0042      */
0043     static qint64 m_minId;
0044 };
0045 
0046 }
0047 
0048 #endif
0049