/usr/include/marble/TileId.h is in libmarble-dev 4:4.13.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2008, 2010 Jens-Michael Hoffmann <jensmh@gmx.de>
// Copyright 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
//
#ifndef MARBLE_TILEID_H
#define MARBLE_TILEID_H
#include <QHash>
#include <QString>
#include "marble_export.h"
#include "GeoDataCoordinates.h"
#include "GeoDataLatLonBox.h"
#include "GeoSceneTextureTile.h"
namespace Marble
{
class GeoDataCoordinates;
class MARBLE_EXPORT TileId
{
public:
TileId( QString const & mapThemeId, int zoomLevel, int tileX, int tileY );
TileId( uint mapThemeIdHash, int zoomLevel, int tileX, int tileY );
TileId();
int zoomLevel() const;
int x() const;
int y() const;
uint mapThemeIdHash() const;
bool operator==( TileId const& rhs ) const;
bool operator<( TileId const& rhs ) const;
GeoDataLatLonBox toLatLonBox( const GeoSceneTiled *textureLayer ) const;
static TileId fromCoordinates( const GeoDataCoordinates& coords, int popularity );
private:
uint m_mapThemeIdHash;
int m_zoomLevel;
int m_tileX;
int m_tileY;
};
uint qHash( TileId const& );
// inline definitions
inline int TileId::zoomLevel() const
{
return m_zoomLevel;
}
inline int TileId::x() const
{
return m_tileX;
}
inline int TileId::y() const
{
return m_tileY;
}
inline uint TileId::mapThemeIdHash() const
{
return m_mapThemeIdHash;
}
inline bool TileId::operator==( TileId const& rhs ) const
{
return m_zoomLevel == rhs.m_zoomLevel
&& m_tileX == rhs.m_tileX
&& m_tileY == rhs.m_tileY
&& m_mapThemeIdHash == rhs.m_mapThemeIdHash;
}
inline bool TileId::operator<( TileId const& rhs ) const
{
if (m_zoomLevel < rhs.m_zoomLevel)
return true;
else if (m_zoomLevel == rhs.m_zoomLevel
&& m_tileX < rhs.m_tileX)
return true;
else if (m_zoomLevel == rhs.m_zoomLevel
&& m_tileX == rhs.m_tileX
&& m_tileY < rhs.m_tileY)
return true;
else if (m_zoomLevel == rhs.m_zoomLevel
&& m_tileX == rhs.m_tileX
&& m_tileY == rhs.m_tileY
&& m_mapThemeIdHash < rhs.m_mapThemeIdHash)
return true;
return false;
}
inline uint qHash( TileId const& tid )
{
const quint64 tmp = (( quint64 )( tid.zoomLevel() ) << 36 )
+ (( quint64 )( tid.x() ) << 18 )
+ ( quint64 )( tid.y() );
return ::qHash( tmp ) ^ tid.mapThemeIdHash();
}
}
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<( QDebug, const Marble::TileId & );
#endif
#endif
|