File indexing completed on 2024-04-14 03:47:48
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2008 Torsten Rahn <tackat@kde.org> 0004 // SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se> 0005 // 0006 0007 #ifndef MARBLE_LAYERINTERFACE_H 0008 #define MARBLE_LAYERINTERFACE_H 0009 0010 #include "marble_export.h" 0011 0012 #include <QtGlobal> 0013 0014 class QStringList; 0015 class QString; 0016 0017 namespace Marble { 0018 0019 class RenderState; 0020 0021 class GeoPainter; 0022 class GeoSceneLayer; 0023 class ViewportParams; 0024 0025 class MARBLE_EXPORT LayerInterface 0026 { 0027 public: 0028 0029 /** Destructor */ 0030 virtual ~LayerInterface(); 0031 0032 /** 0033 * @brief Preferred level in the layer stack for the rendering 0034 * 0035 * Gives a preferred level in the existing layer stack where 0036 * the render() method of this plugin should get executed. 0037 * 0038 * Possible Values: 0039 * "NONE" 0040 * "STARS" 0041 * "BEHIND_TARGET" 0042 * "SURFACE" 0043 * "HOVERS_ABOVE_SURFACE" 0044 * "ATMOSPHERE" 0045 * "ORBIT" 0046 * "ALWAYS_ON_TOP" 0047 * "FLOAT_ITEM" 0048 * "USER_TOOLS" 0049 */ 0050 virtual QStringList renderPosition() const = 0; 0051 0052 /** 0053 * @brief Renders the content provided by the layer on the viewport. 0054 * @param painter painter object allowing to paint on the map 0055 * @param viewport metadata, such as current projection, screen dimension, etc. 0056 * @param renderPos current render position 0057 * @param layer deprecated, always zero (NULL) 0058 * @return @c true Returns whether the rendering has been successful 0059 */ 0060 virtual bool render( GeoPainter *painter, ViewportParams *viewport, 0061 const QString &renderPos, GeoSceneLayer *layer ) = 0; 0062 0063 /** 0064 * @brief Returns the z value of the layer (default: 0.0). If two layers are painted 0065 * at the same render position, the one with the higher z value is painted on top. 0066 * If both have the same z value, their paint order is undefined. 0067 */ 0068 virtual qreal zValue() const; 0069 0070 virtual RenderState renderState() const; 0071 0072 /** 0073 * @brief Returns a debug line for perfo/tracing issues 0074 */ 0075 virtual QString runtimeTrace() const; 0076 }; 0077 0078 } // namespace Marble 0079 0080 #endif