File indexing completed on 2024-05-19 03:51:50

0001 /*
0002     SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef MARBLE_GEOSCENEMAP_H
0008 #define MARBLE_GEOSCENEMAP_H
0009 
0010 #include <QVector>
0011 #include <QVariant>
0012 
0013 #include <geodata_export.h>
0014 
0015 #include "GeoDocument.h"
0016 
0017 class QColor;
0018 class QString;
0019 
0020 namespace Marble
0021 {
0022 
0023 class GeoSceneLayer;
0024 class GeoSceneFilter;
0025 
0026 class GeoSceneMapPrivate;
0027 
0028 /**
0029  * @short Map layer structure of a GeoScene document.
0030  */
0031 class GEODATA_EXPORT GeoSceneMap : public GeoNode
0032 {
0033  public:
0034     GeoSceneMap();
0035     ~GeoSceneMap() override;
0036     const char* nodeType() const override;
0037 
0038     QColor backgroundColor() const;
0039     void setBackgroundColor( const QColor& );
0040 
0041     QColor labelColor() const;
0042     void setLabelColor( const QColor& );
0043 
0044     QColor highlightBrushColor() const;
0045     void setHighlightBrushColor( const QColor& );
0046 
0047     QColor highlightPenColor() const;
0048     void setHighlightPenColor( const QColor& );
0049     /**
0050      * @brief  Add a new layer to the map
0051      * @param  layer  The new layer
0052      */
0053     void addLayer( GeoSceneLayer* );
0054     /**
0055      * @ brief Set starting center with lon lat cooredinates
0056      * used if a scene downloadUrl do not handle elements in other locations
0057      */
0058     void setCenter(const QString & coordinateString);
0059     /**
0060      * @breif Get starting center with cooredinates
0061      * used if a scene downloadUrl do not handle elements in other locations
0062      * return A QVariantList of lon lat as specified in the dgml
0063      */
0064     QVariantList center() const;
0065     /**
0066      * @brief  Return a layer by its name
0067      * @param  name  The name of the layer
0068      * @return A pointer to the layer request by its name
0069      */
0070     GeoSceneLayer* layer( const QString& name );
0071     const GeoSceneLayer* layer( const QString& name ) const;
0072 
0073     /**
0074      * @brief  Return all layers
0075      * @return A vector that contains pointers to all available layers
0076      */
0077     QVector<GeoSceneLayer*> layers() const;
0078 
0079     /**
0080      * @brief  Add a new filter to the map
0081      * @param  filter  The new filter
0082      */
0083     void addFilter( GeoSceneFilter* );
0084 
0085     /**
0086      * @brief  Return a filter by its name
0087      * @param  name  The name of the filter
0088      * @return A pointer to the filter request by its name
0089      */
0090     GeoSceneFilter* filter( const QString& name );
0091 
0092     /**
0093      * @brief  Return all filters
0094      * @return A vector that contains pointers to all available filters
0095      */
0096     QVector<GeoSceneFilter*> filters() const;
0097 
0098     /**
0099      * @brief  Checks for valid layers that contain texture data
0100      * @return Whether a texture layer got created internally 
0101      *
0102      * NOTE: The existence of the file(s) that contain the actual data  
0103      *       still needs to get checked at runtime!
0104      */
0105     bool hasTextureLayers() const;
0106 
0107     /**
0108      * @brief  Checks for valid layers that contain vector data
0109      * @return Whether a vector layer got created internally 
0110      *
0111      * NOTE: The existence of the file(s) that contain the actual data  
0112      *       still needs to get checked at runtime!
0113      */
0114     bool hasVectorLayers() const;
0115 
0116  private:
0117     Q_DISABLE_COPY( GeoSceneMap )
0118     GeoSceneMapPrivate * const d;
0119 };
0120 
0121 }
0122 
0123 #endif